bootapp.h 953 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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 boot_src_addr (*((uint32_t*)(RAMSIZE - 16)))
  8. #define boot_dst_addr (*((uint32_t*)(RAMSIZE - 12)))
  9. #define boot_copy_size (*((uint16_t*)(RAMSIZE - 8)))
  10. #define boot_reserved (*((uint8_t*)(RAMSIZE - 6)))
  11. #define boot_app_flags (*((uint8_t*)(RAMSIZE - 5)))
  12. #define boot_app_magic (*((uint32_t*)(RAMSIZE - 4)))
  13. #define BOOT_APP_FLG_ERASE 0x01
  14. #define BOOT_APP_FLG_COPY 0x02
  15. #define BOOT_APP_FLG_FLASH 0x04
  16. #define BOOT_APP_FLG_RUN 0x08
  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_print_vars(void);
  23. extern void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size);
  24. extern void bootapp_reboot_user0(uint8_t reserved);
  25. #if defined(__cplusplus)
  26. }
  27. #endif //defined(__cplusplus)
  28. #endif //BOOTAPP_H