26#define TAG "xf_fal_example" 
   38    uint8_t read_buf[16] = {0};
 
   39    uint8_t write_buf[16] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16};
 
   51    if (xf_ret != 
XF_OK) {
 
   68    if (xf_ret != 
XF_OK) {
 
   69        XF_LOGI(
TAG, 
"Partition erase failed: %d", xf_ret);
 
   75    if (xf_ret == 
XF_OK) {
 
   76        XF_LOGI(
TAG, 
"The partition was successfully. Data: ");
 
   77        for (
size_t i = 0; i < 
sizeof(read_buf); i++) {
 
   82        XF_LOGI(
TAG, 
"Partition read after erase failed: %d", xf_ret);
 
   87    if (xf_ret != 
XF_OK) {
 
   88        XF_LOGI(
TAG, 
"Partition write failed: %d", xf_ret);
 
   94    if (xf_ret == 
XF_OK) {
 
   95        XF_LOGI(
TAG, 
"Partition read successful! Data: ");
 
   96        for (
size_t i = 0; i < 
sizeof(read_buf); i++) {
 
  101        XF_LOGI(
TAG, 
"Partition read failed: %d", xf_ret);
 
  109    if (NULL == flash_dev) {
 
  115    if (xf_ret != 
XF_OK) {
 
  116        XF_LOGI(
TAG, 
"Partition erase failed: %d", xf_ret);
 
  122    if (xf_ret == 
XF_OK) {
 
  124        for (
size_t i = 0; i < 
sizeof(read_buf); i++) {
 
  129        XF_LOGI(
TAG, 
"Partition read after erase failed: %d", xf_ret);
 
xf_err_t xf_fal_partition_read(const xf_fal_partition_t *part, size_t src_offset, void *dst, size_t size)
从指定分区读取数据。
 
xf_err_t xf_fal_partition_erase(const xf_fal_partition_t *part, size_t offset, size_t size)
擦除指定分区数据。
 
xf_err_t xf_fal_init(void)
初始化 FAL.
 
xf_err_t xf_fal_partition_write(const xf_fal_partition_t *part, size_t dst_offset, const void *src, size_t size)
将数据写入指定分区。
 
void xf_fal_show_part_table(void)
打印分区表信息。
 
const xf_fal_partition_t * xf_fal_partition_find(const char *name)
根据分区名称查找分区句柄。
 
const xf_fal_flash_dev_t * xf_fal_flash_device_find_by_part(const xf_fal_partition_t *part)
通过给定分区查找 flash 设备。
 
int32_t xf_err_t
整形错误类型。 错误码具体值见 xf_err_code_t.
 
size_t sector_size
扇区大小。扇区大小是最小擦除大小。单位: byte.
 
size_t len
flash 设备上的该分区长度。
 
#define XF_FAL_DEFAULT_PARTITION_NAME
 
#define XF_LOGI(tag, format,...)
 
#define xf_log_printf(format,...)