Fork of the official mbed C/C SDK provides the software platform and libraries to build your applications for RenBED.

Dependents:   1-RenBuggyTimed RenBED_RGB RenBED_RGB_PWM RenBED_RGB

Fork of mbed by mbed official

Committer:
Kojto
Date:
Tue Mar 15 14:34:00 2016 +0000
Revision:
116:c0f6e94411f5
Parent:
115:87f2f5183dfb
Release 116 of the mbed library

Changes:
- new targets - NUCLEO_L073RZ
- fixes to IOTSS BEID platform
- LPC824, LPC1549 and LPC11U68 - fix PWMOut SCT bugs
- STM32F7 - Cube driver
- STM32F4 - add RTC LSI macro, defined as 0
- STM32F3 - fix multiple ADC clock initialization
- retarget - binary mode fix for GCC

Who changed what in which revision?

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