Bootloader.h 968 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * Bootloader.h
  3. *
  4. * Created on: Jul 10, 2019
  5. * Author: parkyj
  6. */
  7. #ifndef BOOTLOADER_H_
  8. #define BOOTLOADER_H_
  9. #include "main.h"
  10. #include "uart.h"
  11. extern uint8_t * UpdateFiledata;
  12. typedef enum {
  13. BLUECELL_RESET = 0,
  14. BLUECELL_START,
  15. BLUECELL_SENDING,
  16. BLUECELL_END,
  17. }updateseq;
  18. typedef enum updateseqok
  19. {
  20. UpdateResetOK = 0,
  21. UpdateStartOK,
  22. UpdateSendingOK,
  23. UpdateEndOK,
  24. };
  25. typedef enum{
  26. bluecell_stx = 0,
  27. bluecell_type = 1,
  28. bluecell_length,
  29. bluecell_CrcIndex,
  30. bluecell_crc,
  31. bluecell_ext,
  32. }FirmwareUpdate_t;
  33. /*bluecell type*/
  34. #define Bluecell_Reset 0x0A//ASCII : R
  35. #define Bluecell_Firmupdate_start 0x55//ASCII : U
  36. #define Bluecell_Firmupdate_sending 0x53//ASCII : S
  37. #define Bluecell_Firmupdate_end 0x65//ASCII : e
  38. #define Bluecell_Endbyte 0xED
  39. #define bluecell_Firmupdate_Ackbytelength 12
  40. extern void FirmwareUpdate_Boot(void);
  41. extern void Firmware_BootStart_Signal();
  42. #endif /* BOOTLOADER_H_ */