libxr 1.0
Want to be the best embedded framework
|
STM32Flash 通用类,构造时传入扇区列表,自动判断编程粒度。 More...
#include <stm32_flash.hpp>
Public Member Functions | |
STM32Flash (const FlashSector(§ors)[SECTOR_COUNT]) | |
STM32Flash 类,构造时传入扇区列表,自动判断编程粒度。 | |
ErrorCode | Erase (size_t offset, size_t size) override |
Erases a section of the flash memory. 擦除闪存的指定区域。 | |
ErrorCode | Write (size_t offset, ConstRawData data) override |
Writes data to the flash memory. 向闪存写入数据。 | |
![]() | |
Flash (size_t min_erase_size, size_t min_write_size, RawData flash_area) | |
Constructs a Flash object with specified properties. 构造函数,初始化闪存属性。 | |
Private Member Functions | |
bool | IsInRange (uint32_t addr, size_t size) const |
Static Private Member Functions | |
static constexpr uint32_t | DetermineProgramType () |
static constexpr size_t | DetermineMinWriteSize () |
Private Attributes | |
const FlashSector * | sectors_ |
uint32_t | base_address_ |
uint32_t | program_type_ |
Additional Inherited Members | |
![]() | |
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_ |
STM32Flash 通用类,构造时传入扇区列表,自动判断编程粒度。
SECTOR_COUNT | 扇区数量 |
START_SECTOR | 起始扇区索引(用于擦除编号) |
Definition at line 83 of file stm32_flash.hpp.
|
inline |
STM32Flash 类,构造时传入扇区列表,自动判断编程粒度。
sectors | 扇区列表 |
Definition at line 91 of file stm32_flash.hpp.
|
inlinestaticconstexprprivate |
Definition at line 250 of file stm32_flash.hpp.
|
inlinestaticconstexprprivate |
Definition at line 233 of file stm32_flash.hpp.
|
inlineoverridevirtual |
Erases a section of the flash memory. 擦除闪存的指定区域。
offset | The starting offset of the section to erase. 要擦除的起始偏移地址。 |
size | The size of the section to erase. 要擦除的区域大小。 |
Implements LibXR::Flash.
Definition at line 102 of file stm32_flash.hpp.
|
inlineprivate |
Definition at line 267 of file stm32_flash.hpp.
|
inlineoverridevirtual |
Writes data to the flash memory. 向闪存写入数据。
offset | The starting offset to write data. 数据写入的起始偏移地址。 |
data | The data to be written. 需要写入的数据。 |
Implements LibXR::Flash.
Definition at line 154 of file stm32_flash.hpp.
|
private |
Definition at line 230 of file stm32_flash.hpp.
|
private |
Definition at line 231 of file stm32_flash.hpp.
|
private |
Definition at line 229 of file stm32_flash.hpp.