sys_data.h 5.2 KB

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