XFusion API v1.3.0
载入中...
搜索中...
未找到
xf_fal_types.h
浏览该文件的文档.
1
12#ifndef __XF_FAL_TYPES_H__
13#define __XF_FAL_TYPES_H__
14
15/* ==================== [Includes] ========================================== */
16
18#include "xf_utils.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
24/* ==================== [Defines] =========================================== */
25
26#define XF_FAL_SW_VERSION "1.1.0"
27
28/* ==================== [Typedefs] ========================================== */
29
45typedef struct _xf_fal_flash_ops_t {
49 xf_err_t (*init)(void);
53 xf_err_t (*deinit)(void);
73 xf_err_t (*read)(size_t src_offset, void *dst, size_t size);
93 xf_err_t (*write)(size_t dst_offset, const void *src, size_t size);
105 xf_err_t (*erase)(size_t offset, size_t size);
107
147
175
201
263
269/* ==================== [Global Prototypes] ================================= */
270
271/* ==================== [Macros] ============================================ */
272
273#ifdef __cplusplus
274} /* extern "C" */
275#endif
276
277#endif // __XF_FAL_TYPES_H__
struct _xf_fal_partition_t xf_fal_partition_t
flash 分区结构体。
struct _xf_fal_flash_dev_t xf_fal_flash_dev_t
flash 设备结构体。
int32_t xf_err_t
整形错误类型。 错误码具体值见 xf_err_code_t.
Definition xf_err.h:69
void * xf_lock_t
lock 句柄.
static xf_osal_mutex_t mutex
Definition xf_main.c:35
xf_fal 分区缓存。
const xf_fal_flash_dev_t * flash_dev
分区对应的 flash 设备对象。
const xf_fal_partition_t * partition
指向分区信息。
xf_fal 对象上下文结构体。
xf_fal_cache_t cache[XF_FAL_CACHE_NUM]
缓存"分区和 flash 设备关系"的缓存表(数组)指针。
const xf_fal_flash_dev_t * flash_device_table[XF_FAL_FLASH_DEVICE_NUM]
flash 设备表(数组)指针。
volatile uint8_t is_init
用于判断 xf_fal 是否已初始化。
const xf_fal_partition_t * partition_table[XF_FAL_PARTITION_TABLE_NUM]
分区表(数组)的数组。
size_t partition_table_len[XF_FAL_PARTITION_TABLE_NUM]
分区表(数组)表长(分区表内所有分区的总个数)数组。
volatile size_t cached_num
已缓存的个数。
flash 设备结构体。
size_t io_size
最小读写单元大小,读写时需要以此大小为单位读写,单位: byte.
xf_fal_flash_ops_t ops
flash 操作集,见 xf_fal_flash_ops_t .
size_t sector_size
扇区大小。扇区大小是最小擦除大小。单位: byte.
size_t page_size
页大小。页大小是单次写入时无需等待的最大大小。单位: byte. 通常为 256 字节。
flash 操作集。
xf_err_t(* write)(size_t dst_offset, const void *src, size_t size)
写数据到 flash 的指定偏移地址。
xf_err_t(* read)(size_t src_offset, void *dst, size_t size)
从 flash 的指定偏移地址读取数据。
xf_err_t(* deinit)(void)
反初始化 flash 设备。
xf_err_t(* init)(void)
初始化 flash 设备。
xf_err_t(* erase)(size_t offset, size_t size)
擦除 flash 的指定偏移地址指定长度。
flash 分区结构体。
size_t len
flash 设备上的该分区长度。
size_t offset
flash 设备上的该分区偏移地址。
xf_fal 内部配置。
#define XF_FAL_CACHE_NUM
#define XF_FAL_FLASH_DEVICE_NUM
#define XF_FAL_PARTITION_TABLE_NUM
struct _xf_fal_ctx_t xf_fal_ctx_t
xf_fal 对象上下文结构体。
struct _xf_fal_flash_ops_t xf_fal_flash_ops_t
flash 操作集。
struct _xf_fal_cache_t xf_fal_cache_t
xf_fal 分区缓存。