X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fio%2Fkblock.h;h=9ac358ce37e34e01122a924c55018fea8de2b2ca;hb=2045959d176e3584849c9bd67728317922604265;hp=8d30ffc386bd5ca6f56e0ab736c29fb8007eecca;hpb=064508b5d658cff958bf6a3e5d803c308e4ab9ec;p=bertos.git diff --git a/bertos/io/kblock.h b/bertos/io/kblock.h index 8d30ffc3..9ac358ce 100644 --- a/bertos/io/kblock.h +++ b/bertos/io/kblock.h @@ -33,6 +33,8 @@ * \author Francesco Sacchi * * \brief KBlock interface + * + * $WIZ$ module_name = "kblock" */ #ifndef IO_KBLOCK_H @@ -90,9 +92,13 @@ typedef struct KBlockVTable } KBlockVTable; -#define KB_BUFFERED BV(0) ///< Internal flag: true if the KBlock has a buffer -#define KB_CACHE_DIRTY BV(1) ///< Internal flag: true if the cache is dirty -#define KB_PARTIAL_WRITE BV(2) ///< Internal flag: true if the device allows partial block write +#define KB_BUFFERED BV(0) ///< Internal flag: true if the KBlock has a buffer +#define KB_CACHE_DIRTY BV(1) ///< Internal flag: true if the cache is dirty +#define KB_PARTIAL_WRITE BV(2) ///< Internal flag: true if the device allows partial block write + +#define KB_WRITE_ONCE BV(3) ///< Allow only the one write on select block. +#define KB_OPEN_BUFF BV(4) ///< Open flash memory using page caching, allowing the modification and partial write. +#define KB_OPEN_UNBUFF BV(5) ///< Open flash memory whitout memory caching. /** * KBlock private members. @@ -202,7 +208,6 @@ INLINE int kblock_error(struct KBlock *b) * * \param b KBlock device. * - * \return 0 on success, EOF on errors. * * \sa kblock_error() */ @@ -363,5 +368,6 @@ int kblock_swLoad(struct KBlock *b, block_idx_t index); int kblock_swStore(struct KBlock *b, block_idx_t index); size_t kblock_swReadBuf(struct KBlock *b, void *buf, size_t offset, size_t size); size_t kblock_swWriteBuf(struct KBlock *b, const void *buf, size_t offset, size_t size); +int kblock_swClose(struct KBlock *b); #endif /* IO_KBLOCK_H */