NessLab(7731).h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /*
  2. * NessLab.h
  3. *
  4. * Created on: Aug 3, 2020
  5. * Author: parkyj
  6. */
  7. #ifndef NESSLAB_H_
  8. #define NESSLAB_H_
  9. #include "main.h"
  10. typedef struct{
  11. uint8_t Header0;
  12. uint8_t Header1;
  13. uint8_t MsgId;
  14. uint8_t MsgSn0;
  15. uint8_t MsgSn1;
  16. uint8_t MsgReserve0;
  17. uint8_t MsgDataLength;
  18. uint8_t DownLink_Forward_Det_H;
  19. uint8_t DownLink_Forward_Det_L;
  20. uint8_t DownLink_Reverse_Det_H;
  21. uint8_t DownLink_Reverse_Det_L;
  22. uint8_t DC_Level_Det_H;
  23. uint8_t DC_Level_Det_L;
  24. uint8_t Gate_Enable;
  25. uint8_t Reset;
  26. uint8_t DC_Fail_Alarm;
  27. uint8_t Downlink_Status;
  28. uint8_t Over_Power_Alarm;
  29. uint8_t VSWR_Alarm;
  30. uint8_t Over_Input_Alarm;
  31. uint8_t Over_Temp_Alarm;
  32. uint8_t Temp_Monitor;
  33. uint8_t ALC_Alarm;
  34. uint8_t Checksum;
  35. uint8_t Tail0;
  36. uint8_t Tail1;
  37. }Nesslab_Prot;
  38. typedef enum{
  39. NessLab_STATUS_REQ,
  40. NessLab_STATUS_RES,
  41. }NessLabDataType_t;
  42. typedef enum{
  43. NessLab_DownLink_Tx,
  44. NessLab_DownLink_Rx,
  45. NessLab_Temperature,
  46. }Adc_Index_t;
  47. typedef enum{
  48. NessLab_Header0,
  49. NessLab_Header1,
  50. NessLab_MsgID0,
  51. NessLab_MsgSN0,
  52. NessLab_MsgSN1,
  53. NessLab_Reserve0,
  54. NessLab_DataLength,
  55. NessLab_Data_ADC0_H,
  56. NessLab_Data_ADC0_L,
  57. NessLab_Data_ADC1_H,
  58. NessLab_Data_ADC1_L,
  59. DC_FAIL_ALARM,
  60. NessLab_DownLink_Status,
  61. NessLab_Over_Power_Alarm,
  62. NessLab_VSWR_ALARM,
  63. NessLab_Over_Input_Alarm,
  64. NessLab_Over_Temp_Alarm,
  65. NessLab_Temp_Monitor,
  66. NessLab_ALC_ALARM,
  67. NessLab_Checksum,
  68. }NessLabProtIndex_t;
  69. extern void NessLab_Operate(uint8_t* data);
  70. #endif /* NESSLAB_H_ */