| 123456789101112131415161718192021222324 |
- #ifndef INTERNAL_FLASH_H
- #define INTERNAL_FLASH_H
- #include <stdint.h>
- /* 擦 APP 区前 ceil(len/128KB) 个扇区(Sector2 起, 跨 bank 自动分段)。0=OK */
- uint8_t int_flash_erase_app(uint32_t len);
- /* 32B flashword 编程(内部已对齐补齐+未擦检查)。返回码: 0=OK 1=地址错 2=编程错 3=未擦除 */
- uint8_t int_flash_program(uint32_t dst, const uint8_t *src, uint32_t len);
- /* 内部 Flash [addr,len) 流式 CRC32(zlib) */
- uint32_t int_flash_crc32(uint32_t addr, uint32_t len);
- /* 安全读取(带 cache 刷新) */
- void int_flash_read(uint32_t addr, uint8_t *out, uint32_t len);
- /* NOR -> 内部 Flash 整段烧录 */
- uint8_t int_flash_program_from_nor(uint32_t dst, uint32_t src_nor, uint32_t len);
- /* 内部 Flash -> NOR 整段备份 */
- uint8_t int_flash_backup_to_nor(uint32_t src, uint32_t dst_nor, uint32_t len);
- #endif /* INTERNAL_FLASH_H */
|