Mouse code for the MacroRat
mbed-dev/targets/TARGET_STM/TARGET_STM32F2/device/stm32f2xx_hal_gpio_ex.h@46:b156ef445742, 2017-06-03 (annotated)
- Committer:
- sahilmgandhi
- Date:
- Sat Jun 03 00:22:44 2017 +0000
- Revision:
- 46:b156ef445742
- Parent:
- 18:6a4db94011d3
Final code for internal battlebot competition.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
sahilmgandhi | 18:6a4db94011d3 | 1 | /** |
sahilmgandhi | 18:6a4db94011d3 | 2 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 3 | * @file stm32f2xx_hal_gpio_ex.h |
sahilmgandhi | 18:6a4db94011d3 | 4 | * @author MCD Application Team |
sahilmgandhi | 18:6a4db94011d3 | 5 | * @version V1.1.3 |
sahilmgandhi | 18:6a4db94011d3 | 6 | * @date 29-June-2016 |
sahilmgandhi | 18:6a4db94011d3 | 7 | * @brief Header file of GPIO HAL Extension module. |
sahilmgandhi | 18:6a4db94011d3 | 8 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 9 | * @attention |
sahilmgandhi | 18:6a4db94011d3 | 10 | * |
sahilmgandhi | 18:6a4db94011d3 | 11 | * <h2><center>© COPYRIGHT(c) 2016 STMicroelectronics</center></h2> |
sahilmgandhi | 18:6a4db94011d3 | 12 | * |
sahilmgandhi | 18:6a4db94011d3 | 13 | * Redistribution and use in source and binary forms, with or without modification, |
sahilmgandhi | 18:6a4db94011d3 | 14 | * are permitted provided that the following conditions are met: |
sahilmgandhi | 18:6a4db94011d3 | 15 | * 1. Redistributions of source code must retain the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 16 | * this list of conditions and the following disclaimer. |
sahilmgandhi | 18:6a4db94011d3 | 17 | * 2. Redistributions in binary form must reproduce the above copyright notice, |
sahilmgandhi | 18:6a4db94011d3 | 18 | * this list of conditions and the following disclaimer in the documentation |
sahilmgandhi | 18:6a4db94011d3 | 19 | * and/or other materials provided with the distribution. |
sahilmgandhi | 18:6a4db94011d3 | 20 | * 3. Neither the name of STMicroelectronics nor the names of its contributors |
sahilmgandhi | 18:6a4db94011d3 | 21 | * may be used to endorse or promote products derived from this software |
sahilmgandhi | 18:6a4db94011d3 | 22 | * without specific prior written permission. |
sahilmgandhi | 18:6a4db94011d3 | 23 | * |
sahilmgandhi | 18:6a4db94011d3 | 24 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
sahilmgandhi | 18:6a4db94011d3 | 25 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
sahilmgandhi | 18:6a4db94011d3 | 26 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
sahilmgandhi | 18:6a4db94011d3 | 27 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
sahilmgandhi | 18:6a4db94011d3 | 28 | * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
sahilmgandhi | 18:6a4db94011d3 | 29 | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
sahilmgandhi | 18:6a4db94011d3 | 30 | * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
sahilmgandhi | 18:6a4db94011d3 | 31 | * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
sahilmgandhi | 18:6a4db94011d3 | 32 | * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
sahilmgandhi | 18:6a4db94011d3 | 33 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
sahilmgandhi | 18:6a4db94011d3 | 34 | * |
sahilmgandhi | 18:6a4db94011d3 | 35 | ****************************************************************************** |
sahilmgandhi | 18:6a4db94011d3 | 36 | */ |
sahilmgandhi | 18:6a4db94011d3 | 37 | |
sahilmgandhi | 18:6a4db94011d3 | 38 | /* Define to prevent recursive inclusion -------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 39 | #ifndef __STM32F2xx_HAL_GPIO_EX_H |
sahilmgandhi | 18:6a4db94011d3 | 40 | #define __STM32F2xx_HAL_GPIO_EX_H |
sahilmgandhi | 18:6a4db94011d3 | 41 | |
sahilmgandhi | 18:6a4db94011d3 | 42 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 43 | extern "C" { |
sahilmgandhi | 18:6a4db94011d3 | 44 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 45 | |
sahilmgandhi | 18:6a4db94011d3 | 46 | /* Includes ------------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 47 | #include "stm32f2xx_hal_def.h" |
sahilmgandhi | 18:6a4db94011d3 | 48 | |
sahilmgandhi | 18:6a4db94011d3 | 49 | /** @addtogroup STM32F2xx_HAL_Driver |
sahilmgandhi | 18:6a4db94011d3 | 50 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 51 | */ |
sahilmgandhi | 18:6a4db94011d3 | 52 | |
sahilmgandhi | 18:6a4db94011d3 | 53 | /** @defgroup GPIOEx GPIOEx |
sahilmgandhi | 18:6a4db94011d3 | 54 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 55 | */ |
sahilmgandhi | 18:6a4db94011d3 | 56 | |
sahilmgandhi | 18:6a4db94011d3 | 57 | /* Exported types ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 58 | /* Exported constants --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 59 | /* Exported constants --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 60 | |
sahilmgandhi | 18:6a4db94011d3 | 61 | /** @defgroup GPIOEx_Exported_Constants GPIO Exported Constants |
sahilmgandhi | 18:6a4db94011d3 | 62 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 63 | */ |
sahilmgandhi | 18:6a4db94011d3 | 64 | |
sahilmgandhi | 18:6a4db94011d3 | 65 | /** @defgroup GPIO_Alternate_function_selection GPIO Alternate function selection |
sahilmgandhi | 18:6a4db94011d3 | 66 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 67 | */ |
sahilmgandhi | 18:6a4db94011d3 | 68 | |
sahilmgandhi | 18:6a4db94011d3 | 69 | /** |
sahilmgandhi | 18:6a4db94011d3 | 70 | * @brief AF 0 selection |
sahilmgandhi | 18:6a4db94011d3 | 71 | */ |
sahilmgandhi | 18:6a4db94011d3 | 72 | #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00U) /* RTC_50Hz Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 73 | #define GPIO_AF0_MCO ((uint8_t)0x00U) /* MCO (MCO1 and MCO2) Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 74 | #define GPIO_AF0_TAMPER ((uint8_t)0x00U) /* TAMPER (TAMPER_1 and TAMPER_2) Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 75 | #define GPIO_AF0_SWJ ((uint8_t)0x00U) /* SWJ (SWD and JTAG) Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 76 | #define GPIO_AF0_TRACE ((uint8_t)0x00U) /* TRACE Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 77 | |
sahilmgandhi | 18:6a4db94011d3 | 78 | /** |
sahilmgandhi | 18:6a4db94011d3 | 79 | * @brief AF 1 selection |
sahilmgandhi | 18:6a4db94011d3 | 80 | */ |
sahilmgandhi | 18:6a4db94011d3 | 81 | #define GPIO_AF1_TIM1 ((uint8_t)0x01U) /* TIM1 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 82 | #define GPIO_AF1_TIM2 ((uint8_t)0x01U) /* TIM2 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 83 | |
sahilmgandhi | 18:6a4db94011d3 | 84 | /** |
sahilmgandhi | 18:6a4db94011d3 | 85 | * @brief AF 2 selection |
sahilmgandhi | 18:6a4db94011d3 | 86 | */ |
sahilmgandhi | 18:6a4db94011d3 | 87 | #define GPIO_AF2_TIM3 ((uint8_t)0x02U) /* TIM3 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 88 | #define GPIO_AF2_TIM4 ((uint8_t)0x02U) /* TIM4 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 89 | #define GPIO_AF2_TIM5 ((uint8_t)0x02U) /* TIM5 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 90 | |
sahilmgandhi | 18:6a4db94011d3 | 91 | /** |
sahilmgandhi | 18:6a4db94011d3 | 92 | * @brief AF 3 selection |
sahilmgandhi | 18:6a4db94011d3 | 93 | */ |
sahilmgandhi | 18:6a4db94011d3 | 94 | #define GPIO_AF3_TIM8 ((uint8_t)0x03U) /* TIM8 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 95 | #define GPIO_AF3_TIM9 ((uint8_t)0x03U) /* TIM9 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 96 | #define GPIO_AF3_TIM10 ((uint8_t)0x03U) /* TIM10 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 97 | #define GPIO_AF3_TIM11 ((uint8_t)0x03U) /* TIM11 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 98 | |
sahilmgandhi | 18:6a4db94011d3 | 99 | /** |
sahilmgandhi | 18:6a4db94011d3 | 100 | * @brief AF 4 selection |
sahilmgandhi | 18:6a4db94011d3 | 101 | */ |
sahilmgandhi | 18:6a4db94011d3 | 102 | #define GPIO_AF4_I2C1 ((uint8_t)0x04U) /* I2C1 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 103 | #define GPIO_AF4_I2C2 ((uint8_t)0x04U) /* I2C2 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 104 | #define GPIO_AF4_I2C3 ((uint8_t)0x04U) /* I2C3 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 105 | |
sahilmgandhi | 18:6a4db94011d3 | 106 | /** |
sahilmgandhi | 18:6a4db94011d3 | 107 | * @brief AF 5 selection |
sahilmgandhi | 18:6a4db94011d3 | 108 | */ |
sahilmgandhi | 18:6a4db94011d3 | 109 | #define GPIO_AF5_SPI1 ((uint8_t)0x05U) /* SPI1 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 110 | #define GPIO_AF5_SPI2 ((uint8_t)0x05U) /* SPI2/I2S2 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 111 | /** |
sahilmgandhi | 18:6a4db94011d3 | 112 | * @brief AF 6 selection |
sahilmgandhi | 18:6a4db94011d3 | 113 | */ |
sahilmgandhi | 18:6a4db94011d3 | 114 | #define GPIO_AF6_SPI3 ((uint8_t)0x06U) /* SPI3/I2S3 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 115 | |
sahilmgandhi | 18:6a4db94011d3 | 116 | /** |
sahilmgandhi | 18:6a4db94011d3 | 117 | * @brief AF 7 selection |
sahilmgandhi | 18:6a4db94011d3 | 118 | */ |
sahilmgandhi | 18:6a4db94011d3 | 119 | #define GPIO_AF7_USART1 ((uint8_t)0x07U) /* USART1 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 120 | #define GPIO_AF7_USART2 ((uint8_t)0x07U) /* USART2 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 121 | #define GPIO_AF7_USART3 ((uint8_t)0x07U) /* USART3 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 122 | |
sahilmgandhi | 18:6a4db94011d3 | 123 | /** |
sahilmgandhi | 18:6a4db94011d3 | 124 | * @brief AF 8 selection |
sahilmgandhi | 18:6a4db94011d3 | 125 | */ |
sahilmgandhi | 18:6a4db94011d3 | 126 | #define GPIO_AF8_UART4 ((uint8_t)0x08U) /* UART4 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 127 | #define GPIO_AF8_UART5 ((uint8_t)0x08U) /* UART5 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 128 | #define GPIO_AF8_USART6 ((uint8_t)0x08U) /* USART6 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 129 | |
sahilmgandhi | 18:6a4db94011d3 | 130 | /** |
sahilmgandhi | 18:6a4db94011d3 | 131 | * @brief AF 9 selection |
sahilmgandhi | 18:6a4db94011d3 | 132 | */ |
sahilmgandhi | 18:6a4db94011d3 | 133 | #define GPIO_AF9_CAN1 ((uint8_t)0x09U) /* CAN1 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 134 | #define GPIO_AF9_CAN2 ((uint8_t)0x09U) /* CAN2 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 135 | #define GPIO_AF9_TIM12 ((uint8_t)0x09U) /* TIM12 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 136 | #define GPIO_AF9_TIM13 ((uint8_t)0x09U) /* TIM13 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 137 | #define GPIO_AF9_TIM14 ((uint8_t)0x09U) /* TIM14 Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 138 | |
sahilmgandhi | 18:6a4db94011d3 | 139 | /** |
sahilmgandhi | 18:6a4db94011d3 | 140 | * @brief AF 10 selection |
sahilmgandhi | 18:6a4db94011d3 | 141 | */ |
sahilmgandhi | 18:6a4db94011d3 | 142 | #define GPIO_AF10_OTG_FS ((uint8_t)0xAU) /* OTG_FS Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 143 | #define GPIO_AF10_OTG_HS ((uint8_t)0xAU) /* OTG_HS Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 144 | |
sahilmgandhi | 18:6a4db94011d3 | 145 | /** |
sahilmgandhi | 18:6a4db94011d3 | 146 | * @brief AF 11 selection |
sahilmgandhi | 18:6a4db94011d3 | 147 | */ |
sahilmgandhi | 18:6a4db94011d3 | 148 | #if defined(STM32F207xx) || defined(STM32F217xx) |
sahilmgandhi | 18:6a4db94011d3 | 149 | #define GPIO_AF11_ETH ((uint8_t)0x0BU) /* ETHERNET Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 150 | #endif /* STM32F207xx || STM32F217xx */ |
sahilmgandhi | 18:6a4db94011d3 | 151 | |
sahilmgandhi | 18:6a4db94011d3 | 152 | /** |
sahilmgandhi | 18:6a4db94011d3 | 153 | * @brief AF 12 selection |
sahilmgandhi | 18:6a4db94011d3 | 154 | */ |
sahilmgandhi | 18:6a4db94011d3 | 155 | #define GPIO_AF12_FSMC ((uint8_t)0xCU) /* FSMC Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 156 | #define GPIO_AF12_OTG_HS_FS ((uint8_t)0xCU) /* OTG HS configured in FS, Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 157 | #define GPIO_AF12_SDIO ((uint8_t)0xCU) /* SDIO Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 158 | |
sahilmgandhi | 18:6a4db94011d3 | 159 | /** |
sahilmgandhi | 18:6a4db94011d3 | 160 | * @brief AF 13 selection |
sahilmgandhi | 18:6a4db94011d3 | 161 | */ |
sahilmgandhi | 18:6a4db94011d3 | 162 | #if defined(STM32F207xx) || defined(STM32F217xx) |
sahilmgandhi | 18:6a4db94011d3 | 163 | #define GPIO_AF13_DCMI ((uint8_t)0x0DU) /* DCMI Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 164 | #endif /* STM32F207xx || STM32F217xx */ |
sahilmgandhi | 18:6a4db94011d3 | 165 | |
sahilmgandhi | 18:6a4db94011d3 | 166 | /** |
sahilmgandhi | 18:6a4db94011d3 | 167 | * @brief AF 15 selection |
sahilmgandhi | 18:6a4db94011d3 | 168 | */ |
sahilmgandhi | 18:6a4db94011d3 | 169 | #define GPIO_AF15_EVENTOUT ((uint8_t)0x0FU) /* EVENTOUT Alternate Function mapping */ |
sahilmgandhi | 18:6a4db94011d3 | 170 | |
sahilmgandhi | 18:6a4db94011d3 | 171 | /** |
sahilmgandhi | 18:6a4db94011d3 | 172 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 173 | */ |
sahilmgandhi | 18:6a4db94011d3 | 174 | |
sahilmgandhi | 18:6a4db94011d3 | 175 | /** |
sahilmgandhi | 18:6a4db94011d3 | 176 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 177 | */ |
sahilmgandhi | 18:6a4db94011d3 | 178 | |
sahilmgandhi | 18:6a4db94011d3 | 179 | /* Exported macro ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 180 | /** @defgroup GPIOEx_Exported_Macros GPIO Exported Macros |
sahilmgandhi | 18:6a4db94011d3 | 181 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 182 | */ |
sahilmgandhi | 18:6a4db94011d3 | 183 | /** |
sahilmgandhi | 18:6a4db94011d3 | 184 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 185 | */ |
sahilmgandhi | 18:6a4db94011d3 | 186 | |
sahilmgandhi | 18:6a4db94011d3 | 187 | /* Exported functions --------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 188 | /** @defgroup GPIOEx_Exported_Functions GPIO Exported Functions |
sahilmgandhi | 18:6a4db94011d3 | 189 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 190 | */ |
sahilmgandhi | 18:6a4db94011d3 | 191 | /** |
sahilmgandhi | 18:6a4db94011d3 | 192 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 193 | */ |
sahilmgandhi | 18:6a4db94011d3 | 194 | |
sahilmgandhi | 18:6a4db94011d3 | 195 | /* Private types -------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 196 | /* Private variables ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 197 | /* Private constants ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 198 | /** @defgroup GPIOEx_Private_Constants GPIO Private Constants |
sahilmgandhi | 18:6a4db94011d3 | 199 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 200 | */ |
sahilmgandhi | 18:6a4db94011d3 | 201 | /** |
sahilmgandhi | 18:6a4db94011d3 | 202 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 203 | */ |
sahilmgandhi | 18:6a4db94011d3 | 204 | |
sahilmgandhi | 18:6a4db94011d3 | 205 | /* Private macros ------------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 206 | /** @defgroup GPIOEx_Private_Macros GPIO Private Macros |
sahilmgandhi | 18:6a4db94011d3 | 207 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 208 | */ |
sahilmgandhi | 18:6a4db94011d3 | 209 | /** @defgroup GPIOEx_Get_Port_Index GPIO Get Port Index |
sahilmgandhi | 18:6a4db94011d3 | 210 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 211 | */ |
sahilmgandhi | 18:6a4db94011d3 | 212 | #define GPIO_GET_INDEX(__GPIOx__) (uint8_t)(((__GPIOx__) == (GPIOA))? 0U :\ |
sahilmgandhi | 18:6a4db94011d3 | 213 | ((__GPIOx__) == (GPIOB))? 1U :\ |
sahilmgandhi | 18:6a4db94011d3 | 214 | ((__GPIOx__) == (GPIOC))? 2U :\ |
sahilmgandhi | 18:6a4db94011d3 | 215 | ((__GPIOx__) == (GPIOD))? 3U :\ |
sahilmgandhi | 18:6a4db94011d3 | 216 | ((__GPIOx__) == (GPIOE))? 4U :\ |
sahilmgandhi | 18:6a4db94011d3 | 217 | ((__GPIOx__) == (GPIOF))? 5U :\ |
sahilmgandhi | 18:6a4db94011d3 | 218 | ((__GPIOx__) == (GPIOG))? 6U :\ |
sahilmgandhi | 18:6a4db94011d3 | 219 | ((__GPIOx__) == (GPIOH))? 7U :\ |
sahilmgandhi | 18:6a4db94011d3 | 220 | ((__GPIOx__) == (GPIOI))? 8U : 9U) |
sahilmgandhi | 18:6a4db94011d3 | 221 | /** |
sahilmgandhi | 18:6a4db94011d3 | 222 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 223 | */ |
sahilmgandhi | 18:6a4db94011d3 | 224 | |
sahilmgandhi | 18:6a4db94011d3 | 225 | /** @defgroup GPIOEx_IS_Alternat_function_selection GPIO Check Alternate Function |
sahilmgandhi | 18:6a4db94011d3 | 226 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 227 | */ |
sahilmgandhi | 18:6a4db94011d3 | 228 | #if defined(STM32F207xx) || defined(STM32F217xx) |
sahilmgandhi | 18:6a4db94011d3 | 229 | |
sahilmgandhi | 18:6a4db94011d3 | 230 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
sahilmgandhi | 18:6a4db94011d3 | 231 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
sahilmgandhi | 18:6a4db94011d3 | 232 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
sahilmgandhi | 18:6a4db94011d3 | 233 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 234 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
sahilmgandhi | 18:6a4db94011d3 | 235 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
sahilmgandhi | 18:6a4db94011d3 | 236 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 237 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ |
sahilmgandhi | 18:6a4db94011d3 | 238 | ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ |
sahilmgandhi | 18:6a4db94011d3 | 239 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ |
sahilmgandhi | 18:6a4db94011d3 | 240 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 241 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ |
sahilmgandhi | 18:6a4db94011d3 | 242 | ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ |
sahilmgandhi | 18:6a4db94011d3 | 243 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 244 | ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ |
sahilmgandhi | 18:6a4db94011d3 | 245 | ((AF) == GPIO_AF11_ETH) || ((AF) == GPIO_AF12_OTG_HS_FS) || \ |
sahilmgandhi | 18:6a4db94011d3 | 246 | ((AF) == GPIO_AF12_SDIO) || ((AF) == GPIO_AF13_DCMI) || \ |
sahilmgandhi | 18:6a4db94011d3 | 247 | ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) |
sahilmgandhi | 18:6a4db94011d3 | 248 | #else /* STM32F207xx || STM32F217xx */ |
sahilmgandhi | 18:6a4db94011d3 | 249 | #define IS_GPIO_AF(AF) (((AF) == GPIO_AF0_RTC_50Hz) || ((AF) == GPIO_AF9_TIM14) || \ |
sahilmgandhi | 18:6a4db94011d3 | 250 | ((AF) == GPIO_AF0_MCO) || ((AF) == GPIO_AF0_TAMPER) || \ |
sahilmgandhi | 18:6a4db94011d3 | 251 | ((AF) == GPIO_AF0_SWJ) || ((AF) == GPIO_AF0_TRACE) || \ |
sahilmgandhi | 18:6a4db94011d3 | 252 | ((AF) == GPIO_AF1_TIM1) || ((AF) == GPIO_AF1_TIM2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 253 | ((AF) == GPIO_AF2_TIM3) || ((AF) == GPIO_AF2_TIM4) || \ |
sahilmgandhi | 18:6a4db94011d3 | 254 | ((AF) == GPIO_AF2_TIM5) || ((AF) == GPIO_AF3_TIM8) || \ |
sahilmgandhi | 18:6a4db94011d3 | 255 | ((AF) == GPIO_AF4_I2C1) || ((AF) == GPIO_AF4_I2C2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 256 | ((AF) == GPIO_AF4_I2C3) || ((AF) == GPIO_AF5_SPI1) || \ |
sahilmgandhi | 18:6a4db94011d3 | 257 | ((AF) == GPIO_AF5_SPI2) || ((AF) == GPIO_AF9_TIM13) || \ |
sahilmgandhi | 18:6a4db94011d3 | 258 | ((AF) == GPIO_AF6_SPI3) || ((AF) == GPIO_AF9_TIM12) || \ |
sahilmgandhi | 18:6a4db94011d3 | 259 | ((AF) == GPIO_AF7_USART1) || ((AF) == GPIO_AF7_USART2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 260 | ((AF) == GPIO_AF7_USART3) || ((AF) == GPIO_AF8_UART4) || \ |
sahilmgandhi | 18:6a4db94011d3 | 261 | ((AF) == GPIO_AF8_UART5) || ((AF) == GPIO_AF8_USART6) || \ |
sahilmgandhi | 18:6a4db94011d3 | 262 | ((AF) == GPIO_AF9_CAN1) || ((AF) == GPIO_AF9_CAN2) || \ |
sahilmgandhi | 18:6a4db94011d3 | 263 | ((AF) == GPIO_AF10_OTG_FS) || ((AF) == GPIO_AF10_OTG_HS) || \ |
sahilmgandhi | 18:6a4db94011d3 | 264 | ((AF) == GPIO_AF12_OTG_HS_FS) || ((AF) == GPIO_AF12_SDIO) || \ |
sahilmgandhi | 18:6a4db94011d3 | 265 | ((AF) == GPIO_AF12_FSMC) || ((AF) == GPIO_AF15_EVENTOUT)) |
sahilmgandhi | 18:6a4db94011d3 | 266 | #endif /* STM32F207xx || STM32F217xx */ |
sahilmgandhi | 18:6a4db94011d3 | 267 | |
sahilmgandhi | 18:6a4db94011d3 | 268 | /** |
sahilmgandhi | 18:6a4db94011d3 | 269 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 270 | */ |
sahilmgandhi | 18:6a4db94011d3 | 271 | |
sahilmgandhi | 18:6a4db94011d3 | 272 | /** |
sahilmgandhi | 18:6a4db94011d3 | 273 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 274 | */ |
sahilmgandhi | 18:6a4db94011d3 | 275 | |
sahilmgandhi | 18:6a4db94011d3 | 276 | /* Private functions ---------------------------------------------------------*/ |
sahilmgandhi | 18:6a4db94011d3 | 277 | /** @defgroup GPIOEx_Private_Functions GPIO Private Functions |
sahilmgandhi | 18:6a4db94011d3 | 278 | * @{ |
sahilmgandhi | 18:6a4db94011d3 | 279 | */ |
sahilmgandhi | 18:6a4db94011d3 | 280 | |
sahilmgandhi | 18:6a4db94011d3 | 281 | /** |
sahilmgandhi | 18:6a4db94011d3 | 282 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 283 | */ |
sahilmgandhi | 18:6a4db94011d3 | 284 | |
sahilmgandhi | 18:6a4db94011d3 | 285 | /** |
sahilmgandhi | 18:6a4db94011d3 | 286 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 287 | */ |
sahilmgandhi | 18:6a4db94011d3 | 288 | |
sahilmgandhi | 18:6a4db94011d3 | 289 | /** |
sahilmgandhi | 18:6a4db94011d3 | 290 | * @} |
sahilmgandhi | 18:6a4db94011d3 | 291 | */ |
sahilmgandhi | 18:6a4db94011d3 | 292 | |
sahilmgandhi | 18:6a4db94011d3 | 293 | #ifdef __cplusplus |
sahilmgandhi | 18:6a4db94011d3 | 294 | } |
sahilmgandhi | 18:6a4db94011d3 | 295 | #endif |
sahilmgandhi | 18:6a4db94011d3 | 296 | |
sahilmgandhi | 18:6a4db94011d3 | 297 | #endif /* __STM32F2xx_HAL_GPIO_EX_H */ |
sahilmgandhi | 18:6a4db94011d3 | 298 | |
sahilmgandhi | 18:6a4db94011d3 | 299 | /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ |