sys_data.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. #ifndef __SYS_DATA_H
  2. #define __SYS_DATA_H
  3. #include "usart.h"
  4. #include "stm32f2xx.h"
  5. #include "string.h"
  6. #include "delay.h"
  7. #define _USART3_RXSIZE 1040
  8. #define ON 1
  9. #define OFF 0
  10. typedef struct
  11. {
  12. uint32_t rxIndex;
  13. uint8_t rxBuf[_USART3_RXSIZE];
  14. uint32_t rxTime;
  15. uint8_t txBusy;
  16. uint32_t timeout;
  17. uint8_t done;
  18. }USART_MSG_t;
  19. extern USART_MSG_t usartMsg;
  20. extern uint8_t result;
  21. void call_back();
  22. // UPDATA
  23. uint8_t updata(void);
  24. uint8_t channel_LED(uint8_t channel, int i);
  25. uint8_t channel_12VBAT(uint8_t channel, int i);
  26. uint8_t channel_5VBAT(uint8_t channel);
  27. void broad_to_host(void);
  28. //////////////////////// LED ////////////////////////
  29. // 全部channel下的平台
  30. uint8_t channel_No0_LED(uint8_t platform, int i);// 全部channel
  31. uint8_t channel_No0_platform_No0_LED(uint8_t cmd);// 全部平台
  32. uint8_t channel_No0_platform_No1_LED(uint8_t cmd);
  33. uint8_t channel_No0_platform_No2_LED(uint8_t cmd);
  34. uint8_t channel_No0_platform_No3_LED(uint8_t cmd);
  35. uint8_t channel_No0_platform_No4_LED(uint8_t cmd);
  36. uint8_t channel_No0_platform_No5_LED(uint8_t cmd);
  37. uint8_t channel_No0_platform_No6_LED(uint8_t cmd);
  38. // channel 1 下的平台
  39. uint8_t channel_No1_LED(uint8_t platform, int i);
  40. uint8_t channel_No1_platform_No0_LED(uint8_t cmd);// 全部平台
  41. uint8_t channel_No1_platform_No1_LED(uint8_t cmd);
  42. uint8_t channel_No1_platform_No2_LED(uint8_t cmd);
  43. uint8_t channel_No1_platform_No3_LED(uint8_t cmd);
  44. uint8_t channel_No1_platform_No4_LED(uint8_t cmd);
  45. uint8_t channel_No1_platform_No5_LED(uint8_t cmd);
  46. uint8_t channel_No1_platform_No6_LED(uint8_t cmd);
  47. // channel 2 下的平台
  48. uint8_t channel_No2_LED(uint8_t platform, int i);
  49. uint8_t channel_No2_platform_No0_LED(uint8_t cmd);// 全部平台
  50. uint8_t channel_No2_platform_No1_LED(uint8_t cmd);
  51. uint8_t channel_No2_platform_No2_LED(uint8_t cmd);
  52. uint8_t channel_No2_platform_No3_LED(uint8_t cmd);
  53. uint8_t channel_No2_platform_No4_LED(uint8_t cmd);
  54. uint8_t channel_No2_platform_No5_LED(uint8_t cmd);
  55. uint8_t channel_No2_platform_No6_LED(uint8_t cmd);
  56. // channel 3 下的平台
  57. uint8_t channel_No3_LED(uint8_t platform, int i);
  58. uint8_t channel_No3_platform_No0_LED(uint8_t cmd);// 全部平台
  59. uint8_t channel_No3_platform_No1_LED(uint8_t cmd);
  60. uint8_t channel_No3_platform_No2_LED(uint8_t cmd);
  61. uint8_t channel_No3_platform_No3_LED(uint8_t cmd);
  62. uint8_t channel_No3_platform_No4_LED(uint8_t cmd);
  63. uint8_t channel_No3_platform_No5_LED(uint8_t cmd);
  64. uint8_t channel_No3_platform_No6_LED(uint8_t cmd);
  65. // channel 4 下的平台
  66. uint8_t channel_No4_LED(uint8_t platform, int i);
  67. uint8_t channel_No4_platform_No0_LED(uint8_t cmd);// 全部平台
  68. uint8_t channel_No4_platform_No1_LED(uint8_t cmd);
  69. uint8_t channel_No4_platform_No2_LED(uint8_t cmd);
  70. uint8_t channel_No4_platform_No3_LED(uint8_t cmd);
  71. uint8_t channel_No4_platform_No4_LED(uint8_t cmd);
  72. uint8_t channel_No4_platform_No5_LED(uint8_t cmd);
  73. uint8_t channel_No4_platform_No6_LED(uint8_t cmd);
  74. //////////////////////// 12VBAT ////////////////////////
  75. // 全部channel下的平台
  76. uint8_t channel_No0_12VBAT(uint8_t platform, int i); //全部channel
  77. uint8_t channel_No0_platform_No0_12VBAT(uint8_t cmd);// 全部平台
  78. uint8_t channel_No0_platform_No1_12VBAT(uint8_t cmd);
  79. uint8_t channel_No0_platform_No2_12VBAT(uint8_t cmd);
  80. uint8_t channel_No0_platform_No3_12VBAT(uint8_t cmd);
  81. uint8_t channel_No0_platform_No4_12VBAT(uint8_t cmd);
  82. uint8_t channel_No0_platform_No5_12VBAT(uint8_t cmd);
  83. uint8_t channel_No0_platform_No6_12VBAT(uint8_t cmd);
  84. // channel 1 下的平台
  85. uint8_t channel_No1_12VBAT(uint8_t platform, int i); //全部channel
  86. uint8_t channel_No1_platform_No0_12VBAT(uint8_t cmd);// 全部平台
  87. uint8_t channel_No1_platform_No1_12VBAT(uint8_t cmd);
  88. uint8_t channel_No1_platform_No2_12VBAT(uint8_t cmd);
  89. uint8_t channel_No1_platform_No3_12VBAT(uint8_t cmd);
  90. uint8_t channel_No1_platform_No4_12VBAT(uint8_t cmd);
  91. uint8_t channel_No1_platform_No5_12VBAT(uint8_t cmd);
  92. uint8_t channel_No1_platform_No6_12VBAT(uint8_t cmd);
  93. // channel 2 下的平台
  94. uint8_t channel_No2_12VBAT(uint8_t platform, int i); //全部channel
  95. uint8_t channel_No2_platform_No0_12VBAT(uint8_t cmd);// 全部平台
  96. uint8_t channel_No2_platform_No1_12VBAT(uint8_t cmd);
  97. uint8_t channel_No2_platform_No2_12VBAT(uint8_t cmd);
  98. uint8_t channel_No2_platform_No3_12VBAT(uint8_t cmd);
  99. uint8_t channel_No2_platform_No4_12VBAT(uint8_t cmd);
  100. uint8_t channel_No2_platform_No5_12VBAT(uint8_t cmd);
  101. uint8_t channel_No2_platform_No6_12VBAT(uint8_t cmd);
  102. // channel 3 下的平台
  103. uint8_t channel_No3_12VBAT(uint8_t platform, int i); //全部channel
  104. uint8_t channel_No3_platform_No0_12VBAT(uint8_t cmd);// 全部平台
  105. uint8_t channel_No3_platform_No1_12VBAT(uint8_t cmd);
  106. uint8_t channel_No3_platform_No2_12VBAT(uint8_t cmd);
  107. uint8_t channel_No3_platform_No3_12VBAT(uint8_t cmd);
  108. uint8_t channel_No3_platform_No4_12VBAT(uint8_t cmd);
  109. uint8_t channel_No3_platform_No5_12VBAT(uint8_t cmd);
  110. uint8_t channel_No3_platform_No6_12VBAT(uint8_t cmd);
  111. // channel 4 下的平台
  112. uint8_t channel_No4_12VBAT(uint8_t platform, int i); //全部channel
  113. uint8_t channel_No4_platform_No0_12VBAT(uint8_t cmd);// 全部平台
  114. uint8_t channel_No4_platform_No1_12VBAT(uint8_t cmd);
  115. uint8_t channel_No4_platform_No2_12VBAT(uint8_t cmd);
  116. uint8_t channel_No4_platform_No3_12VBAT(uint8_t cmd);
  117. uint8_t channel_No4_platform_No4_12VBAT(uint8_t cmd);
  118. uint8_t channel_No4_platform_No5_12VBAT(uint8_t cmd);
  119. uint8_t channel_No4_platform_No6_12VBAT(uint8_t cmd);
  120. #endif