fmc.h 691 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef FMC_H
  2. #define FMC_H
  3. #include "stdint.h"
  4. void GD32_EraseFlash(uint16_t start, uint16_t num); //函数声明
  5. void GD32_WriteFlash(uint32_t saddr, uint32_t *wdata, uint32_t wnum); //函数声明
  6. #include "gd32f10x.h"
  7. /// 移植修改区 ///
  8. /* FLASH大小:3MB */
  9. #define GD32FLASH_SIZE 0X00300000UL
  10. /* FLASH起始地址 */
  11. #define GD32FLASH_BASE FLASH_BASE
  12. /* FLASH结束地址 */
  13. #define GD32FLASH_END (GD32FLASH_BASE | GD32FLASH_SIZE)
  14. /* FALSH页大小 */
  15. #define GD32FLASH_PAGE_SIZE 1024
  16. /* FLASH总页数 */
  17. #define GD32FLASH_PAGE_NUM (GD32FLASH_SIZE / GD32FLASH_PAGE_SIZE)
  18. /// 导出函数声明
  19. uint32_t FLASH_Read(uint32_t Address, void *Buffer, uint32_t Size);
  20. #endif