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. 向闪存写入数据。 | |
Data Fields | |
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. 抽象基类,表示闪存接口。
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 27 of file flash.hpp.
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::LinuxBinaryFileFlash< FLASH_SIZE >, and LibXR::STM32Flash< SECTOR_COUNT, START_SECTOR >.
|
pure virtual |
Writes data to the flash memory. 向闪存写入数据。
offset | The starting offset to write data. 数据写入的起始偏移地址。 |
data | The data to be written. 需要写入的数据。 |
Implemented in LibXR::LinuxBinaryFileFlash< FLASH_SIZE >, and LibXR::STM32Flash< SECTOR_COUNT, START_SECTOR >.
RawData LibXR::Flash::flash_area_ |
size_t LibXR::Flash::min_erase_size_ |
size_t LibXR::Flash::min_write_size_ |