FAL API
²éÕÒ Flash É豸
const struct fal_flash_dev *fal_flash_device_find(const char *name)
| ²ÎÊý |
ÃèÊö |
| name |
Flash É豸Ãû³Æ |
| return |
Èç¹û²éÕҳɹ¦£¬½«·µ»Ø Flash É豸¶ÔÏ󣬲éÕÒʧ°Ü·µ»Ø NULL |
²éÕÒ Flash ·ÖÇø
const struct fal_partition *fal_partition_find(const char *name)
| ²ÎÊý |
ÃèÊö |
| name |
Flash ·ÖÇøÃû³Æ |
| return |
Èç¹û²éÕҳɹ¦£¬½«·µ»Ø Flash ·ÖÇø¶ÔÏ󣬲éÕÒʧ°Ü·µ»Ø NULL |
»ñÈ¡·ÖÇø±í
const struct fal_partition *fal_get_partition_table(size_t *len)
| ²ÎÊý |
ÃèÊö |
| len |
·ÖÇø±íµÄ³¤¶È |
| return |
·ÖÇø±í |
ÁÙʱÉèÖ÷ÖÇø±í
FAL ³õʼ»¯Ê±»á×Ô¶¯×°ÔØÄ¬ÈÏ·ÖÇø±í¡£Ê¹ÓøÃÉèÖý«ÁÙʱÐ޸ķÖÇø±í£¬ÖØÆôºó»á ¶ªÊ§ ¸ÃÉèÖÃ
void fal_set_partition_table_temp(struct fal_partition *table, size_t len)
| ²ÎÊý |
ÃèÊö |
| table |
·ÖÇø±í |
| len |
·ÖÇø±íµÄ³¤¶È |
´Ó·ÖÇø¶ÁÈ¡Êý¾Ý
int fal_partition_read(const struct fal_partition *part, uint32_t addr, uint8_t *buf, size_t size)
| ²ÎÊý |
ÃèÊö |
| part |
·ÖÇø¶ÔÏó |
| addr |
Ïà¶Ô·ÖÇøµÄÆ«ÒÆµØÖ· |
| buf |
´æ·Å´ý¶ÁÈ¡Êý¾ÝµÄ»º³åÇø |
| size |
´ý¶ÁÈ¡Êý¾ÝµÄ´óС |
| return |
·µ»ØÊµ¼Ê¶ÁÈ¡µÄÊý¾Ý´óС |
Íù·ÖÇøÐ´ÈëÊý¾Ý
int fal_partition_write(const struct fal_partition *part, uint32_t addr, const uint8_t *buf, size_t size)
| ²ÎÊý |
ÃèÊö |
| part |
·ÖÇø¶ÔÏó |
| addr |
Ïà¶Ô·ÖÇøµÄÆ«ÒÆµØÖ· |
| buf |
´æ·Å´ýдÈëÊý¾ÝµÄ»º³åÇø |
| size |
´ýдÈëÊý¾ÝµÄ´óС |
| return |
·µ»ØÊµ¼ÊдÈëµÄÊý¾Ý´óС |
²Á³ý·ÖÇøÊý¾Ý
int fal_partition_erase(const struct fal_partition *part, uint32_t addr, size_t size)
| ²ÎÊý |
ÃèÊö |
| part |
·ÖÇø¶ÔÏó |
| addr |
Ïà¶Ô·ÖÇøµÄÆ«ÒÆµØÖ· |
| size |
²Á³ýÇøÓòµÄ´óС |
| return |
·µ»ØÊµ¼Ê²Á³ýµÄÇøÓò´óС |
²Á³ýÕû¸ö·ÖÇøÊý¾Ý
int fal_partition_erase_all(const struct fal_partition *part)
| ²ÎÊý |
ÃèÊö |
| part |
·ÖÇø¶ÔÏó |
| return |
·µ»ØÊµ¼Ê²Á³ýµÄÇøÓò´óС |
´òÓ¡·ÖÇø±í
void fal_show_part_table(void)
´´½¨¿éÉ豸
¸Ãº¯Êý¿ÉÒÔ¸ù¾ÝÖ¸¶¨µÄ·ÖÇøÃû³Æ£¬´´½¨¶ÔÓ¦µÄ¿éÉ豸£¬ÒÔ±ãÓÚÔÚÖ¸¶¨µÄ·ÖÇøÉϹÒÔØÎļþϵͳ
struct rt_device *fal_blk_device_create(const char *parition_name)
| ²ÎÊý |
ÃèÊö |
| parition_name |
·ÖÇøÃû³Æ |
| return |
´´½¨³É¹¦£¬Ôò·µ»Ø¶ÔÓ¦µÄ¿éÉ豸£¬Ê§°Ü·µ»Ø¿Õ |
´´½¨ MTD Nor Flash É豸
¸Ãº¯Êý¿ÉÒÔ¸ù¾ÝÖ¸¶¨µÄ·ÖÇøÃû³Æ£¬´´½¨¶ÔÓ¦µÄ MTD Nor Flash É豸£¬ÒÔ±ãÓÚÔÚÖ¸¶¨µÄ·ÖÇøÉϹÒÔØÎļþϵͳ
struct rt_device *fal_mtd_nor_device_create(const char *parition_name)
| ²ÎÊý |
ÃèÊö |
| parition_name |
·ÖÇøÃû³Æ |
| return |
´´½¨³É¹¦£¬Ôò·µ»Ø¶ÔÓ¦µÄ MTD Nor Flash É豸£¬Ê§°Ü·µ»Ø¿Õ |
´´½¨×Ö·ûÉ豸
¸Ãº¯Êý¿ÉÒÔ¸ù¾ÝÖ¸¶¨µÄ·ÖÇøÃû³Æ£¬´´½¨¶ÔÓ¦µÄ×Ö·ûÉ豸£¬ÒÔ±ãÓÚͨ¹ý deivice ½Ó¿Ú»ò devfs ½Ó¿Ú²Ù×÷·ÖÇø£¬¿ªÆôÁË POSIX ºó£¬»¹¿ÉÒÔͨ¹ý open/read/write º¯Êý²Ù×÷·ÖÇø¡£
struct rt_device *fal_char_device_create(const char *parition_name)
| ²ÎÊý |
ÃèÊö |
| parition_name |
·ÖÇøÃû³Æ |
| return |
´´½¨³É¹¦£¬Ôò·µ»Ø¶ÔÓ¦µÄ×Ö·ûÉ豸£¬Ê§°Ü·µ»Ø¿Õ |