Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
|
FCB instance structure. More...
#include <fcb.h>
Data Fields | |
uint32_t | f_magic |
Magic value, should not be 0xFFFFFFFF. | |
uint8_t | f_version |
Current version number of the data. | |
uint8_t | f_sector_cnt |
Number of elements in sector array. | |
uint8_t | f_scratch_cnt |
Number of sectors to keep empty. | |
struct flash_sector * | f_sectors |
Array of sectors, must be contiguous. | |
struct k_mutex | f_mtx |
Locking for accessing the FCB data, internal state. | |
struct flash_sector * | f_oldest |
Pointer to flash sector containing the oldest data, internal state. | |
struct fcb_entry | f_active |
internal state | |
uint16_t | f_active_id |
Flash location where the newest data is, internal state. | |
uint8_t | f_align |
writes to flash have to aligned to this, internal state | |
const struct flash_area * | fap |
Flash area used by the fcb instance, internal state. | |
uint8_t | f_erase_value |
The value flash takes when it is erased. | |
FCB instance structure.
The following data structure describes the FCB itself. First part should be filled in by the user before calling fcb_init. The second part is used by FCB for its internal bookkeeping.
struct fcb_entry fcb::f_active |
internal state
uint16_t fcb::f_active_id |
Flash location where the newest data is, internal state.
uint8_t fcb::f_align |
writes to flash have to aligned to this, internal state
uint8_t fcb::f_erase_value |
The value flash takes when it is erased.
This is read from flash parameters and initialized upon call to fcb_init.
uint32_t fcb::f_magic |
Magic value, should not be 0xFFFFFFFF.
It is xored with inversion of f_erase_value and placed in the beginning of FCB flash sector. FCB uses this when determining whether sector contains valid data or not. Giving it value of 0xFFFFFFFF means leaving bytes of the filed in "erased" state.
struct k_mutex fcb::f_mtx |
Locking for accessing the FCB data, internal state.
struct flash_sector* fcb::f_oldest |
Pointer to flash sector containing the oldest data, internal state.
uint8_t fcb::f_scratch_cnt |
Number of sectors to keep empty.
This can be used if you need to have scratch space for garbage collecting when FCB fills up.
uint8_t fcb::f_sector_cnt |
Number of elements in sector array.
struct flash_sector* fcb::f_sectors |
Array of sectors, must be contiguous.
uint8_t fcb::f_version |
Current version number of the data.
const struct flash_area* fcb::fap |
Flash area used by the fcb instance, internal state.
This can be transfer to FCB user