FAL API
Find Flash device
| Parameters |
Description |
| name |
Flash device name |
| return |
If the search is successful, the Flash device object will be returned, and if the search fails, it will return NULL |
Find Flash Partition
| Parameters |
Description |
| name |
Flash partition name |
| return |
If the search is successful, the Flash partition object will be returned, and if the search fails, it will return NULL |
Get the partition table
| Parameters |
Description |
| len |
The length of the partition table |
| return |
Partition table |
Temporarily set the partition table
The default partition table will be automatically loaded when FAL is initialized. Using this setting will temporarily modify the partition table and will lost this setting after restarting
| Parameters |
Description |
| table |
Partition table |
| len |
Length of the partition table |
Read data from partition
| Parameters |
Description |
| part |
Partition object |
| addr |
Relative partition offset address |
| buf |
Buffer to store the data to be read |
| size |
The size of the data to be read |
| return |
Return the actual read data size |
Write data to partition
| Parameters |
Description |
| part |
Partition object |
| addr |
Relative partition offset address |
| buf |
Buffer to store data to be written |
| size |
The size of the data to be written |
| return |
Return the actual written data size |
Erase partition data
| Parameters |
Description |
| part |
Partition object |
| addr |
Relative partition offset address |
| size |
The size of the erased area |
| return |
Return the actual erased area size |
Erase the entire partition data
| Parameters |
Description |
| part |
Partition object |
| return |
Return the actual erased area size |
Print partition table
Create block device
This function can create the corresponding block device according to the specified partition name, so as to mount the file system on the specified partition
| Parameters |
Description |
| parition_name |
partition name |
| return |
If the creation is successful, the corresponding block device will be returned, and if it fails, empty |
Create MTD Nor Flash device
This function can create the corresponding MTD Nor Flash device according to the specified partition name, so as to mount the file system on the specified partition
| Parameters | Description |
| :------------ | :---------------------------------- ------------------ |
| parition_name | Partition name |
| return | If the creation is successful, the corresponding MTD Nor Flash device will be returned, otherwise empty |
Create a character device
This function can create the corresponding character device according to the specified partition name to facilitate the operation of the partition through the deivice interface or the devfs interface. After POSIX is turned on, the partition can also be operated through the open/read/write function.
| Parameters | Description |
| :------------ | :---------------------------------- ------- |
| parition_name | partition name |
| return | If the creation is successful, the corresponding character device will be returned, otherwise empty |