MBIC_Bootloader.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. /*
  2. * MBIC_Bootloader.h
  3. *
  4. * Created on: 2020. 5. 18.
  5. * Author: parkyj
  6. */
  7. #ifndef MBIC_BOOTLOADER_H_
  8. #define MBIC_BOOTLOADER_H_
  9. typedef enum{
  10. MBIC_Notice_REQ = 0x10,
  11. MBIC_Download_DATA_REQ,
  12. MBIC_Download_Confirm_REQ,
  13. MBIC_Complete_Notice_REQ_REQ,
  14. MBIC_Reboot_Notice_REQ,
  15. }MBIC_Download_Req_L;
  16. typedef enum{
  17. MBIC_Notice_RSP = 0x90,
  18. MBIC_Download_DATA_RSP,
  19. MBIC_Download_Confirm_RSP,
  20. MBIC_Complete_Notice_RSP,
  21. MBIC_Reboot_Notice_RSP,
  22. }MBIC_Download_Rsp_L;
  23. #define MBIC_HEADER_SIZE 22
  24. #define MBIC_PREAMBLE0 0x16
  25. #define MBIC_PREAMBLE1 0x16
  26. #define MBIC_PREAMBLE2 0x16
  27. #define MBIC_PREAMBLE3 0x16
  28. #define MBIC_SUBUID0 0x00
  29. #define MBIC_SUBUID1 0xF1
  30. #define MBIC_RCODE
  31. #define MBIC_TRID
  32. #define MBIC_SEQNUM
  33. #define MBIC_TTL
  34. #define MBIC_TIME
  35. #define MBIC_ERRRESPONSE 0x00
  36. #define MBIC_CMD
  37. #define MBIC_LENGTH
  38. #define MBIC_CHECKSHUM_INDEX MBIC_HEADER_SIZE - 1 //CheckSUM REMOVE INDEX
  39. #define MBIC_ETX 0x03
  40. #define MBIC_NODE_MU 0x80
  41. typedef enum{
  42. MBIC_PREAMBLE_0 = 0,
  43. MBIC_PREAMBLE_1,
  44. MBIC_PREAMBLE_2,
  45. MBIC_PREAMBLE_3,
  46. MBIC_SUBUID_0,
  47. MBIC_SUBUID_1,
  48. MBIC_RCODE_0,
  49. MBIC_TRID_0,
  50. MBIC_TRID_1,
  51. MBIC_SEQSUM_0, // 9Index
  52. MBIC_TTL_0, //10 INDEX
  53. MBIC_TIME_0,
  54. MBIC_TIME_1,
  55. MBIC_TIME_2,
  56. MBIC_TIME_3,
  57. MBIC_TIME_4,
  58. MBIC_TIME_5,
  59. MBIC_ERRRESPONSE_0,
  60. MBIC_CMD_0,
  61. MBIC_LENGTH_0, // 19INDEX
  62. MBIC_LENGTH_1, // 20
  63. MBIC_HEADERCHECKSUM_0,
  64. MBIC_PAYLOADSTART,
  65. /*
  66. * PayLoadSTART
  67. */
  68. }MBICProt_st;
  69. #endif /* MBIC_BOOTLOADER_H_ */