|
libxr
1.0
Want to be the best embedded framework
|
Linux 二进制文件闪存实现 / Linux binary-file flash implementation. More...
#include <linux_flash.hpp>
Public Member Functions | |
| LinuxBinaryFileFlash (const std::string &file_path, size_t min_erase_size=FLASH_SIZE/2, size_t min_write_size=sizeof(uint8_t), bool write_order_check=false, bool write_as_one_check=false) | |
| 构造 Linux 文件闪存对象 / Construct Linux file-backed flash | |
| ErrorCode | Erase (size_t offset, size_t size) override |
| 擦除闪存区域 / Erase flash area | |
| ErrorCode | Write (size_t offset, ConstRawData data) override |
| 写入闪存数据 / Write flash data | |
Public Member Functions inherited from LibXR::Flash | |
| Flash (size_t min_erase_size, size_t min_write_size, RawData flash_area) | |
| Constructs a Flash object with specified properties. 构造函数,初始化闪存属性。 | |
| virtual ErrorCode | Read (size_t offset, RawData data) |
| Reads data from the flash memory. 从闪存中读取数据。 | |
| size_t | MinEraseSize () const |
| Returns the minimum erasable block size in bytes. 获取最小可擦除块大小(字节)。 | |
| size_t | MinWriteSize () const |
| Returns the minimum writable block size in bytes. 获取最小可写块大小(字节)。 | |
| size_t | Size () const |
| Returns the size of the flash memory area. 获取闪存存储区域的大小。 | |
Private Member Functions | |
| ErrorCode | SyncToFile () |
Private Attributes | |
| std::string | file_path_ |
| std::array< uint8_t, FLASH_SIZE > | flash_area_ = {} |
| bool | write_order_check_ |
| bool | write_as_one_check_ |
Linux 二进制文件闪存实现 / Linux binary-file flash implementation.
| FLASH_SIZE | 闪存容量(字节) / Flash size in bytes |
Definition at line 22 of file linux_flash.hpp.
|
inline |
构造 Linux 文件闪存对象 / Construct Linux file-backed flash
| file_path | 二进制文件路径 / Binary file path |
| min_erase_size | 最小擦除块大小 / Minimum erase block size |
| min_write_size | 最小写入块大小 / Minimum write block size |
| write_order_check | 写入顺序检查开关 / Enable write order check |
| write_as_one_check | 写入一致性检查开关 / Enable write consistency check |
Definition at line 34 of file linux_flash.hpp.
|
inlineoverridevirtual |
擦除闪存区域 / Erase flash area
| offset | 相对闪存起始地址的偏移 / Offset from flash base |
| size | 擦除长度 / Erase size |
Implements LibXR::Flash.
Definition at line 58 of file linux_flash.hpp.
|
inlineprivate |
Definition at line 123 of file linux_flash.hpp.
|
inlineoverridevirtual |
写入闪存数据 / Write flash data
| offset | 相对闪存起始地址的偏移 / Offset from flash base |
| data | 写入数据 / Data to write |
Implements LibXR::Flash.
Definition at line 80 of file linux_flash.hpp.
|
private |
Definition at line 118 of file linux_flash.hpp.
|
private |
Definition at line 119 of file linux_flash.hpp.
|
private |
Definition at line 121 of file linux_flash.hpp.
|
private |
Definition at line 120 of file linux_flash.hpp.