7#include "libxr_def.hpp"
8#include "libxr_type.hpp"
9#include DEF2STR(LIBXR_CH32_CONFIG_FILE)
34 :
CH32Flash(sectors, sector_count, sector_count - 1)
38 ErrorCode
Erase(
size_t offset,
size_t size)
override;
53 uint32_t base_address_;
56 bool IsInRange(uint32_t addr,
size_t size)
const;
57 static inline void ClearFlashFlagsOnce();
CH32 闪存驱动实现 / CH32 flash driver implementation.
static constexpr size_t MinWriteSize()
最小写入粒度(半字) / Minimum write size (half-word)
static constexpr uint32_t PageSize()
Page erase size in fast erase mode / 快速擦除页大小
CH32Flash(const FlashSector *sectors, size_t sector_count, size_t start_sector)
构造闪存对象 / Construct flash object
ErrorCode Erase(size_t offset, size_t size) override
Erases a section of the flash memory. 擦除闪存的指定区域。
CH32Flash(const FlashSector *sectors, size_t sector_count)
构造并使用默认起始扇区 / Construct with default start sector
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. 抽象基类,表示闪存接口。
闪存扇区描述 / Flash sector descriptor
uint32_t size
扇区大小(字节) / Sector size in bytes
uint32_t address
扇区起始地址 / Sector base address