xt-sdk 文档 v1.0.3
xt-sdk 嵌入式 SDK API 参考
载入中...
搜索中...
未找到
xt_fal.h 文件参考

FAL (Flash Abstraction Layer) 接口 更多...

#include "xt_error.h"

浏览该文件的源代码.

结构体

struct  xt_fal_flash_ops
struct  xt_fal_flash
struct  xt_fal_partition

宏定义

#define XT_FAL_INVALID_ID   (0xFF)
#define XT_FAL_GET_FLASH_ID(fal_id)
#define XT_FAL_GET_PARTITION_IDX(fal_id)
#define XT_FAL_MAKE_ID(flash_id, part_idx)
#define XT_FAL_CTRL_INIT   (0x00000001)
#define XT_FAL_CTRL_DEINIT   (0x00000002)
#define XT_FAL_MAX_FLASH_COUNT   16
#define XT_FAL_NAME_MAX   16

类型定义

typedef uint32_t xt_fal_size_t

函数

uint8_t xt_fal_register (const struct xt_fal_flash *flash, const struct xt_fal_partition *part_table, uint32_t part_count)
 注册 Flash 设备和分区表
xt_err_t xt_fal_unregister (uint8_t flash_id, const struct xt_fal_flash **out_flash, const struct xt_fal_partition **out_part_table, uint32_t *out_part_count)
 反注册 Flash 设备
xt_err_t xt_fal_init (void)
 初始化所有已注册的 Flash 设备
xt_err_t xt_fal_deinit (void)
 反初始化所有 Flash 设备
uint8_t xt_fal_get_flash_id_by_name (const char *flash_name)
 通过名称获取 flash_id
uint8_t xt_fal_get_id_by_name (const char *part_name)
 通过分区名称获取 fal_id
const struct xt_fal_partition * xt_fal_get_partition_by_id (uint8_t fal_id)
 通过 fal_id 获取分区指针
const struct xt_fal_flash * xt_fal_get_flash_by_id (uint8_t fal_id)
 通过 fal_id 获取 Flash 设备指针
int32_t xt_fal_partition_read (uint8_t fal_id, xt_fal_size_t offset, void *dst, xt_fal_size_t size)
 读取分区数据
int32_t xt_fal_partition_write (uint8_t fal_id, xt_fal_size_t offset, const void *src, xt_fal_size_t size)
 写入分区数据
int32_t xt_fal_partition_erase (uint8_t fal_id, xt_fal_size_t offset, xt_fal_size_t size)
 擦除分区

详细描述

FAL (Flash Abstraction Layer) 接口

作者
your name (you@d.nosp@m.omai.nosp@m.n.com)
版本
0.3
日期
2026-02-27

SPDX-FileCopyrightText: 2025 深圳市天工聚创科技有限公司 SPDX-License-Identifier: Apache-2.0

在文件 xt_fal.h 中定义.