tae32f53xx_ll_gpio.h 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518
  1. /**
  2. ******************************************************************************
  3. * @file tae32f53xx_ll_gpio.h
  4. * @author MCD Application Team
  5. * @brief Header file of GPIO LL module.
  6. *
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * <h2><center>&copy; Copyright (c) 2020 Tai-Action.
  11. * All rights reserved.</center></h2>
  12. *
  13. * This software is licensed by Tai-Action 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. /* Define to prevent recursive inclusion -------------------------------------*/
  21. #ifndef _TAE32F53XX_LL_GPIO_H_
  22. #define _TAE32F53XX_LL_GPIO_H_
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif /* __cplusplus */
  26. /* Includes ------------------------------------------------------------------*/
  27. #include "tae32f53xx_ll_def.h"
  28. /** @addtogroup TAE32F53xx_LL_Driver
  29. * @{
  30. */
  31. /** @addtogroup GPIO_LL
  32. * @{
  33. */
  34. /* Exported types ------------------------------------------------------------*/
  35. /** @defgroup GPIO_LL_Exported_Types GPIO LL Exported Types
  36. * @brief GPIO LL Exported Types
  37. * @{
  38. */
  39. /**
  40. * @brief GPIO Configuration Mode
  41. * Elements values convention: 0xX0Y0000Z
  42. * - X : GPIO mode or Interrupt Mode
  43. * - Y : External IT detection
  44. * - Z : IO Direction mode (Input, Output or Alternate)
  45. * @note External Interrupt only vailed in input mode
  46. */
  47. typedef enum {
  48. GPIO_MODE_INPUT = 0x00000000u, /*!< GPIO Input Mode */
  49. GPIO_MODE_OUTPUT = 0x00000001u, /*!< GPIO Output Mode */
  50. GPIO_MODE_AF = 0x00000002u, /*!< GPIO Alternate Mode */
  51. GPIO_MODE_ANALOG = 0x00000003u, /*!< Analog Mode */
  52. GPIO_MODE_IT_RISING = 0x10100000u, /*!< External Interrupt Mode with Rising edge trigger detection */
  53. GPIO_MODE_IT_FALLING = 0x10200000u, /*!< External Interrupt Mode with Falling edge trigger detection */
  54. GPIO_MODE_IT_RISING_FALLING = 0x10300000u, /*!< External Interrupt Mode with Rising/Falling edge trigger detection */
  55. } GPIO_ModeETypeDef;
  56. /**
  57. * @brief GPIO AF Mode enumeration
  58. */
  59. typedef enum {
  60. GPIO_AF0_INPUT = ((uint8_t)0x0), /*!< GPIO alternate function 0 INPUT */
  61. GPIO_AF1_OUTPUT = ((uint8_t)0x1), /*!< GPIO alternate function 1 OUTPUT */
  62. GPIO_AF2_MCO = ((uint8_t)0x2), /*!< GPIO alternate function 2 MCO */
  63. GPIO_AF2_SWDAT = ((uint8_t)0x2), /*!< GPIO alternate function 2 SWDAT */
  64. GPIO_AF2_SWCLK = ((uint8_t)0x2), /*!< GPIO alternate function 2 SWCLK */
  65. GPIO_AF2_SWO = ((uint8_t)0x2), /*!< GPIO alternate function 2 SWO */
  66. GPIO_AF2_SYSDBOUT = ((uint8_t)0x2), /*!< GPIO alternate function 2 SYSDBOUT */
  67. GPIO_AF3_TMR0 = ((uint8_t)0x3), /*!< GPIO alternate function 3 TMR0 */
  68. GPIO_AF3_TMR1 = ((uint8_t)0x3), /*!< GPIO alternate function 3 TMR1 */
  69. GPIO_AF3_TMR2 = ((uint8_t)0x3), /*!< GPIO alternate function 3 TMR2 */
  70. GPIO_AF3_TMR3 = ((uint8_t)0x3), /*!< GPIO alternate function 3 TMR3 */
  71. GPIO_AF4_TMR0 = ((uint8_t)0x4), /*!< GPIO alternate function 4 TMR0 */
  72. GPIO_AF4_TMR1 = ((uint8_t)0x4), /*!< GPIO alternate function 4 TMR1 */
  73. GPIO_AF4_TMR2 = ((uint8_t)0x4), /*!< GPIO alternate function 4 TMR2 */
  74. GPIO_AF4_TMR3 = ((uint8_t)0x4), /*!< GPIO alternate function 4 TMR3 */
  75. GPIO_AF5_TMR4 = ((uint8_t)0x5), /*!< GPIO alternate function 5 TMR4 */
  76. GPIO_AF5_TMR5 = ((uint8_t)0x5), /*!< GPIO alternate function 5 TMR5 */
  77. GPIO_AF5_TMR6 = ((uint8_t)0x5), /*!< GPIO alternate function 5 TMR6 */
  78. GPIO_AF5_TMR7 = ((uint8_t)0x5), /*!< GPIO alternate function 5 TMR7 */
  79. GPIO_AF6_TMR4 = ((uint8_t)0x6), /*!< GPIO alternate function 6 TMR4 */
  80. GPIO_AF6_TMR5 = ((uint8_t)0x6), /*!< GPIO alternate function 6 TMR5 */
  81. GPIO_AF6_TMR6 = ((uint8_t)0x6), /*!< GPIO alternate function 6 TMR6 */
  82. GPIO_AF6_TMR7 = ((uint8_t)0x6), /*!< GPIO alternate function 6 TMR7 */
  83. GPIO_AF7_CAN = ((uint8_t)0x7), /*!< GPIO alternate function 7 CAN */
  84. GPIO_AF7_I2C0 = ((uint8_t)0x7), /*!< GPIO alternate function 7 I2C0 */
  85. GPIO_AF8_I2C0 = ((uint8_t)0x8), /*!< GPIO alternate function 8 I2C0 */
  86. GPIO_AF8_DALI = ((uint8_t)0x8), /*!< GPIO alternate function 8 DALI */
  87. GPIO_AF9_I2C1 = ((uint8_t)0x9), /*!< GPIO alternate function 9 I2C1 */
  88. GPIO_AF9_UART1 = ((uint8_t)0x9), /*!< GPIO alternate function 9 UART1 */
  89. GPIO_AF10_UART0 = ((uint8_t)0xA), /*!< GPIO alternate function 10 UART0 */
  90. GPIO_AF10_UART1 = ((uint8_t)0xA), /*!< GPIO alternate function 10 UART1 */
  91. GPIO_AF11_HRPWM = ((uint8_t)0xB), /*!< GPIO alternate function 11 HRPWM */
  92. GPIO_AF11_USB = ((uint8_t)0xB), /*!< GPIO alternate function 1 USB */
  93. GPIO_AF12_HRPWM = ((uint8_t)0xC), /*!< GPIO alternate function 12 HRPWM */
  94. GPIO_AF13_HRPWM = ((uint8_t)0xD), /*!< GPIO alternate function 13 HRPWM */
  95. GPIO_AF14_CMP0 = ((uint8_t)0xE), /*!< GPIO alternate function 14 CMP0 */
  96. GPIO_AF14_CMP1 = ((uint8_t)0xE), /*!< GPIO alternate function 14 CMP1 */
  97. GPIO_AF14_CMP2 = ((uint8_t)0xE), /*!< GPIO alternate function 14 CMP2 */
  98. GPIO_AF14_CMP3 = ((uint8_t)0xE), /*!< GPIO alternate function 14 CMP3 */
  99. GPIO_AF15_ANALOG = ((uint8_t)0xF), /*!< GPIO alternate function 15 ANALOG */
  100. GPIO_AF15_ADC0 = ((uint8_t)0xF), /*!< GPIO alternate function 15 ADC0 */
  101. GPIO_AF15_ADC1 = ((uint8_t)0xF), /*!< GPIO alternate function 15 ADC1 */
  102. GPIO_AF15_DAC0 = ((uint8_t)0xF), /*!< GPIO alternate function 15 DAC0 */
  103. GPIO_AF15_DAC1 = ((uint8_t)0xF), /*!< GPIO alternate function 15 DAC1 */
  104. GPIO_AF15_DAC2 = ((uint8_t)0xF), /*!< GPIO alternate function 15 DAC2 */
  105. GPIO_AF15_DAC3 = ((uint8_t)0xF), /*!< GPIO alternate function 15 DAC3 */
  106. GPIO_AF15_CMP0 = ((uint8_t)0xF), /*!< GPIO alternate function 15 CMP0 */
  107. GPIO_AF15_CMP1 = ((uint8_t)0xF), /*!< GPIO alternate function 15 CMP1 */
  108. GPIO_AF15_CMP2 = ((uint8_t)0xF), /*!< GPIO alternate function 15 CMP2 */
  109. GPIO_AF15_CMP3 = ((uint8_t)0xF), /*!< GPIO alternate function 15 CMP3 */
  110. GPIO_AF15_USB = ((uint8_t)0xF), /*!< GPIO alternate function 15 USB */
  111. } GPIO_AFETypeDef;
  112. /**
  113. * @brief GPIO Pull-Up or Pull-Down Activation
  114. */
  115. typedef enum {
  116. GPIO_NOPULL = 0x00000000U, /*!< No Pull-up or Pull-down activation */
  117. GPIO_PULLUP = 0x00000001U, /*!< Pull-up activation */
  118. GPIO_PULLDOWN = 0x00000002U, /*!< Pull-down activation */
  119. } GPIO_PullETypeDef;
  120. /**
  121. * @brief GPIO output type: Push-Pull or Open-Drain
  122. */
  123. typedef enum {
  124. GPIO_OTYPE_PP = 0x00000000U, /*!< Output Push Pull Type */
  125. GPIO_OTYPE_OD = 0x00000001U, /*!< Output Open Drain Type */
  126. } GPIO_OutputETypeDef;
  127. /**
  128. * @brief GPIO Output Maximum frequency
  129. */
  130. typedef enum {
  131. GPIO_SPEED_FREQ_LOW = 0x00000000U, /*!< Low speed */
  132. GPIO_SPEED_FREQ_HIGH = 0x00000001U, /*!< High speed */
  133. } GPIO_SpeedETypeDef;
  134. /**
  135. * @brief GPIO Bit SET and Bit RESET enumeration
  136. */
  137. typedef enum {
  138. GPIO_PIN_RESET = 0, /*!< GPIO pin state RESET */
  139. GPIO_PIN_SET, /*!< GPIO pin state SET */
  140. } GPIO_PinStateETypeDef;
  141. /**
  142. * @brief GPIO Init structure definition
  143. */
  144. typedef struct __GPIO_InitTypeDef {
  145. uint32_t Pin; /*!< Specifies the GPIO pins to be configured.
  146. This parameter can be any value of @ref GPIO_pins_define */
  147. GPIO_ModeETypeDef Mode; /*!< Specifies the operating mode for the selected pins. */
  148. GPIO_OutputETypeDef OType; /*!< Specifies the output type for the selected pins(output or AF output mode only). */
  149. GPIO_PullETypeDef Pull; /*!< Specifies the Pull-up or Pull-Down activation for the selected pins. */
  150. GPIO_SpeedETypeDef Speed; /*!< Specifies the speed for the selected pins. */
  151. GPIO_AFETypeDef Alternate; /*!< Peripheral to be connected to the selected pins. */
  152. } GPIO_InitTypeDef;
  153. /**
  154. * @}
  155. */
  156. /* Exported constants --------------------------------------------------------*/
  157. /** @defgroup GPIO_LL_Exported_Constants GPIO LL Exported Constants
  158. * @brief GPIO LL Exported Constants
  159. * @{
  160. */
  161. /** @addtogroup GPIO_pins_define GPIO pins define
  162. * @{
  163. */
  164. #define GPIO_NUMBER 16U
  165. #define GPIO_PIN_0 ((uint16_t)0x0001) /* Pin 0 selected */
  166. #define GPIO_PIN_1 ((uint16_t)0x0002) /* Pin 1 selected */
  167. #define GPIO_PIN_2 ((uint16_t)0x0004) /* Pin 2 selected */
  168. #define GPIO_PIN_3 ((uint16_t)0x0008) /* Pin 3 selected */
  169. #define GPIO_PIN_4 ((uint16_t)0x0010) /* Pin 4 selected */
  170. #define GPIO_PIN_5 ((uint16_t)0x0020) /* Pin 5 selected */
  171. #define GPIO_PIN_6 ((uint16_t)0x0040) /* Pin 6 selected */
  172. #define GPIO_PIN_7 ((uint16_t)0x0080) /* Pin 7 selected */
  173. #define GPIO_PIN_8 ((uint16_t)0x0100) /* Pin 8 selected */
  174. #define GPIO_PIN_9 ((uint16_t)0x0200) /* Pin 9 selected */
  175. #define GPIO_PIN_10 ((uint16_t)0x0400) /* Pin 10 selected */
  176. #define GPIO_PIN_11 ((uint16_t)0x0800) /* Pin 11 selected */
  177. #define GPIO_PIN_12 ((uint16_t)0x1000) /* Pin 12 selected */
  178. #define GPIO_PIN_13 ((uint16_t)0x2000) /* Pin 13 selected */
  179. #define GPIO_PIN_14 ((uint16_t)0x4000) /* Pin 14 selected */
  180. #define GPIO_PIN_15 ((uint16_t)0x8000) /* Pin 15 selected */
  181. #define GPIO_PIN_All ((uint16_t)0xFFFF) /* All pins selected */
  182. #define GPIO_PIN_MASK 0x0000FFFFu /* PIN mask for assert test */
  183. /**
  184. * @}
  185. */
  186. /**
  187. * @}
  188. */
  189. /* Exported macro ------------------------------------------------------------*/
  190. /** @defgroup GPIO_LL_Exported_Macros GPIO LL Exported Macros
  191. * @brief GPIO LL Exported Macros
  192. * @{
  193. */
  194. /**
  195. * @brief Enable the specified GPIO_Port interrupt.
  196. * @param __GPIO__ specifies GPIO Port to enable.
  197. * This parameter can be one of GPIOx where x can be (A, B, ...)
  198. * @return None
  199. */
  200. #define __LL_GPIO_PORT_IT_ENABLE(__GPIO__) WRITE_REG((__GPIO__)->IER, 0x01U)
  201. /**
  202. * @brief Disable the specified GPIO_Port interrupt.
  203. * @param __GPIO__ specifies GPIO Port to disable.
  204. * This parameter can be one of GPIOx where x can be (A, B, ...)
  205. * @return None
  206. */
  207. #define __LL_GPIO_PORT_IT_DISABLE(__GPIO__) WRITE_REG((__GPIO__)->IER, 0x00U)
  208. /**
  209. * @brief Enable the specified GPIO_Pin interrupt.
  210. * @note GPIO_Port interrupt must also be enabled.
  211. * @param __GPIO__ specifies GPIO Port.
  212. * This parameter can be one of GPIOx where x can be (A, B, ...)
  213. * @param __PIN__ specifies GPIO Pin.
  214. * This parameter can be any combination of @ref GPIO_pins_define
  215. * @return None
  216. */
  217. #define __LL_GPIO_IT_ENABLE(__GPIO__, __PIN__) SET_BIT((__GPIO__)->ITER, (__PIN__))
  218. /**
  219. * @brief Disable the specified GPIO_Pin interrupt.
  220. * @param __GPIO__ specifies GPIO Port.
  221. * This parameter can be one of GPIOx where x can be (A, B, ...)
  222. * @param __PIN__ specifies GPIO Pin.
  223. * This parameter can be any combination of @ref GPIO_pins_define
  224. * @return None
  225. */
  226. #define __LL_GPIO_IT_DISABLE(__GPIO__, __PIN__) CLEAR_BIT((__GPIO__)->ITER, (__PIN__))
  227. /**
  228. * @brief Check whether the specified GPIO_Pin Interrupt is enabled or not.
  229. * @param __GPIO__ specifies GPIO Port.
  230. * This parameter can be one of GPIOx where x can be (A, B, ...)
  231. * @param __PIN__ specifies GPIO Pin.
  232. * This parameter can be any combination of @ref GPIO_pins_define
  233. * @return The interrupt settings for specified GPIO_Pin(ENABLE or DISABLE)
  234. */
  235. #define __LL_GPIO_IT_CHECK_SOURCE(__GPIO__, __PIN__) ((((__GPIO__)->ITER & GPIO_ITER_ITE) == (__PIN__)) ? SET : RESET)
  236. /**
  237. * @brief Check whether the specified GPIO_Pin pending flag is set or not.
  238. * @param __GPIO__ specifies GPIO Port.
  239. * This parameter can be one of GPIOx where x can be (A, B, ...)
  240. * @param __PIN__ specifies GPIO Pin.
  241. * This parameter can be any combination of @ref GPIO_pins_define
  242. * @return The pending state of __PIN__
  243. * @retval SET At least one of __PIN__ is Pending
  244. * @retval RESET None of __PIN__ is Pending
  245. */
  246. #define __LL_GPIO_GET_FLAG(__GPIO__, __PIN__) ((((__GPIO__)->PR & (__PIN__)) != 0x00UL) ? SET : RESET)
  247. /**
  248. * @brief Clear the specified GPIO_Pin pending flags
  249. * @param __GPIO__ specifies GPIO Port.
  250. * This parameter can be one of GPIOx where x can be (A, B, ...)
  251. * @param __PIN__ specifies GPIO Pin.
  252. * This parameter can be any combination of @ref GPIO_pins_define
  253. * @return None
  254. */
  255. #define __LL_GPIO_CLEAR_FLAG(__GPIO__, __PIN__) ((__GPIO__)->PR = (__PIN__))
  256. /**
  257. * @brief Check whether the specified GPIO_Pin interrupt pending flag is asserted or not.
  258. * @param __GPIO__ specifies GPIO Port.
  259. * This parameter can be one of GPIOx where x can be (A, B, ...)
  260. * @param __PIN__ specifies GPIO Pin.
  261. * This parameter can be any combination of @ref GPIO_pins_define
  262. * @return The interrupt pending state of __PIN__
  263. * @retval SET At least one of __PIN__ is pending interrupt
  264. * @retval RESET None of __PIN__ is pending interrupt
  265. */
  266. #define __LL_GPIO_GET_IT(__GPIO__, __PIN__) ((((__GPIO__)->PR & (__PIN__)) != 0x00UL) ? SET : RESET)
  267. /**
  268. * @brief Clear the specified GPIO_Pin interrupt pending flags
  269. * @param __GPIO__ specifies GPIO Port.
  270. * This parameter can be one of GPIOx where x can be (A, B, ...)
  271. * @param __PIN__ specifies GPIO Pin.
  272. * This parameter can be any combination of @ref GPIO_pins_define
  273. * @return None
  274. */
  275. #define __LL_GPIO_CLEAR_IT(__GPIO__, __PIN__) ((__GPIO__)->PR = (__PIN__))
  276. /**
  277. * @brief Enable the specified GPIO_Pin input debounce feature.
  278. * The external signal will debounce 4 HCLK time before enter GPIO module
  279. * @param __GPIO__ specifies GPIO Port.
  280. * This parameter can be one of GPIOx where x can be (A, B, ...)
  281. * @param __PIN__ specifies GPIO Pin.
  282. * This parameter can be any combination of @ref GPIO_pins_define
  283. * @return None
  284. */
  285. #define __LL_GPIO_INPUT_DEB_ENABLE(__GPIO__, __PIN__) SET_BIT((__GPIO__)->SDER, (__PIN__))
  286. /**
  287. * @brief Disable the specified GPIO_Pin input debounce feature.
  288. * The external signal will enter GPIO module without any debounce
  289. * @param __GPIO__ specifies GPIO Port.
  290. * This parameter can be one of GPIOx where x can be (A, B, ...)
  291. * @param __PIN__ specifies GPIO Pin.
  292. * This parameter can be any combination of @ref GPIO_pins_define
  293. * @return None
  294. */
  295. #define __LL_GPIO_INPUT_DEB_DISABLE(__GPIO__, __PIN__) CLEAR_BIT((__GPIO__)->SDER, (__PIN__))
  296. /**
  297. * @brief Enable the specified GPIO_Pin input synchronize feature.
  298. * The external signal will be aligned with HCLK before enter GPIO module
  299. * @param __GPIO__ specifies GPIO Port.
  300. * This parameter can be one of GPIOx where x can be (A, B, ...)
  301. * @param __PIN__ specifies GPIO Pin.
  302. * This parameter can be any combination of @ref GPIO_pins_define
  303. * @return None
  304. */
  305. #define __LL_GPIO_INPUT_SYNC_ENABLE(__GPIO__, __PIN__) SET_BIT((__GPIO__)->SDER, ((__PIN__) << 16U))
  306. /**
  307. * @brief Disable the specified GPIO_Pin input synchronize feature.
  308. * The external signal will enter GPIO module without synchronization
  309. * @param __GPIO__ specifies GPIO Port.
  310. * This parameter can be one of GPIOx where x can be (A, B, ...)
  311. * @param __PIN__ specifies GPIO Pin.
  312. * This parameter can be any combination of @ref GPIO_pins_define
  313. * @return None
  314. */
  315. #define __LL_GPIO_INPUT_SYNC_DISABLE(__GPIO__, __PIN__) CLEAR_BIT((__GPIO__)->SDER, ((__PIN__) << 16U))
  316. /**
  317. * @brief Enable the specified GPIO_Pin input Hysteresis feature.
  318. * When enable hysteresis, the rising edge?threshold?voltage is larger than the falling edge?threshold?voltage
  319. * @param __GPIO__ specifies GPIO Port.
  320. * This parameter can be one of GPIOx where x can be (A, B, ...)
  321. * @param __PIN__ specifies GPIO Pin.
  322. * This parameter can be any combination of @ref GPIO_pins_define
  323. * @return None
  324. */
  325. #define __LL_GPIO_INPUT_HY_ENABLE(__GPIO__, __PIN__) SET_BIT((__GPIO__)->IHYR, (__PIN__))
  326. /**
  327. * @brief Disable the specified GPIO_Pin input Hysteresis feature.
  328. * @param __GPIO__ specifies GPIO Port.
  329. * This parameter can be one of GPIOx where x can be (A, B, ...)
  330. * @param __PIN__ specifies GPIO Pin.
  331. * This parameter can be any combination of @ref GPIO_pins_define
  332. * @return None
  333. */
  334. #define __LL_GPIO_INPUT_HY_DISABLE(__GPIO__, __PIN__) CLEAR_BIT((__GPIO__)->IHYR, (__PIN__))
  335. /**
  336. * @brief Set low output driver strenght (8mA) for specified GPIO_Pin.
  337. * @param __GPIO__ specifies GPIO Port.
  338. * This parameter can be one of GPIOx where x can be (A, B, ...)
  339. * @param __PIN__ specifies GPIO Pin.
  340. * This parameter can be any combination of @ref GPIO_pins_define
  341. * @return None
  342. */
  343. #define __LL_GPIO_OUTPUT_DRV_STRENGHT_LOW(__GPIO__, __PIN__) CLEAR_BIT((__GPIO__)->DSR, (__PIN__))
  344. /**
  345. * @brief Set high output driver strenght (24mA) for specified GPIO_Pin.
  346. * @param __GPIO__ specifies GPIO Port.
  347. * This parameter can be one of GPIOx where x can be (A, B, ...)
  348. * @param __PIN__ specifies GPIO Pin.
  349. * This parameter can be any combination of @ref GPIO_pins_define
  350. * @return None
  351. */
  352. #define __LL_GPIO_OUTPUT_DRV_STRENGHT_HIGH(__GPIO__, __PIN__) SET_BIT((__GPIO__)->DSR, (__PIN__))
  353. /**
  354. * @}
  355. */
  356. /* Exported functions --------------------------------------------------------*/
  357. /** @addtogroup GPIO_LL_Exported_Functions
  358. * @{
  359. */
  360. /** @addtogroup GPIO_LL_Exported_Functions_Group1
  361. * @{
  362. */
  363. LL_StatusETypeDef LL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init);
  364. LL_StatusETypeDef LL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin);
  365. /**
  366. * @}
  367. */
  368. /** @addtogroup GPIO_LL_Exported_Functions_Group2
  369. * @{
  370. */
  371. void LL_GPIO_AF_Config(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_AFETypeDef Alternate);
  372. /**
  373. * @}
  374. */
  375. /** @addtogroup GPIO_LL_Exported_Functions_Group3
  376. * @{
  377. */
  378. GPIO_PinStateETypeDef LL_GPIO_ReadPin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin) ;
  379. void LL_GPIO_WritePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin, GPIO_PinStateETypeDef PinState);
  380. void LL_GPIO_TogglePin(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
  381. uint16_t LL_GPIO_ReadData(GPIO_TypeDef *GPIOx);
  382. void LL_GPIO_WriteData(GPIO_TypeDef *GPIOx, uint16_t Data);
  383. /**
  384. * @}
  385. */
  386. /** @addtogroup GPIO_LL_Exported_Functions_Interrupt
  387. * @{
  388. */
  389. void LL_GPIO_IRQHandler(GPIO_TypeDef *GPIOx);
  390. void LL_GPIO_ExtTrigCallback(GPIO_TypeDef *GPIOx, uint16_t GPIO_Pin);
  391. /**
  392. * @}
  393. */
  394. /**
  395. * @}
  396. */
  397. /* Private types -------------------------------------------------------------*/
  398. /* Private variables ---------------------------------------------------------*/
  399. /* Private constants ---------------------------------------------------------*/
  400. /* Private macros ------------------------------------------------------------*/
  401. /** @defgroup GPIO_LL_Private_Macros GPIO LL Private Macros
  402. * @brief GPIO LL Private Macros
  403. * @{
  404. */
  405. /**
  406. * @brief Judge is GPIO pin or not
  407. * @param __PIN__ pin to judge
  408. * @retval 0 isn't GPIO pin
  409. * @retval 1 is GPIO pin
  410. */
  411. #define IS_GPIO_PIN(__PIN__) ((((__PIN__) & GPIO_PIN_MASK) != 0x00U) && \
  412. (((__PIN__) & ~GPIO_PIN_MASK) == 0x00U))
  413. /**
  414. * @}
  415. */
  416. /* Private functions ---------------------------------------------------------*/
  417. /**
  418. * @}
  419. */
  420. /**
  421. * @}
  422. */
  423. #ifdef __cplusplus
  424. }
  425. #endif /* __cplusplus */
  426. #endif /* _TAE32F53XX_LL_GPIO_H_ */
  427. /************************* (C) COPYRIGHT Tai-Action *****END OF FILE***********/