gd_ota_flash.h 509 B

1234567891011121314151617181920
  1. #ifndef GD_OTA_FLASH_H
  2. #define GD_OTA_FLASH_H
  3. #include <stdint.h>
  4. //µÚ124Ò³
  5. #define FMC_READ(addrx) (*(volatile uint32_t *)(uint32_t)(addrx))
  6. #define FMC_WRITE_START_ADDR ((uint32_t)0x08005000U+0xFA000) //ÆðʼµØÖ·
  7. #define FMC_Page 1020
  8. typedef struct _BOOT_MESSAGE
  9. {
  10. uint8_t VERSION_H;
  11. uint8_t VERSION_M;
  12. uint8_t VERSION_L;
  13. uint8_t UP_FLAG;
  14. }BOOT_MESSAGE;
  15. void soft_init();
  16. void write_soft_version();
  17. void GD32_READ_OTA(BOOT_MESSAGE *READ);
  18. void write_soft_version(BOOT_MESSAGE *save_message);
  19. #endif