s600_iap.h 686 B

123456789101112131415161718192021222324252627
  1. #pragma once
  2. #include "s600.h"
  3. #define APP_BOOT_OK 0x11223344
  4. #define PART_FACTORY 0x08001FF0
  5. #define PART_APP 0x08002000
  6. #define PART_NAME 0x08002800
  7. #define PART_VERSION 0x08002808
  8. #define S600_IAP_CRC32 1
  9. typedef struct {
  10. u32 length;
  11. u32 checksum;
  12. u32 success;
  13. } s600_iap_info_t;
  14. void s600_iap_write_begin(void);
  15. bool s600_iap_write_end(u32 length, u32 checksum);
  16. bool s600_iap_write_page(u32 addr, const void *buff, u16 length, bool erase);
  17. bool s600_iap_flush(u32 length);
  18. bool s600_iap_write(const u8 *buff, u16 length);
  19. bool s600_iap_write_u32(u32 value);
  20. bool s600_iap_boot(bool normal);
  21. u32 s600_iap_checksum(u32 addr, u32 length);