main(3860).h 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  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) 2019 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 <stdio.h>
  32. #include <stdbool.h>
  33. #include "PE43711.h"
  34. #include "BDA4601.h"
  35. #include "zig_operate.h"
  36. #include "adf4153.h"
  37. #include "uart.h"
  38. /* USER CODE END Includes */
  39. /* Exported types ------------------------------------------------------------*/
  40. /* USER CODE BEGIN ET */
  41. /* USER CODE END ET */
  42. /* Exported constants --------------------------------------------------------*/
  43. /* USER CODE BEGIN EC */
  44. typedef struct _ATTEN_Setting_st{
  45. GPIO_TypeDef * CLK_PORT;
  46. uint16_t CLK_PIN;
  47. GPIO_TypeDef * DATA_PORT;
  48. uint16_t DATA_PIN;
  49. GPIO_TypeDef * ENABLE_PORT;
  50. uint16_t ENABLE_PIN;
  51. GPIO_TypeDef * PATH_EN_PORT;
  52. uint16_t PATH_EN_PIN;
  53. } ATTEN_Setting_st;
  54. /* USER CODE END EC */
  55. /* Exported macro ------------------------------------------------------------*/
  56. /* USER CODE BEGIN EM */
  57. volatile uint32_t UartTimerCnt;
  58. /* USER CODE END EM */
  59. /* Exported functions prototypes ---------------------------------------------*/
  60. void Error_Handler(void);
  61. /* USER CODE BEGIN EFP */
  62. /* USER CODE END EFP */
  63. /* Private defines -----------------------------------------------------------*/
  64. #define ATT_EN_1_8G_DL1_Pin GPIO_PIN_2
  65. #define ATT_EN_1_8G_DL1_GPIO_Port GPIOE
  66. #define ATT_EN_1_8G_DL2_Pin GPIO_PIN_3
  67. #define ATT_EN_1_8G_DL2_GPIO_Port GPIOE
  68. #define ATT_EN_1_8G_UL1_Pin GPIO_PIN_4
  69. #define ATT_EN_1_8G_UL1_GPIO_Port GPIOE
  70. #define ATT_EN_1_8G_UL2_Pin GPIO_PIN_5
  71. #define ATT_EN_1_8G_UL2_GPIO_Port GPIOE
  72. #define ATT_EN_1_8G_UL3_Pin GPIO_PIN_6
  73. #define ATT_EN_1_8G_UL3_GPIO_Port GPIOE
  74. #define ATT_EN_1_8G_UL4_Pin GPIO_PIN_13
  75. #define ATT_EN_1_8G_UL4_GPIO_Port GPIOC
  76. #define PATH_EN_1_8G_DL_Pin GPIO_PIN_14
  77. #define PATH_EN_1_8G_DL_GPIO_Port GPIOC
  78. #define PATH_EN_1_8G_UL_Pin GPIO_PIN_15
  79. #define PATH_EN_1_8G_UL_GPIO_Port GPIOC
  80. #define PLL_EN_1_8G_DL_Pin GPIO_PIN_0
  81. #define PLL_EN_1_8G_DL_GPIO_Port GPIOF
  82. #define PLL_EN_1_8G_UL_Pin GPIO_PIN_1
  83. #define PLL_EN_1_8G_UL_GPIO_Port GPIOF
  84. #define PLL_LD_1_8G_DL_Pin GPIO_PIN_2
  85. #define PLL_LD_1_8G_DL_GPIO_Port GPIOF
  86. #define PLL_LD_1_8G_UL_Pin GPIO_PIN_3
  87. #define PLL_LD_1_8G_UL_GPIO_Port GPIOF
  88. #define ATT_EN_2_1G_DL1_Pin GPIO_PIN_4
  89. #define ATT_EN_2_1G_DL1_GPIO_Port GPIOF
  90. #define ATT_EN_2_1G_DL2_Pin GPIO_PIN_5
  91. #define ATT_EN_2_1G_DL2_GPIO_Port GPIOF
  92. #define ATT_EN_2_1G_UL1_Pin GPIO_PIN_6
  93. #define ATT_EN_2_1G_UL1_GPIO_Port GPIOF
  94. #define ATT_EN_2_1G_UL2_Pin GPIO_PIN_7
  95. #define ATT_EN_2_1G_UL2_GPIO_Port GPIOF
  96. #define ATT_EN_2_1G_UL3_Pin GPIO_PIN_8
  97. #define ATT_EN_2_1G_UL3_GPIO_Port GPIOF
  98. #define ATT_EN_2_1G_UL4_Pin GPIO_PIN_9
  99. #define ATT_EN_2_1G_UL4_GPIO_Port GPIOF
  100. #define DET_3_5G_UL_IN_Pin GPIO_PIN_0
  101. #define DET_3_5G_UL_IN_GPIO_Port GPIOC
  102. #define DET_3_5G_UL_OUT_Pin GPIO_PIN_1
  103. #define DET_3_5G_UL_OUT_GPIO_Port GPIOC
  104. #define RFU_TEMP_Pin GPIO_PIN_2
  105. #define RFU_TEMP_GPIO_Port GPIOC
  106. #define _28V_DET_Pin GPIO_PIN_3
  107. #define _28V_DET_GPIO_Port GPIOC
  108. #define DET_1_8G_DL_IN_Pin GPIO_PIN_0
  109. #define DET_1_8G_DL_IN_GPIO_Port GPIOA
  110. #define DET_1_8G_DL_OUT_Pin GPIO_PIN_1
  111. #define DET_1_8G_DL_OUT_GPIO_Port GPIOA
  112. #define DET_1_8G_UL_IN_Pin GPIO_PIN_2
  113. #define DET_1_8G_UL_IN_GPIO_Port GPIOA
  114. #define DET_1_8G_UL_OUT_Pin GPIO_PIN_3
  115. #define DET_1_8G_UL_OUT_GPIO_Port GPIOA
  116. #define DET_2_1G_DL_IN_Pin GPIO_PIN_4
  117. #define DET_2_1G_DL_IN_GPIO_Port GPIOA
  118. #define DET_2_1G_DL_OUT_Pin GPIO_PIN_5
  119. #define DET_2_1G_DL_OUT_GPIO_Port GPIOA
  120. #define DET_2_1G_UL_IN_Pin GPIO_PIN_6
  121. #define DET_2_1G_UL_IN_GPIO_Port GPIOA
  122. #define DET_2_1G_UL_OUT_Pin GPIO_PIN_7
  123. #define DET_2_1G_UL_OUT_GPIO_Port GPIOA
  124. #define DET_3_5G_DL_IN_Pin GPIO_PIN_0
  125. #define DET_3_5G_DL_IN_GPIO_Port GPIOB
  126. #define DET_3_5G_DL_OUT_Pin GPIO_PIN_1
  127. #define DET_3_5G_DL_OUT_GPIO_Port GPIOB
  128. #define PLL_DATA_Pin GPIO_PIN_8
  129. #define PLL_DATA_GPIO_Port GPIOD
  130. #define PLL_CLK_Pin GPIO_PIN_9
  131. #define PLL_CLK_GPIO_Port GPIOD
  132. #define ATT_DATA_Pin GPIO_PIN_10
  133. #define ATT_DATA_GPIO_Port GPIOD
  134. #define ATT_CLK_Pin GPIO_PIN_11
  135. #define ATT_CLK_GPIO_Port GPIOD
  136. #define ALARM_DC_Pin GPIO_PIN_12
  137. #define ALARM_DC_GPIO_Port GPIOD
  138. #define ALARM_AC_Pin GPIO_PIN_13
  139. #define ALARM_AC_GPIO_Port GPIOD
  140. #define DA_LDAC_Pin GPIO_PIN_15
  141. #define DA_LDAC_GPIO_Port GPIOD
  142. #define DA_SYNC_Pin GPIO_PIN_2
  143. #define DA_SYNC_GPIO_Port GPIOG
  144. #define DA_SCLK_Pin GPIO_PIN_3
  145. #define DA_SCLK_GPIO_Port GPIOG
  146. #define DA_DIN_Pin GPIO_PIN_4
  147. #define DA_DIN_GPIO_Port GPIOG
  148. #define _T_SYNC_UL_Pin GPIO_PIN_5
  149. #define _T_SYNC_UL_GPIO_Port GPIOG
  150. #define T_SYNC_UL_Pin GPIO_PIN_6
  151. #define T_SYNC_UL_GPIO_Port GPIOG
  152. #define _T_SYNC_DL_Pin GPIO_PIN_7
  153. #define _T_SYNC_DL_GPIO_Port GPIOG
  154. #define T_SYNC_DL_Pin GPIO_PIN_8
  155. #define T_SYNC_DL_GPIO_Port GPIOG
  156. #define PLL_EN_3_5G_L_Pin GPIO_PIN_6
  157. #define PLL_EN_3_5G_L_GPIO_Port GPIOC
  158. #define PLL_EN_3_5G_H_Pin GPIO_PIN_7
  159. #define PLL_EN_3_5G_H_GPIO_Port GPIOC
  160. #define PLL_LD_3_5G_L_Pin GPIO_PIN_8
  161. #define PLL_LD_3_5G_L_GPIO_Port GPIOC
  162. #define PLL_LD_3_5G_H_Pin GPIO_PIN_9
  163. #define PLL_LD_3_5G_H_GPIO_Port GPIOC
  164. #define PLL_CLK_3_5G_Pin GPIO_PIN_15
  165. #define PLL_CLK_3_5G_GPIO_Port GPIOA
  166. #define PLL_ON_OFF_3_5G_L_Pin GPIO_PIN_10
  167. #define PLL_ON_OFF_3_5G_L_GPIO_Port GPIOC
  168. #define PLL_DATA_3_5G_Pin GPIO_PIN_11
  169. #define PLL_DATA_3_5G_GPIO_Port GPIOC
  170. #define PLL_ON_OFF_3_5G_H_Pin GPIO_PIN_12
  171. #define PLL_ON_OFF_3_5G_H_GPIO_Port GPIOC
  172. #define ATT_CLK_3_5G_Pin GPIO_PIN_0
  173. #define ATT_CLK_3_5G_GPIO_Port GPIOD
  174. #define ATT_EN_3_5G_Pin GPIO_PIN_1
  175. #define ATT_EN_3_5G_GPIO_Port GPIOD
  176. #define ATT_DATA_3_5G_DL_Pin GPIO_PIN_2
  177. #define ATT_DATA_3_5G_DL_GPIO_Port GPIOD
  178. #define ATT_DATA_3_5G_UL_Pin GPIO_PIN_3
  179. #define ATT_DATA_3_5G_UL_GPIO_Port GPIOD
  180. #define ATT_DATA_3_5G_COM1_Pin GPIO_PIN_4
  181. #define ATT_DATA_3_5G_COM1_GPIO_Port GPIOD
  182. #define ATT_DATA_3_5G_COM2_Pin GPIO_PIN_5
  183. #define ATT_DATA_3_5G_COM2_GPIO_Port GPIOD
  184. #define ATT_DATA_3_5G_COM3_Pin GPIO_PIN_6
  185. #define ATT_DATA_3_5G_COM3_GPIO_Port GPIOD
  186. #define PATH_EN_3_5G_L_Pin GPIO_PIN_7
  187. #define PATH_EN_3_5G_L_GPIO_Port GPIOD
  188. #define PATH_EN_3_5G_H_Pin GPIO_PIN_9
  189. #define PATH_EN_3_5G_H_GPIO_Port GPIOG
  190. #define PATH_EN_3_5G_DL_Pin GPIO_PIN_10
  191. #define PATH_EN_3_5G_DL_GPIO_Port GPIOG
  192. #define PATH_EN_3_5G_UL_Pin GPIO_PIN_11
  193. #define PATH_EN_3_5G_UL_GPIO_Port GPIOG
  194. #define PLL_ON_OFF_3_5G_LG12_Pin GPIO_PIN_12
  195. #define PLL_ON_OFF_3_5G_LG12_GPIO_Port GPIOG
  196. #define PLL_ON_OFF_3_5G_HG13_Pin GPIO_PIN_13
  197. #define PLL_ON_OFF_3_5G_HG13_GPIO_Port GPIOG
  198. #define BOOT_LED_Pin GPIO_PIN_14
  199. #define BOOT_LED_GPIO_Port GPIOG
  200. #define PLL_EN_2_1G_DL_Pin GPIO_PIN_3
  201. #define PLL_EN_2_1G_DL_GPIO_Port GPIOB
  202. #define PLL_EN_2_1G_UL_Pin GPIO_PIN_4
  203. #define PLL_EN_2_1G_UL_GPIO_Port GPIOB
  204. #define PLL_LD_2_1G_DL_Pin GPIO_PIN_5
  205. #define PLL_LD_2_1G_DL_GPIO_Port GPIOB
  206. #define PLL_LD_2_1G_UL_Pin GPIO_PIN_6
  207. #define PLL_LD_2_1G_UL_GPIO_Port GPIOB
  208. #define PATH_EN_2_1G_DL_Pin GPIO_PIN_0
  209. #define PATH_EN_2_1G_DL_GPIO_Port GPIOE
  210. #define PATH_EN_2_1G_UL_Pin GPIO_PIN_1
  211. #define PATH_EN_2_1G_UL_GPIO_Port GPIOE
  212. /* USER CODE BEGIN Private defines */
  213. #define BLUECELL_HEADER 0xBE
  214. #define DEBUG_PRINT
  215. /* USER CODE END Private defines */
  216. #ifdef __cplusplus
  217. }
  218. #endif
  219. #endif /* __MAIN_H */
  220. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/