main.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file : main.h
  5. * @brief : Header for main.c file.
  6. * This file contains the common defines of the application.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software component is licensed by ST under BSD 3-Clause license,
  14. * the "License"; You may not use this file except in compliance with the
  15. * License. You may obtain a copy of the License at:
  16. * opensource.org/licenses/BSD-3-Clause
  17. *
  18. ******************************************************************************
  19. */
  20. /* USER CODE END Header */
  21. /* Define to prevent recursive inclusion -------------------------------------*/
  22. #ifndef __MAIN_H
  23. #define __MAIN_H
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif
  27. /* Includes ------------------------------------------------------------------*/
  28. #include "stm32f1xx_hal.h"
  29. /* Private includes ----------------------------------------------------------*/
  30. /* USER CODE BEGIN Includes */
  31. #include "Bluecell_operate.h"
  32. /* USER CODE END Includes */
  33. /* Exported types ------------------------------------------------------------*/
  34. /* USER CODE BEGIN ET */
  35. /* USER CODE END ET */
  36. /* Exported constants --------------------------------------------------------*/
  37. /* USER CODE BEGIN EC */
  38. /* USER CODE END EC */
  39. /* Exported macro ------------------------------------------------------------*/
  40. /* USER CODE BEGIN EM */
  41. /* USER CODE END EM */
  42. /* Exported functions prototypes ---------------------------------------------*/
  43. void Error_Handler(void);
  44. /* USER CODE BEGIN EFP */
  45. extern volatile uint16_t ADC1value[4];
  46. extern volatile uint16_t ADC3value[5];
  47. extern volatile uint32_t ADC1_Average_value[4];
  48. extern volatile uint32_t ADC3_Average_value[5];
  49. extern uint16_t adc1cnt;
  50. extern uint16_t adc3cnt;
  51. extern ADC_HandleTypeDef hadc1;
  52. extern ADC_HandleTypeDef hadc3;
  53. extern I2C_HandleTypeDef hi2c2;
  54. /* USER CODE END EFP */
  55. /* Private defines -----------------------------------------------------------*/
  56. #define LED_FAIL_Pin GPIO_PIN_3
  57. #define LED_FAIL_GPIO_Port GPIOE
  58. #define FAIL_MBIC_Pin GPIO_PIN_4
  59. #define FAIL_MBIC_GPIO_Port GPIOE
  60. #define BOOT_LED_Pin GPIO_PIN_15
  61. #define BOOT_LED_GPIO_Port GPIOC
  62. #define DET_UL4_OUT_Pin GPIO_PIN_6
  63. #define DET_UL4_OUT_GPIO_Port GPIOF
  64. #define DET_DL1_IN_Pin GPIO_PIN_7
  65. #define DET_DL1_IN_GPIO_Port GPIOF
  66. #define DET_DL2_IN_Pin GPIO_PIN_8
  67. #define DET_DL2_IN_GPIO_Port GPIOF
  68. #define DET_DL3_IN_Pin GPIO_PIN_9
  69. #define DET_DL3_IN_GPIO_Port GPIOF
  70. #define DET_DL4_IN_Pin GPIO_PIN_10
  71. #define DET_DL4_IN_GPIO_Port GPIOF
  72. #define RFU_TEMP_Pin GPIO_PIN_2
  73. #define RFU_TEMP_GPIO_Port GPIOC
  74. #define RFU_TX_Pin GPIO_PIN_2
  75. #define RFU_TX_GPIO_Port GPIOA
  76. #define RFU_RX_Pin GPIO_PIN_3
  77. #define RFU_RX_GPIO_Port GPIOA
  78. #define DET_UL1_OUT_Pin GPIO_PIN_4
  79. #define DET_UL1_OUT_GPIO_Port GPIOA
  80. #define DET_UL2_OUT_Pin GPIO_PIN_5
  81. #define DET_UL2_OUT_GPIO_Port GPIOA
  82. #define DET_UL3_OUT_Pin GPIO_PIN_6
  83. #define DET_UL3_OUT_GPIO_Port GPIOA
  84. #define ATT_CLOCK3_Pin GPIO_PIN_0
  85. #define ATT_CLOCK3_GPIO_Port GPIOG
  86. #define ATT_DATA3_Pin GPIO_PIN_1
  87. #define ATT_DATA3_GPIO_Port GPIOG
  88. #define ATT_CLOCK4_Pin GPIO_PIN_10
  89. #define ATT_CLOCK4_GPIO_Port GPIOE
  90. #define ATT_DATA4_Pin GPIO_PIN_11
  91. #define ATT_DATA4_GPIO_Port GPIOE
  92. #define ATT_EN_DL4_Pin GPIO_PIN_12
  93. #define ATT_EN_DL4_GPIO_Port GPIOE
  94. #define ATT_EN_UL4_Pin GPIO_PIN_13
  95. #define ATT_EN_UL4_GPIO_Port GPIOE
  96. #define PATH_EN_DL4_Pin GPIO_PIN_14
  97. #define PATH_EN_DL4_GPIO_Port GPIOE
  98. #define PATH_EN_UL4_Pin GPIO_PIN_15
  99. #define PATH_EN_UL4_GPIO_Port GPIOE
  100. #define EEPROM_SCL_Pin GPIO_PIN_10
  101. #define EEPROM_SCL_GPIO_Port GPIOB
  102. #define EEPROM_SDA_Pin GPIO_PIN_11
  103. #define EEPROM_SDA_GPIO_Port GPIOB
  104. #define ATT_EN_UL1_Pin GPIO_PIN_14
  105. #define ATT_EN_UL1_GPIO_Port GPIOB
  106. #define PATH_EN_DL1_Pin GPIO_PIN_15
  107. #define PATH_EN_DL1_GPIO_Port GPIOB
  108. #define PATH_EN_DL2_Pin GPIO_PIN_10
  109. #define PATH_EN_DL2_GPIO_Port GPIOD
  110. #define PATH_EN_UL2_Pin GPIO_PIN_11
  111. #define PATH_EN_UL2_GPIO_Port GPIOD
  112. #define LED_ACT_Pin GPIO_PIN_14
  113. #define LED_ACT_GPIO_Port GPIOD
  114. #define ATT_EN_DL3_Pin GPIO_PIN_2
  115. #define ATT_EN_DL3_GPIO_Port GPIOG
  116. #define ATT_EN_UL3_Pin GPIO_PIN_3
  117. #define ATT_EN_UL3_GPIO_Port GPIOG
  118. #define PATH_EN_DL3_Pin GPIO_PIN_4
  119. #define PATH_EN_DL3_GPIO_Port GPIOG
  120. #define PATH_EN_UL3_Pin GPIO_PIN_5
  121. #define PATH_EN_UL3_GPIO_Port GPIOG
  122. #define _PATH_SW1_Pin GPIO_PIN_8
  123. #define _PATH_SW1_GPIO_Port GPIOG
  124. #define PATH_EN_UL1_Pin GPIO_PIN_6
  125. #define PATH_EN_UL1_GPIO_Port GPIOC
  126. #define MBIC_UP_Pin GPIO_PIN_9
  127. #define MBIC_UP_GPIO_Port GPIOA
  128. #define MBIC_DOWN_Pin GPIO_PIN_10
  129. #define MBIC_DOWN_GPIO_Port GPIOA
  130. #define ATT_CLOCK2_Pin GPIO_PIN_2
  131. #define ATT_CLOCK2_GPIO_Port GPIOD
  132. #define ATT_DATA2_Pin GPIO_PIN_3
  133. #define ATT_DATA2_GPIO_Port GPIOD
  134. #define ATT_EN_DL2_Pin GPIO_PIN_4
  135. #define ATT_EN_DL2_GPIO_Port GPIOD
  136. #define ATT_EN_UL2_Pin GPIO_PIN_7
  137. #define ATT_EN_UL2_GPIO_Port GPIOD
  138. #define PATH_SW1_Pin GPIO_PIN_9
  139. #define PATH_SW1_GPIO_Port GPIOG
  140. #define _PATH_SW2_Pin GPIO_PIN_10
  141. #define _PATH_SW2_GPIO_Port GPIOG
  142. #define PATH_SW2_Pin GPIO_PIN_11
  143. #define PATH_SW2_GPIO_Port GPIOG
  144. #define _PATH_SW3_Pin GPIO_PIN_12
  145. #define _PATH_SW3_GPIO_Port GPIOG
  146. #define PATH_SW3_Pin GPIO_PIN_13
  147. #define PATH_SW3_GPIO_Port GPIOG
  148. #define _PATH_SW4_Pin GPIO_PIN_14
  149. #define _PATH_SW4_GPIO_Port GPIOG
  150. #define PATH_SW4_Pin GPIO_PIN_15
  151. #define PATH_SW4_GPIO_Port GPIOG
  152. #define ATT_CLOCK1_Pin GPIO_PIN_6
  153. #define ATT_CLOCK1_GPIO_Port GPIOB
  154. #define ATT_DATA1_Pin GPIO_PIN_7
  155. #define ATT_DATA1_GPIO_Port GPIOB
  156. #define ATT_EN_DL1_Pin GPIO_PIN_9
  157. #define ATT_EN_DL1_GPIO_Port GPIOB
  158. /* USER CODE BEGIN Private defines */
  159. #define ADC_AVERAGECNT 500
  160. #define ADC1_CNT 4
  161. #define ADC3_CNT 5
  162. /* USER CODE END Private defines */
  163. #ifdef __cplusplus
  164. }
  165. #endif
  166. #endif /* __MAIN_H */
  167. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/