You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

430 lines
20 KiB

  1. /**
  2. ******************************************************************************
  3. * @file stm32h7xx_hal_gpio_ex.h
  4. * @author MCD Application Team
  5. * @brief Header file of GPIO HAL Extension module.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under BSD 3-Clause license,
  13. * the "License"; You may not use this file except in compliance with the
  14. * License. You may obtain a copy of the License at:
  15. * opensource.org/licenses/BSD-3-Clause
  16. *
  17. ******************************************************************************
  18. */
  19. /* Define to prevent recursive inclusion -------------------------------------*/
  20. #ifndef STM32H7xx_HAL_GPIO_EX_H
  21. #define STM32H7xx_HAL_GPIO_EX_H
  22. #ifdef __cplusplus
  23. extern "C" {
  24. #endif
  25. /* Includes ------------------------------------------------------------------*/
  26. #include "stm32h7xx_hal_def.h"
  27. /** @addtogroup STM32H7xx_HAL_Driver
  28. * @{
  29. */
  30. /** @addtogroup GPIOEx GPIOEx
  31. * @{
  32. */
  33. /* Exported types ------------------------------------------------------------*/
  34. /* Exported constants --------------------------------------------------------*/
  35. /** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants
  36. * @{
  37. */
  38. /** @defgroup GPIO_Alternate_function_selection GPIO Alternate Function Selection
  39. * @{
  40. */
  41. /**
  42. * @brief AF 0 selection
  43. */
  44. #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
  45. #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
  46. #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
  47. #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */
  48. #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
  49. #if defined (PWR_CPUCR_PDDS_D2) /* PWR D1 and D2 domains exists */
  50. #define GPIO_AF0_C1DSLEEP ((uint8_t)0x00) /* Cortex-M7 Deep Sleep Alternate Function mapping : available on STM32H7 Rev.B and above */
  51. #define GPIO_AF0_C1SLEEP ((uint8_t)0x00) /* Cortex-M7 Sleep Alternate Function mapping : available on STM32H7 Rev.B and above */
  52. #define GPIO_AF0_D1PWREN ((uint8_t)0x00) /* Domain 1 PWR enable Alternate Function mapping : available on STM32H7 Rev.B and above */
  53. #define GPIO_AF0_D2PWREN ((uint8_t)0x00) /* Domain 2 PWR enable Alternate Function mapping : available on STM32H7 Rev.B and above */
  54. #if defined(DUAL_CORE)
  55. #define GPIO_AF0_C2DSLEEP ((uint8_t)0x00) /* Cortex-M4 Deep Sleep Alternate Function mapping : available on STM32H7 Rev.B and above */
  56. #define GPIO_AF0_C2SLEEP ((uint8_t)0x00) /* Cortex-M4 Sleep Alternate Function mapping : available on STM32H7 Rev.B and above */
  57. #endif /* DUAL_CORE */
  58. #endif /* PWR_CPUCR_PDDS_D2 */
  59. /**
  60. * @brief AF 1 selection
  61. */
  62. #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
  63. #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
  64. #define GPIO_AF1_TIM16 ((uint8_t)0x01) /* TIM16 Alternate Function mapping */
  65. #define GPIO_AF1_TIM17 ((uint8_t)0x01) /* TIM17 Alternate Function mapping */
  66. #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
  67. #if defined(HRTIM1)
  68. #define GPIO_AF1_HRTIM1 ((uint8_t)0x01) /* HRTIM1 Alternate Function mapping */
  69. #endif /* HRTIM1 */
  70. /**
  71. * @brief AF 2 selection
  72. */
  73. #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
  74. #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
  75. #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
  76. #define GPIO_AF2_TIM12 ((uint8_t)0x02) /* TIM12 Alternate Function mapping */
  77. #define GPIO_AF2_SAI1 ((uint8_t)0x02) /* SAI1 Alternate Function mapping */
  78. #if defined(HRTIM1)
  79. #define GPIO_AF2_HRTIM1 ((uint8_t)0x02) /* HRTIM1 Alternate Function mapping */
  80. #endif /* HRTIM1 */
  81. #define GPIO_AF2_TIM15 ((uint8_t)0x02) /* TIM15 Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx */
  82. /**
  83. * @brief AF 3 selection
  84. */
  85. #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
  86. #define GPIO_AF3_LPTIM2 ((uint8_t)0x03) /* LPTIM2 Alternate Function mapping */
  87. #define GPIO_AF3_DFSDM1 ((uint8_t)0x03) /* DFSDM Alternate Function mapping */
  88. #define GPIO_AF3_LPTIM3 ((uint8_t)0x03) /* LPTIM3 Alternate Function mapping */
  89. #define GPIO_AF3_LPTIM4 ((uint8_t)0x03) /* LPTIM4 Alternate Function mapping */
  90. #define GPIO_AF3_LPTIM5 ((uint8_t)0x03) /* LPTIM5 Alternate Function mapping */
  91. #define GPIO_AF3_LPUART ((uint8_t)0x03) /* LPUART Alternate Function mapping */
  92. #if defined(OCTOSPIM)
  93. #define GPIO_AF3_OCTOSPIM_P1 ((uint8_t)0x03) /* OCTOSPI Manager Port 1 Alternate Function mapping */
  94. #define GPIO_AF3_OCTOSPIM_P2 ((uint8_t)0x03) /* OCTOSPI Manager Port 2 Alternate Function mapping */
  95. #endif /* OCTOSPIM */
  96. #if defined(HRTIM1)
  97. #define GPIO_AF3_HRTIM1 ((uint8_t)0x03) /* HRTIM1 Alternate Function mapping */
  98. #endif /* HRTIM1 */
  99. /**
  100. * @brief AF 4 selection
  101. */
  102. #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
  103. #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
  104. #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
  105. #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */
  106. #define GPIO_AF4_TIM15 ((uint8_t)0x04) /* TIM15 Alternate Function mapping */
  107. #define GPIO_AF4_CEC ((uint8_t)0x04) /* CEC Alternate Function mapping */
  108. #define GPIO_AF4_LPTIM2 ((uint8_t)0x04) /* LPTIM2 Alternate Function mapping */
  109. #define GPIO_AF4_USART1 ((uint8_t)0x04) /* USART1 Alternate Function mapping */
  110. #define GPIO_AF4_DFSDM1 ((uint8_t)0x04) /* DFSDM Alternate Function mapping */
  111. #if defined(DFSDM2_BASE)
  112. #define GPIO_AF4_DFSDM2 ((uint8_t)0x04) /* DFSDM2 Alternate Function mapping */
  113. #endif /* DFSDM2_BASE */
  114. #if defined(PSSI)
  115. #define GPIO_AF4_PSSI ((uint8_t)0x04) /* PSSI Alternate Function mapping */
  116. #endif /* PSSI */
  117. /**
  118. * @brief AF 5 selection
  119. */
  120. #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
  121. #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
  122. #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3 Alternate Function mapping */
  123. #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */
  124. #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */
  125. #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */
  126. #define GPIO_AF5_CEC ((uint8_t)0x05) /* CEC Alternate Function mapping */
  127. /**
  128. * @brief AF 6 selection
  129. */
  130. #define GPIO_AF6_SPI2 ((uint8_t)0x06) /* SPI2 Alternate Function mapping */
  131. #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
  132. #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */
  133. #define GPIO_AF6_I2C4 ((uint8_t)0x06) /* I2C4 Alternate Function mapping */
  134. #define GPIO_AF6_DFSDM1 ((uint8_t)0x06) /* DFSDM Alternate Function mapping */
  135. #define GPIO_AF6_UART4 ((uint8_t)0x06) /* UART4 Alternate Function mapping */
  136. #if defined(DFSDM2_BASE)
  137. #define GPIO_AF6_DFSDM2 ((uint8_t)0x06) /* DFSDM2 Alternate Function mapping */
  138. #endif /* DFSDM2_BASE */
  139. #if defined(SAI3)
  140. #define GPIO_AF6_SAI3 ((uint8_t)0x06) /* SAI3 Alternate Function mapping */
  141. #endif /* SAI3 */
  142. #if defined(OCTOSPIM)
  143. #define GPIO_AF6_OCTOSPIM_P1 ((uint8_t)0x06) /* OCTOSPI Manager Port 1 Alternate Function mapping */
  144. #endif /* OCTOSPIM */
  145. /**
  146. * @brief AF 7 selection
  147. */
  148. #define GPIO_AF7_SPI2 ((uint8_t)0x07) /* SPI2 Alternate Function mapping */
  149. #define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3 Alternate Function mapping */
  150. #define GPIO_AF7_SPI6 ((uint8_t)0x07) /* SPI6 Alternate Function mapping */
  151. #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
  152. #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
  153. #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
  154. #define GPIO_AF7_USART6 ((uint8_t)0x07) /* USART6 Alternate Function mapping */
  155. #define GPIO_AF7_UART7 ((uint8_t)0x07) /* UART7 Alternate Function mapping */
  156. #define GPIO_AF7_DFSDM1 ((uint8_t)0x07) /* DFSDM Alternate Function mapping */
  157. #define GPIO_AF7_SDMMC1 ((uint8_t)0x07) /* SDMMC1 Alternate Function mapping */
  158. /**
  159. * @brief AF 8 selection
  160. */
  161. #define GPIO_AF8_SPI6 ((uint8_t)0x08) /* SPI6 Alternate Function mapping */
  162. #define GPIO_AF8_SAI2 ((uint8_t)0x08) /* SAI2 Alternate Function mapping */
  163. #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
  164. #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
  165. #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */
  166. #define GPIO_AF8_SPDIF ((uint8_t)0x08) /* SPDIF Alternate Function mapping */
  167. #define GPIO_AF8_LPUART ((uint8_t)0x08) /* LPUART Alternate Function mapping */
  168. #define GPIO_AF8_SDMMC1 ((uint8_t)0x08) /* SDMMC1 Alternate Function mapping */
  169. #if defined(SAI4)
  170. #define GPIO_AF8_SAI4 ((uint8_t)0x08) /* SAI4 Alternate Function mapping */
  171. #endif /* SAI4 */
  172. /**
  173. * @brief AF 9 selection
  174. */
  175. #define GPIO_AF9_FDCAN1 ((uint8_t)0x09) /* FDCAN1 Alternate Function mapping */
  176. #define GPIO_AF9_FDCAN2 ((uint8_t)0x09) /* FDCAN2 Alternate Function mapping */
  177. #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */
  178. #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */
  179. #define GPIO_AF9_SDMMC2 ((uint8_t)0x09) /* SDMMC2 Alternate Function mapping */
  180. #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LTDC Alternate Function mapping */
  181. #define GPIO_AF9_SPDIF ((uint8_t)0x09) /* SPDIF Alternate Function mapping */
  182. #define GPIO_AF9_FMC ((uint8_t)0x09) /* FMC Alternate Function mapping */
  183. #if defined(QUADSPI)
  184. #define GPIO_AF9_QUADSPI ((uint8_t)0x09) /* QUADSPI Alternate Function mapping */
  185. #endif /* QUADSPI */
  186. #if defined(SAI4)
  187. #define GPIO_AF9_SAI4 ((uint8_t)0x09) /* SAI4 Alternate Function mapping */
  188. #endif /* SAI4 */
  189. #if defined(OCTOSPIM)
  190. #define GPIO_AF9_OCTOSPIM_P1 ((uint8_t)0x09) /* OCTOSPI Manager Port 1 Alternate Function mapping */
  191. #define GPIO_AF9_OCTOSPIM_P2 ((uint8_t)0x09) /* OCTOSPI Manager Port 2 Alternate Function mapping */
  192. #endif /* OCTOSPIM */
  193. /**
  194. * @brief AF 10 selection
  195. */
  196. #define GPIO_AF10_SAI2 ((uint8_t)0x0A) /* SAI2 Alternate Function mapping */
  197. #define GPIO_AF10_SDMMC2 ((uint8_t)0x0A) /* SDMMC2 Alternate Function mapping */
  198. #if defined(USB2_OTG_FS)
  199. #define GPIO_AF10_OTG2_FS ((uint8_t)0x0A) /* OTG2_FS Alternate Function mapping */
  200. #endif /*USB2_OTG_FS*/
  201. #define GPIO_AF10_COMP1 ((uint8_t)0x0A) /* COMP1 Alternate Function mapping */
  202. #define GPIO_AF10_COMP2 ((uint8_t)0x0A) /* COMP2 Alternate Function mapping */
  203. #if defined(LTDC)
  204. #define GPIO_AF10_LTDC ((uint8_t)0x0A) /* LTDC Alternate Function mapping */
  205. #endif /*LTDC*/
  206. #define GPIO_AF10_CRS_SYNC ((uint8_t)0x0A) /* CRS Sync Alternate Function mapping : available on STM32H7 Rev.B and above */
  207. #if defined(QUADSPI)
  208. #define GPIO_AF10_QUADSPI ((uint8_t)0x0A) /* QUADSPI Alternate Function mapping */
  209. #endif /* QUADSPI */
  210. #if defined(SAI4)
  211. #define GPIO_AF10_SAI4 ((uint8_t)0x0A) /* SAI4 Alternate Function mapping */
  212. #endif /* SAI4 */
  213. #if !defined(USB2_OTG_FS)
  214. #define GPIO_AF10_OTG1_FS ((uint8_t)0x0A) /* OTG1_FS Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx */
  215. #endif /* !USB2_OTG_FS */
  216. #define GPIO_AF10_OTG1_HS ((uint8_t)0x0A) /* OTG1_HS Alternate Function mapping */
  217. #if defined(OCTOSPIM)
  218. #define GPIO_AF10_OCTOSPIM_P1 ((uint8_t)0x0A) /* OCTOSPI Manager Port 1 Alternate Function mapping */
  219. #endif /* OCTOSPIM */
  220. #define GPIO_AF10_TIM8 ((uint8_t)0x0A) /* TIM8 Alternate Function mapping */
  221. /**
  222. * @brief AF 11 selection
  223. */
  224. #define GPIO_AF11_SWP ((uint8_t)0x0B) /* SWP Alternate Function mapping */
  225. #define GPIO_AF11_MDIOS ((uint8_t)0x0B) /* MDIOS Alternate Function mapping */
  226. #define GPIO_AF11_UART7 ((uint8_t)0x0B) /* UART7 Alternate Function mapping */
  227. #define GPIO_AF11_SDMMC2 ((uint8_t)0x0B) /* SDMMC2 Alternate Function mapping */
  228. #define GPIO_AF11_DFSDM1 ((uint8_t)0x0B) /* DFSDM1 Alternate Function mapping */
  229. #define GPIO_AF11_COMP1 ((uint8_t)0x0B) /* COMP1 Alternate Function mapping */
  230. #define GPIO_AF11_COMP2 ((uint8_t)0x0B) /* COMP2 Alternate Function mapping */
  231. #define GPIO_AF11_TIM1 ((uint8_t)0x0B) /* TIM1 Alternate Function mapping */
  232. #define GPIO_AF11_TIM8 ((uint8_t)0x0B) /* TIM8 Alternate Function mapping */
  233. #define GPIO_AF11_I2C4 ((uint8_t)0x0B) /* I2C4 Alternate Function mapping */
  234. #if defined(DFSDM2_BASE)
  235. #define GPIO_AF11_DFSDM2 ((uint8_t)0x0B) /* DFSDM2 Alternate Function mapping */
  236. #endif /* DFSDM2_BASE */
  237. #if defined(USART10)
  238. #define GPIO_AF11_USART10 ((uint8_t)0x0B) /* USART10 Alternate Function mapping */
  239. #endif /* USART10 */
  240. #if defined(UART9)
  241. #define GPIO_AF11_UART9 ((uint8_t)0x0B) /* UART9 Alternate Function mapping */
  242. #endif /* UART9 */
  243. #if defined(ETH)
  244. #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETH Alternate Function mapping */
  245. #endif /* ETH */
  246. #if defined(LTDC)
  247. #define GPIO_AF11_LTDC ((uint8_t)0x0B) /* LTDC Alternate Function mapping : available on STM32H7A3xxx/STM32H7B3xxx/STM32H7B0xxx */
  248. #endif /*LTDC*/
  249. #if defined(OCTOSPIM)
  250. #define GPIO_AF11_OCTOSPIM_P1 ((uint8_t)0x0B) /* OCTOSPI Manager Port 1 Alternate Function mapping */
  251. #endif /* OCTOSPIM */
  252. /**
  253. * @brief AF 12 selection
  254. */
  255. #define GPIO_AF12_FMC ((uint8_t)0x0C) /* FMC Alternate Function mapping */
  256. #define GPIO_AF12_SDMMC1 ((uint8_t)0x0C) /* SDMMC1 Alternate Function mapping */
  257. #define GPIO_AF12_MDIOS ((uint8_t)0x0C) /* MDIOS Alternate Function mapping */
  258. #define GPIO_AF12_COMP1 ((uint8_t)0x0C) /* COMP1 Alternate Function mapping */
  259. #define GPIO_AF12_COMP2 ((uint8_t)0x0C) /* COMP2 Alternate Function mapping */
  260. #define GPIO_AF12_TIM1 ((uint8_t)0x0C) /* TIM1 Alternate Function mapping */
  261. #define GPIO_AF12_TIM8 ((uint8_t)0x0C) /* TIM8 Alternate Function mapping */
  262. #if defined(LTDC)
  263. #define GPIO_AF12_LTDC ((uint8_t)0x0C) /* LTDC Alternate Function mapping */
  264. #endif /*LTDC*/
  265. #if defined(USB2_OTG_FS)
  266. #define GPIO_AF12_OTG1_FS ((uint8_t)0x0C) /* OTG1_FS Alternate Function mapping */
  267. #endif /* USB2_OTG_FS */
  268. /**
  269. * @brief AF 13 selection
  270. */
  271. #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */
  272. #define GPIO_AF13_COMP1 ((uint8_t)0x0D) /* COMP1 Alternate Function mapping */
  273. #define GPIO_AF13_COMP2 ((uint8_t)0x0D) /* COMP2 Alternate Function mapping */
  274. #if defined(LTDC)
  275. #define GPIO_AF13_LTDC ((uint8_t)0x0D) /* LTDC Alternate Function mapping */
  276. #endif /*LTDC*/
  277. #if defined(DSI)
  278. #define GPIO_AF13_DSI ((uint8_t)0x0D) /* DSI Alternate Function mapping */
  279. #endif /* DSI */
  280. #if defined(PSSI)
  281. #define GPIO_AF13_PSSI ((uint8_t)0x0D) /* PSSI Alternate Function mapping */
  282. #endif /* PSSI */
  283. #define GPIO_AF13_TIM1 ((uint8_t)0x0D) /* TIM1 Alternate Function mapping */
  284. #define GPIO_AF13_TIM8 ((uint8_t)0x0D) /* TIM8 Alternate Function mapping : available on STM32H74xxx/STM32H75xxx */
  285. /**
  286. * @brief AF 14 selection
  287. */
  288. #define GPIO_AF14_LTDC ((uint8_t)0x0E) /* LTDC Alternate Function mapping */
  289. #define GPIO_AF14_UART5 ((uint8_t)0x0E) /* UART5 Alternate Function mapping */
  290. /**
  291. * @brief AF 15 selection
  292. */
  293. #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
  294. #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
  295. /**
  296. * @}
  297. */
  298. /**
  299. * @}
  300. */
  301. /* Exported macro ------------------------------------------------------------*/
  302. /** @defgroup GPIOEx_Exported_Macros GPIO Exported Macros
  303. * @{
  304. */
  305. /**
  306. * @}
  307. */
  308. /* Exported functions --------------------------------------------------------*/
  309. /** @defgroup GPIOEx_Exported_Functions GPIO Exported Functions
  310. * @{
  311. */
  312. /**
  313. * @}
  314. */
  315. /* Private types -------------------------------------------------------------*/
  316. /* Private variables ---------------------------------------------------------*/
  317. /* Private constants ---------------------------------------------------------*/
  318. /** @defgroup GPIOEx_Private_Constants GPIO Private Constants
  319. * @{
  320. */
  321. /**
  322. * @brief GPIO pin available on the platform
  323. */
  324. /* Defines the available pins per GPIOs */
  325. #define GPIOA_PIN_AVAILABLE GPIO_PIN_All
  326. #define GPIOB_PIN_AVAILABLE GPIO_PIN_All
  327. #define GPIOC_PIN_AVAILABLE GPIO_PIN_All
  328. #define GPIOD_PIN_AVAILABLE GPIO_PIN_All
  329. #define GPIOE_PIN_AVAILABLE GPIO_PIN_All
  330. #define GPIOF_PIN_AVAILABLE GPIO_PIN_All
  331. #define GPIOG_PIN_AVAILABLE GPIO_PIN_All
  332. #define GPIOI_PIN_AVAILABLE GPIO_PIN_All
  333. #define GPIOJ_PIN_AVAILABLE GPIO_PIN_All
  334. #define GPIOH_PIN_AVAILABLE GPIO_PIN_All
  335. #define GPIOK_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_3 | GPIO_PIN_4 | \
  336. GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7)
  337. /**
  338. * @}
  339. */
  340. /* Private macros ------------------------------------------------------------*/
  341. /** @defgroup GPIOEx_Private_Macros GPIO Private Macros
  342. * @{
  343. */
  344. /** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index
  345. * @{
  346. */
  347. #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0UL :\
  348. ((__GPIOx__) == (GPIOB))? 1UL :\
  349. ((__GPIOx__) == (GPIOC))? 2UL :\
  350. ((__GPIOx__) == (GPIOD))? 3UL :\
  351. ((__GPIOx__) == (GPIOE))? 4UL :\
  352. ((__GPIOx__) == (GPIOF))? 5UL :\
  353. ((__GPIOx__) == (GPIOG))? 6UL :\
  354. ((__GPIOx__) == (GPIOH))? 7UL :\
  355. ((__GPIOx__) == (GPIOI))? 8UL :\
  356. ((__GPIOx__) == (GPIOJ))? 9UL : 10UL)
  357. /**
  358. * @}
  359. */
  360. /** @defgroup GPIOEx_IS_Alternat_function_selection GPIO Check Alternate Function
  361. * @{
  362. */
  363. /**
  364. * @}
  365. */
  366. /**
  367. * @}
  368. */
  369. /* Private functions ---------------------------------------------------------*/
  370. /** @defgroup GPIOEx_Private_Functions GPIO Private Functions
  371. * @{
  372. */
  373. /**
  374. * @}
  375. */
  376. /**
  377. * @}
  378. */
  379. /**
  380. * @}
  381. */
  382. #ifdef __cplusplus
  383. }
  384. #endif
  385. #endif /* STM32H7xx_HAL_GPIO_EX_H */
  386. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/