KM3NeT CLB
2.0
KM3NeT CLB v2 Embedded Software
|
Allows for storage of persistent information in flash. More...
Go to the source code of this file.
Macros | |
#define | E_BS_INVALID (E_BLOCK + 0x01) |
Block storage is not valid. Must erase. | |
#define | E_BS_INVALID_DESCR "Can not load blockdata, invalid" |
#define | E_BS_LEN_MISMATCH (E_BLOCK + 0x02) |
Buffer does not match the size of the allocated area. | |
#define | E_BS_LEN_MISMATCH_DESCR "Length of block not equal to provided buffer" |
Functions | |
bool | bsSave (unsigned int block, void *data, size_t len) |
Saves a block of data on the internal flash. More... | |
bool | bsLoad (unsigned int block, void *data, size_t len) |
Loads a block of data from the flash. More... | |
bool | bsCheck (unsigned int block, size_t len, bool *hasValidData) |
Checks the contents of a block. More... | |
bool | bsErase (unsigned int block) |
Erases all data. More... | |
Allows for storage of persistent information in flash.
Definition in file blockstore.h.
bool bsCheck | ( | unsigned int | block, |
size_t | len, | ||
bool * | hasValidData | ||
) |
Checks the contents of a block.
block | The block to check |
len | Length to check (optional, 0 - don't check). |
hasValidData | Pointer to result to fill. |
true | Check successful. |
false | Check failed, please check error module for error. |
Definition at line 63 of file blockstore.c.
bool bsErase | ( | unsigned int | block | ) |
Erases all data.
block | Block number |
true | Erase successful. |
false | Erase failed, please check error module for error. |
Definition at line 91 of file blockstore.c.
bool bsLoad | ( | unsigned int | block, |
void * | data, | ||
size_t | len | ||
) |
Loads a block of data from the flash.
block | The block number. |
data | The data |
len | The length |
true | Loading successful. |
false | Loading failed, please check error module for error. |
Definition at line 79 of file blockstore.c.
bool bsSave | ( | unsigned int | block, |
void * | data, | ||
size_t | len | ||
) |
Saves a block of data on the internal flash.
If there is already data in the flash, and its not the same, the block will be erased, and new data written.
block | The block number |
data | The data to write |
len | The length of the data |
true | Saving successful. |
false | Saving failed, please check error module for error. |
Definition at line 46 of file blockstore.c.