1 | /** |
---|
2 | ****************************************************************************** |
---|
3 | * @file stm32f7xx_hal_gpio_ex.h |
---|
4 | * @author MCD Application Team |
---|
5 | * @version V1.0.1 |
---|
6 | * @date 25-June-2015 |
---|
7 | * @brief Header file of GPIO HAL Extension module. |
---|
8 | ****************************************************************************** |
---|
9 | * @attention |
---|
10 | * |
---|
11 | * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> |
---|
12 | * |
---|
13 | * Redistribution and use in source and binary forms, with or without modification, |
---|
14 | * are permitted provided that the following conditions are met: |
---|
15 | * 1. Redistributions of source code must retain the above copyright notice, |
---|
16 | * this list of conditions and the following disclaimer. |
---|
17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
---|
18 | * this list of conditions and the following disclaimer in the documentation |
---|
19 | * and/or other materials provided with the distribution. |
---|
20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
---|
21 | * may be used to endorse or promote products derived from this software |
---|
22 | * without specific prior written permission. |
---|
23 | * |
---|
24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
---|
25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
---|
26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
---|
27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
---|
28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
---|
29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
---|
30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
---|
31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
---|
32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
---|
33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
34 | * |
---|
35 | ****************************************************************************** |
---|
36 | */ |
---|
37 | |
---|
38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
---|
39 | #ifndef __STM32F7xx_HAL_GPIO_EX_H |
---|
40 | #define __STM32F7xx_HAL_GPIO_EX_H |
---|
41 | |
---|
42 | #ifdef __cplusplus |
---|
43 | extern "C" { |
---|
44 | #endif |
---|
45 | |
---|
46 | /* Includes ------------------------------------------------------------------*/ |
---|
47 | #include "stm32f7xx_hal_def.h" |
---|
48 | |
---|
49 | /** @addtogroup STM32F7xx_HAL_Driver |
---|
50 | * @{ |
---|
51 | */ |
---|
52 | |
---|
53 | /** @defgroup GPIOEx GPIOEx |
---|
54 | * @{ |
---|
55 | */ |
---|
56 | |
---|
57 | /* Exported types ------------------------------------------------------------*/ |
---|
58 | |
---|
59 | /* Exported constants --------------------------------------------------------*/ |
---|
60 | /** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants |
---|
61 | * @{ |
---|
62 | */ |
---|
63 | |
---|
64 | /** @defgroup GPIO_Alternate_function_selection GPIO Alternate Function Selection |
---|
65 | * @{ |
---|
66 | */ |
---|
67 | |
---|
68 | /** |
---|
69 | * @brief AF 0 selection |
---|
70 | */ |
---|
71 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ |
---|
72 | #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
---|
73 | #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
---|
74 | #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ |
---|
75 | |
---|
76 | /** |
---|
77 | * @brief AF 1 selection |
---|
78 | */ |
---|
79 | #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ |
---|
80 | #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ |
---|
81 | |
---|
82 | /** |
---|
83 | * @brief AF 2 selection |
---|
84 | */ |
---|
85 | #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ |
---|
86 | #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ |
---|
87 | #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ |
---|
88 | |
---|
89 | /** |
---|
90 | * @brief AF 3 selection |
---|
91 | */ |
---|
92 | #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ |
---|
93 | #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */ |
---|
94 | #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */ |
---|
95 | #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */ |
---|
96 | #define GPIO_AF3_LPTIM1 ((uint8_t)0x03) /* LPTIM1 Alternate Function mapping */ |
---|
97 | #define GPIO_AF3_CEC ((uint8_t)0x03) /* CEC Alternate Function mapping */ |
---|
98 | |
---|
99 | |
---|
100 | /** |
---|
101 | * @brief AF 4 selection |
---|
102 | */ |
---|
103 | #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ |
---|
104 | #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ |
---|
105 | #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ |
---|
106 | #define GPIO_AF4_I2C4 ((uint8_t)0x04) /* I2C4 Alternate Function mapping */ |
---|
107 | #define GPIO_AF4_CEC ((uint8_t)0x04) /* CEC Alternate Function mapping */ |
---|
108 | |
---|
109 | /** |
---|
110 | * @brief AF 5 selection |
---|
111 | */ |
---|
112 | #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ |
---|
113 | #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */ |
---|
114 | #define GPIO_AF5_SPI3 ((uint8_t)0x05) /* SPI3/I2S3 Alternate Function mapping */ |
---|
115 | #define GPIO_AF5_SPI4 ((uint8_t)0x05) /* SPI4 Alternate Function mapping */ |
---|
116 | #define GPIO_AF5_SPI5 ((uint8_t)0x05) /* SPI5 Alternate Function mapping */ |
---|
117 | #define GPIO_AF5_SPI6 ((uint8_t)0x05) /* SPI6 Alternate Function mapping */ |
---|
118 | |
---|
119 | /** |
---|
120 | * @brief AF 6 selection |
---|
121 | */ |
---|
122 | #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */ |
---|
123 | #define GPIO_AF6_SAI1 ((uint8_t)0x06) /* SAI1 Alternate Function mapping */ |
---|
124 | |
---|
125 | /** |
---|
126 | * @brief AF 7 selection |
---|
127 | */ |
---|
128 | #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ |
---|
129 | #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ |
---|
130 | #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ |
---|
131 | #define GPIO_AF7_UART5 ((uint8_t)0x07) /* UART5 Alternate Function mapping */ |
---|
132 | #define GPIO_AF7_SPDIFRX ((uint8_t)0x07) /* SPDIF-RX Alternate Function mapping */ |
---|
133 | #define GPIO_AF7_SPI2 ((uint8_t)0x07) /* SPI2 Alternate Function mapping */ |
---|
134 | #define GPIO_AF7_SPI3 ((uint8_t)0x07) /* SPI3 Alternate Function mapping */ |
---|
135 | |
---|
136 | /** |
---|
137 | * @brief AF 8 selection |
---|
138 | */ |
---|
139 | #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ |
---|
140 | #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ |
---|
141 | #define GPIO_AF8_USART6 ((uint8_t)0x08) /* USART6 Alternate Function mapping */ |
---|
142 | #define GPIO_AF8_UART7 ((uint8_t)0x08) /* UART7 Alternate Function mapping */ |
---|
143 | #define GPIO_AF8_UART8 ((uint8_t)0x08) /* UART8 Alternate Function mapping */ |
---|
144 | #define GPIO_AF8_SPDIFRX ((uint8_t)0x08) /* SPIDIF-RX Alternate Function mapping */ |
---|
145 | #define GPIO_AF8_SAI2 ((uint8_t)0x08) /* SAI2 Alternate Function mapping */ |
---|
146 | |
---|
147 | |
---|
148 | /** |
---|
149 | * @brief AF 9 selection |
---|
150 | */ |
---|
151 | #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ |
---|
152 | #define GPIO_AF9_CAN2 ((uint8_t)0x09) /* CAN2 Alternate Function mapping */ |
---|
153 | #define GPIO_AF9_TIM12 ((uint8_t)0x09) /* TIM12 Alternate Function mapping */ |
---|
154 | #define GPIO_AF9_TIM13 ((uint8_t)0x09) /* TIM13 Alternate Function mapping */ |
---|
155 | #define GPIO_AF9_TIM14 ((uint8_t)0x09) /* TIM14 Alternate Function mapping */ |
---|
156 | #define GPIO_AF9_QUADSPI ((uint8_t)0x09) /* QUADSPI Alternate Function mapping */ |
---|
157 | #if defined(STM32F756xx) || defined(STM32F746xx) |
---|
158 | #define GPIO_AF9_LTDC ((uint8_t)0x09) /* LCD-TFT Alternate Function mapping */ |
---|
159 | #endif /* STM32F756xx || STM32F746xx */ |
---|
160 | /** |
---|
161 | * @brief AF 10 selection |
---|
162 | */ |
---|
163 | #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ |
---|
164 | #define GPIO_AF10_OTG_HS ((uint8_t)0xA) /* OTG_HS Alternate Function mapping */ |
---|
165 | #define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */ |
---|
166 | #define GPIO_AF10_SAI2 ((uint8_t)0xA) /* SAI2 Alternate Function mapping */ |
---|
167 | |
---|
168 | /** |
---|
169 | * @brief AF 11 selection |
---|
170 | */ |
---|
171 | #define GPIO_AF11_ETH ((uint8_t)0x0B) /* ETHERNET Alternate Function mapping */ |
---|
172 | |
---|
173 | /** |
---|
174 | * @brief AF 12 selection |
---|
175 | */ |
---|
176 | #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ |
---|
177 | #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xC) /* OTG HS configured in FS, Alternate Function mapping */ |
---|
178 | #define GPIO_AF12_SDMMC1 ((uint8_t)0xC) /* SDMMC1 Alternate Function mapping */ |
---|
179 | |
---|
180 | /** |
---|
181 | * @brief AF 13 selection |
---|
182 | */ |
---|
183 | #define GPIO_AF13_DCMI ((uint8_t)0x0D) /* DCMI Alternate Function mapping */ |
---|
184 | |
---|
185 | #if defined(STM32F756xx) || defined(STM32F746xx) |
---|
186 | /** |
---|
187 | * @brief AF 14 selection |
---|
188 | */ |
---|
189 | #define GPIO_AF14_LTDC ((uint8_t)0x0E) /* LCD-TFT Alternate Function mapping */ |
---|
190 | #endif /* STM32F756xx || STM32F746xx */ |
---|
191 | /** |
---|
192 | * @brief AF 15 selection |
---|
193 | */ |
---|
194 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ |
---|
195 | |
---|
196 | |
---|
197 | /** |
---|
198 | * @} |
---|
199 | */ |
---|
200 | |
---|
201 | /** |
---|
202 | * @} |
---|
203 | */ |
---|
204 | |
---|
205 | /* Exported macro ------------------------------------------------------------*/ |
---|
206 | /** @defgroup GPIOEx_Exported_Macros GPIO Exported Macros |
---|
207 | * @{ |
---|
208 | */ |
---|
209 | /** |
---|
210 | * @} |
---|
211 | */ |
---|
212 | |
---|
213 | /* Exported functions --------------------------------------------------------*/ |
---|
214 | /** @defgroup GPIOEx_Exported_Functions GPIO Exported Functions |
---|
215 | * @{ |
---|
216 | */ |
---|
217 | /** |
---|
218 | * @} |
---|
219 | */ |
---|
220 | /* Private types -------------------------------------------------------------*/ |
---|
221 | /* Private variables ---------------------------------------------------------*/ |
---|
222 | /* Private constants ---------------------------------------------------------*/ |
---|
223 | /** @defgroup GPIOEx_Private_Constants GPIO Private Constants |
---|
224 | * @{ |
---|
225 | */ |
---|
226 | |
---|
227 | /** |
---|
228 | * @brief GPIO pin available on the platform |
---|
229 | */ |
---|
230 | /* Defines the available pins per GPIOs */ |
---|
231 | #define GPIOA_PIN_AVAILABLE GPIO_PIN_All |
---|
232 | #define GPIOB_PIN_AVAILABLE GPIO_PIN_All |
---|
233 | #define GPIOC_PIN_AVAILABLE GPIO_PIN_All |
---|
234 | #define GPIOD_PIN_AVAILABLE GPIO_PIN_All |
---|
235 | #define GPIOE_PIN_AVAILABLE GPIO_PIN_All |
---|
236 | #define GPIOF_PIN_AVAILABLE GPIO_PIN_All |
---|
237 | #define GPIOG_PIN_AVAILABLE GPIO_PIN_All |
---|
238 | #define GPIOI_PIN_AVAILABLE GPIO_PIN_All |
---|
239 | #define GPIOJ_PIN_AVAILABLE GPIO_PIN_All |
---|
240 | #define GPIOH_PIN_AVAILABLE GPIO_PIN_All |
---|
241 | #define GPIOK_PIN_AVAILABLE (GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_3 | GPIO_PIN_4 | \ |
---|
242 | GPIO_PIN_5 | GPIO_PIN_6 | GPIO_PIN_7) |
---|
243 | |
---|
244 | /** |
---|
245 | * @} |
---|
246 | */ |
---|
247 | |
---|
248 | /* Private macros ------------------------------------------------------------*/ |
---|
249 | /** @defgroup GPIOEx_Private_Macros GPIO Private Macros |
---|
250 | * @{ |
---|
251 | */ |
---|
252 | /** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index |
---|
253 | * @{ |
---|
254 | */ |
---|
255 | #define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\ |
---|
256 | ((__GPIOx__) == (GPIOB))? 1U :\ |
---|
257 | ((__GPIOx__) == (GPIOC))? 2U :\ |
---|
258 | ((__GPIOx__) == (GPIOD))? 3U :\ |
---|
259 | ((__GPIOx__) == (GPIOE))? 4U :\ |
---|
260 | ((__GPIOx__) == (GPIOF))? 5U :\ |
---|
261 | ((__GPIOx__) == (GPIOG))? 6U :\ |
---|
262 | ((__GPIOx__) == (GPIOH))? 7U :\ |
---|
263 | ((__GPIOx__) == (GPIOI))? 8U :\ |
---|
264 | ((__GPIOx__) == (GPIOJ))? 9U : 10U) |
---|
265 | /** |
---|
266 | * @} |
---|
267 | */ |
---|
268 | |
---|
269 | #define IS_GPIO_PIN_AVAILABLE(__INSTANCE__,__PIN__) \ |
---|
270 | ((((__INSTANCE__) == GPIOA) && (((__PIN__) & (GPIOA_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOA_PIN_AVAILABLE)) == (GPIOA_PIN_AVAILABLE))) || \ |
---|
271 | (((__INSTANCE__) == GPIOB) && (((__PIN__) & (GPIOB_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOB_PIN_AVAILABLE)) == (GPIOB_PIN_AVAILABLE))) || \ |
---|
272 | (((__INSTANCE__) == GPIOC) && (((__PIN__) & (GPIOC_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOC_PIN_AVAILABLE)) == (GPIOC_PIN_AVAILABLE))) || \ |
---|
273 | (((__INSTANCE__) == GPIOD) && (((__PIN__) & (GPIOD_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOD_PIN_AVAILABLE)) == (GPIOD_PIN_AVAILABLE))) || \ |
---|
274 | (((__INSTANCE__) == GPIOE) && (((__PIN__) & (GPIOE_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOE_PIN_AVAILABLE)) == (GPIOE_PIN_AVAILABLE))) || \ |
---|
275 | (((__INSTANCE__) == GPIOF) && (((__PIN__) & (GPIOF_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOF_PIN_AVAILABLE)) == (GPIOF_PIN_AVAILABLE))) || \ |
---|
276 | (((__INSTANCE__) == GPIOG) && (((__PIN__) & (GPIOG_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOG_PIN_AVAILABLE)) == (GPIOG_PIN_AVAILABLE))) || \ |
---|
277 | (((__INSTANCE__) == GPIOI) && (((__PIN__) & (GPIOI_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOI_PIN_AVAILABLE)) == (GPIOI_PIN_AVAILABLE))) || \ |
---|
278 | (((__INSTANCE__) == GPIOJ) && (((__PIN__) & (GPIOJ_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOJ_PIN_AVAILABLE)) == (GPIOJ_PIN_AVAILABLE))) || \ |
---|
279 | (((__INSTANCE__) == GPIOK) && (((__PIN__) & (GPIOK_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOK_PIN_AVAILABLE)) == (GPIOK_PIN_AVAILABLE))) || \ |
---|
280 | (((__INSTANCE__) == GPIOH) && (((__PIN__) & (GPIOH_PIN_AVAILABLE)) != 0) && (((__PIN__) | (GPIOH_PIN_AVAILABLE)) == (GPIOH_PIN_AVAILABLE)))) |
---|
281 | /** @defgroup GPIOEx_IS_Alternat_function_selection GPIO Check Alternate Function |
---|
282 | * @{ |
---|
283 | */ |
---|
284 | #if defined(STM32F756xx) || defined(STM32F746xx) |
---|
285 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \ |
---|
286 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
---|
287 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \ |
---|
288 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
---|
289 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
---|
290 | ((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \ |
---|
291 | ((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \ |
---|
292 | ((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \ |
---|
293 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
---|
294 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF4_I2C4) || \ |
---|
295 | ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \ |
---|
296 | ((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF5_SPI4) || \ |
---|
297 | ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ |
---|
298 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \ |
---|
299 | ((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \ |
---|
300 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
---|
301 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \ |
---|
302 | ((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \ |
---|
303 | ((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \ |
---|
304 | ((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \ |
---|
305 | ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ |
---|
306 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
---|
307 | ((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM12) || \ |
---|
308 | ((AF) == GPIO_AF9_TIM14) || ((AF) == GPIO_AF9_QUADSPI) || \ |
---|
309 | ((AF) == GPIO_AF9_LTDC) || ((AF) == GPIO_AF10_OTG_FS) || \ |
---|
310 | ((AF) == GPIO_AF10_OTG_HS) || ((AF) == GPIO_AF10_SAI2) || \ |
---|
311 | ((AF) == GPIO_AF10_QUADSPI) || ((AF) == GPIO_AF11_ETH) || \ |
---|
312 | ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDMMC1) || \ |
---|
313 | ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF15_EVENTOUT) || \ |
---|
314 | ((AF) == GPIO_AF13_DCMI) || ((AF) == GPIO_AF14_LTDC)) |
---|
315 | #elif defined(STM32F745xx) |
---|
316 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF1_TIM1) || \ |
---|
317 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
---|
318 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF1_TIM2) || \ |
---|
319 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
---|
320 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
---|
321 | ((AF) == GPIO_AF3_TIM9) || ((AF) == GPIO_AF3_TIM10) || \ |
---|
322 | ((AF) == GPIO_AF3_TIM11) || ((AF) == GPIO_AF3_LPTIM1) || \ |
---|
323 | ((AF) == GPIO_AF3_CEC) || ((AF) == GPIO_AF4_CEC) || \ |
---|
324 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
---|
325 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF4_I2C4) || \ |
---|
326 | ((AF) == GPIO_AF5_SPI1) || ((AF) == GPIO_AF5_SPI2) || \ |
---|
327 | ((AF) == GPIO_AF5_SPI3) || ((AF) == GPIO_AF5_SPI4) || \ |
---|
328 | ((AF) == GPIO_AF5_SPI5) || ((AF) == GPIO_AF5_SPI6) || \ |
---|
329 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF6_SAI1) || \ |
---|
330 | ((AF) == GPIO_AF7_SPI3) || ((AF) == GPIO_AF7_SPI2) || \ |
---|
331 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
---|
332 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF7_UART5) || \ |
---|
333 | ((AF) == GPIO_AF7_SPDIFRX) || ((AF) == GPIO_AF8_SPDIFRX) || \ |
---|
334 | ((AF) == GPIO_AF8_SAI2) || ((AF) == GPIO_AF8_USART6) || \ |
---|
335 | ((AF) == GPIO_AF8_UART4) || ((AF) == GPIO_AF8_UART5) || \ |
---|
336 | ((AF) == GPIO_AF8_UART7) || ((AF) == GPIO_AF8_UART8) || \ |
---|
337 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
---|
338 | ((AF) == GPIO_AF9_TIM12) || ((AF) == GPIO_AF9_TIM12) || \ |
---|
339 | ((AF) == GPIO_AF9_TIM14) || ((AF) == GPIO_AF9_QUADSPI) || \ |
---|
340 | ((AF) == GPIO_AF13_DCMI) || ((AF) == GPIO_AF10_OTG_FS) || \ |
---|
341 | ((AF) == GPIO_AF10_OTG_HS) || ((AF) == GPIO_AF10_SAI2) || \ |
---|
342 | ((AF) == GPIO_AF10_QUADSPI) || ((AF) == GPIO_AF11_ETH) || \ |
---|
343 | ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDMMC1) || \ |
---|
344 | ((AF) == GPIO_AF12_FMC) || ((AF) == GPIO_AF15_EVENTOUT)) |
---|
345 | #endif /* STM32F756xx || STM32F746xx */ |
---|
346 | /** |
---|
347 | * @} |
---|
348 | */ |
---|
349 | |
---|
350 | /** |
---|
351 | * @} |
---|
352 | */ |
---|
353 | |
---|
354 | /* Private functions ---------------------------------------------------------*/ |
---|
355 | /** @defgroup GPIOEx_Private_Functions GPIO Private Functions |
---|
356 | * @{ |
---|
357 | */ |
---|
358 | |
---|
359 | /** |
---|
360 | * @} |
---|
361 | */ |
---|
362 | |
---|
363 | /** |
---|
364 | * @} |
---|
365 | */ |
---|
366 | |
---|
367 | /** |
---|
368 | * @} |
---|
369 | */ |
---|
370 | |
---|
371 | #ifdef __cplusplus |
---|
372 | } |
---|
373 | #endif |
---|
374 | |
---|
375 | #endif /* __STM32F7xx_HAL_GPIO_EX_H */ |
---|
376 | |
---|
377 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |
---|