bootapp.h 919 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. //language.h
  2. #ifndef BOOTAPP_H
  3. #define BOOTAPP_H
  4. #include "config.h"
  5. #include <inttypes.h>
  6. #define RAMSIZE 0x2000
  7. #define ram_array ((uint8_t*)(0))
  8. #define boot_src_addr (*((uint32_t*)(RAMSIZE - 16)))
  9. #define boot_dst_addr (*((uint32_t*)(RAMSIZE - 12)))
  10. #define boot_copy_size (*((uint16_t*)(RAMSIZE - 8)))
  11. #define boot_reserved (*((uint8_t*)(RAMSIZE - 6)))
  12. #define boot_app_flags (*((uint8_t*)(RAMSIZE - 5)))
  13. #define boot_app_magic (*((uint32_t*)(RAMSIZE - 4)))
  14. #define BOOT_APP_FLG_ERASE 0x01
  15. #define BOOT_APP_FLG_COPY 0x02
  16. #define BOOT_APP_FLG_FLASH 0x04
  17. #define BOOT_APP_FLG_USER0 0x80
  18. #define BOOT_APP_MAGIC 0x55aa55aa
  19. #if defined(__cplusplus)
  20. extern "C" {
  21. #endif //defined(__cplusplus)
  22. extern void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size);
  23. extern void bootapp_reboot_user0(uint8_t reserved);
  24. #if defined(__cplusplus)
  25. }
  26. #endif //defined(__cplusplus)
  27. #endif //BOOTAPP_H