main(4523).h 8.1 KB

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