|
libxr
1.0
Want to be the best embedded framework
|
Abstract base class representing a flash memory interface. 抽象基类,表示闪存接口。 More...
#include <flash.hpp>
Public Member Functions | |
| Flash (size_t min_erase_size, size_t min_write_size, RawData flash_area) | |
| Constructs a Flash object with specified properties. 构造函数,初始化闪存属性。 | |
| virtual ErrorCode | Erase (size_t offset, size_t size)=0 |
| Erases a section of the flash memory. 擦除闪存的指定区域。 | |
| virtual ErrorCode | Write (size_t offset, ConstRawData data)=0 |
| Writes data to the flash memory. 向闪存写入数据。 | |
| 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 Attributes | |
| size_t | min_erase_size_ |
| Minimum erasable block size in bytes. 最小可擦除块大小(字节)。 | |
| size_t | min_write_size_ |
| Minimum writable block size in bytes. 最小可写块大小(字节)。 | |
| RawData | flash_area_ |
Abstract base class representing a flash memory interface. 抽象基类,表示闪存接口。
| Flash::Flash | ( | size_t | min_erase_size, |
| size_t | min_write_size, | ||
| RawData | flash_area ) |
Constructs a Flash object with specified properties. 构造函数,初始化闪存属性。
| min_erase_size | Minimum erasable block size in bytes. 最小可擦除块大小(字节)。 |
| min_write_size | Minimum writable block size in bytes. 最小可写块大小(字节)。 |
| flash_area | Memory area allocated for flash operations. 用于闪存操作的存储区域。 |
Definition at line 7 of file flash.cpp.
|
pure virtual |
Erases a section of the flash memory. 擦除闪存的指定区域。
| offset | The starting offset of the section to erase. 要擦除的起始偏移地址。 |
| size | The size of the section to erase. 要擦除的区域大小。 |
Implemented in LibXR::CH32Flash, LibXR::LinuxBinaryFileFlash< FLASH_SIZE >, and LibXR::STM32Flash.
|
inline |
|
inline |
Reads data from the flash memory. 从闪存中读取数据。
| offset | The starting offset to read data. 数据读取的起始偏移地址。 |
| data | Data buffer to store the read data. 存储读取数据的缓冲区。 |
Definition at line 14 of file flash.cpp.
|
inline |
|
pure virtual |
Writes data to the flash memory. 向闪存写入数据。
| offset | The starting offset to write data. 数据写入的起始偏移地址。 |
| data | The data to be written. 需要写入的数据。 |
Implemented in LibXR::CH32Flash, LibXR::LinuxBinaryFileFlash< FLASH_SIZE >, and LibXR::STM32Flash.
|
private |
|
private |
|
private |