Zephyr API Documentation  2.7.0-rc2
A Scalable Open Source RTOS
fcb.h File Reference
#include <inttypes.h>
#include <limits.h>
#include <storage/flash_map.h>
#include <kernel.h>

Go to the source code of this file.

Data Structures

struct  fcb_entry
 FCB entry info structure. This data structure describes the element location in the flash. More...
 
struct  fcb_entry_ctx
 Structure for transferring complete information about FCB entry location within flash memory. More...
 
struct  fcb
 FCB instance structure. More...
 

Macros

#define FCB_MAX_LEN   (CHAR_MAX | CHAR_MAX << 7)
 
#define FCB_ENTRY_FA_DATA_OFF(entry)
 Helper macro for calculating the data offset related to the fcb flash_area start offset. More...
 

Typedefs

typedef int(* fcb_walk_cb) (struct fcb_entry_ctx *loc_ctx, void *arg)
 

Functions

int fcb_init (int f_area_id, struct fcb *fcb)
 
int fcb_append (struct fcb *fcb, uint16_t len, struct fcb_entry *loc)
 
int fcb_append_finish (struct fcb *fcb, struct fcb_entry *append_loc)
 
int fcb_walk (struct fcb *fcb, struct flash_sector *sector, fcb_walk_cb cb, void *cb_arg)
 
int fcb_getnext (struct fcb *fcb, struct fcb_entry *loc)
 
int fcb_rotate (struct fcb *fcb)
 
int fcb_append_to_scratch (struct fcb *fcb)
 
int fcb_free_sector_cnt (struct fcb *fcb)
 
int fcb_is_empty (struct fcb *fcb)
 
int fcb_offset_last_n (struct fcb *fcb, uint8_t entries, struct fcb_entry *last_n_entry)
 
int fcb_clear (struct fcb *fcb)
 
int fcb_flash_read (const struct fcb *fcb, const struct flash_sector *sector, off_t off, void *dst, size_t len)
 
int fcb_flash_write (const struct fcb *fcb, const struct flash_sector *sector, off_t off, const void *src, size_t len)