Zephyr API Documentation  3.6.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches

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_sectorf_sectors
 Array of sectors, must be contiguous.
 
struct k_mutex f_mtx
 Locking for accessing the FCB data, internal state.
 
struct flash_sectorf_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_areafap
 Flash area used by the fcb instance, internal state.
 
uint8_t f_erase_value
 The value flash takes when it is erased.
 

Detailed Description

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.

Field Documentation

◆ f_active

struct fcb_entry fcb::f_active

internal state

◆ f_active_id

uint16_t fcb::f_active_id

Flash location where the newest data is, internal state.

◆ f_align

uint8_t fcb::f_align

writes to flash have to aligned to this, internal state

◆ f_erase_value

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.

◆ f_magic

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.

◆ f_mtx

struct k_mutex fcb::f_mtx

Locking for accessing the FCB data, internal state.

◆ f_oldest

struct flash_sector* fcb::f_oldest

Pointer to flash sector containing the oldest data, internal state.

◆ f_scratch_cnt

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.

◆ f_sector_cnt

uint8_t fcb::f_sector_cnt

Number of elements in sector array.

◆ f_sectors

struct flash_sector* fcb::f_sectors

Array of sectors, must be contiguous.

◆ f_version

uint8_t fcb::f_version

Current version number of the data.

◆ fap

const struct flash_area* fcb::fap

Flash area used by the fcb instance, internal state.

This can be transfer to FCB user


The documentation for this struct was generated from the following file: