7#include "libxr_def.hpp"
8#include "libxr_type.hpp"
9#include DEF2STR(LIBXR_CH32_CONFIG_FILE)
25 :
CH32Flash(sectors, sector_count, sector_count - 1)
29 ErrorCode
Erase(
size_t offset,
size_t size)
override;
32 static constexpr size_t MinWriteSize() {
return 2; }
34 static constexpr uint32_t PageSize() {
return 256; }
38 uint32_t base_address_;
41 bool IsInRange(uint32_t addr,
size_t size)
const;
42 static inline void ClearFlashFlagsOnce();
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. 向闪存写入数据。
常量原始数据封装类。 A class for encapsulating constant raw data.
Abstract base class representing a flash memory interface. 抽象基类,表示闪存接口。
STM32Flash 通用类,构造时传入扇区列表,自动判断编程粒度。