bootapp.h 832 B

123456789101112131415161718192021222324252627282930313233343536
  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. #if defined(__cplusplus)
  19. extern "C" {
  20. #endif //defined(__cplusplus)
  21. extern void bootapp_ram2flash(uint16_t rptr, uint16_t fptr, uint16_t size);
  22. #if defined(__cplusplus)
  23. }
  24. #endif //defined(__cplusplus)
  25. #endif //BOOTAPP_H