第一次提交

This commit is contained in:
2026-04-09 10:14:20 +08:00
commit e325a77b42
584 changed files with 279711 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
#ifndef BSP_FMC_FLASH_H
#define BSP_FMC_FLASH_H
#include <stdbool.h>
#include <stdint.h>
#define BSP_FLASH_PAGE_SIZE ((uint32_t)0x400U) // 1KB per page
#define BSP_FLASH_PROGRAM_UNIT ((uint32_t)4U) // 4 bytes per program unit (word)
#define BSP_FLASH_ERASE_VALUE ((uint8_t)0xFFU) // Value of erased flash bytes
typedef struct
{
uint32_t page_size;
uint32_t program_unit;
uint8_t erased_value;
} bsp_flash_info_t;
const bsp_flash_info_t *bsp_flash_get_info(void);
uint8_t bsp_flash_read(uint32_t addr, void *buffer, uint32_t size);
uint8_t bsp_flash_erased(uint32_t addr, uint32_t size);
uint8_t bsp_flash_write(uint32_t addr, const void *data, uint32_t size);
uint8_t bsp_flash_is_erased(uint32_t addr, uint32_t size);
#endif /* BSP_FMC_FLASH_H */