main(7755).h 8.2 KB

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