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:
elijahorr
Date:
Thu Apr 14 07:28:54 2016 +0000
Revision:
121:672067c3ada4
Parent:
107:4f6c30876dfa
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 107:4f6c30876dfa 1 /**
Kojto 107:4f6c30876dfa 2 ******************************************************************************
Kojto 107:4f6c30876dfa 3 * @file stm32l4xx_hal_gpio_ex.h
Kojto 107:4f6c30876dfa 4 * @author MCD Application Team
Kojto 107:4f6c30876dfa 5 * @version V1.0.0
Kojto 107:4f6c30876dfa 6 * @date 26-June-2015
Kojto 107:4f6c30876dfa 7 * @brief Header file of GPIO HAL Extended module.
Kojto 107:4f6c30876dfa 8 ******************************************************************************
Kojto 107:4f6c30876dfa 9 * @attention
Kojto 107:4f6c30876dfa 10 *
Kojto 107:4f6c30876dfa 11 * <h2><center>&copy; COPYRIGHT(c) 2015 STMicroelectronics</center></h2>
Kojto 107:4f6c30876dfa 12 *
Kojto 107:4f6c30876dfa 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 107:4f6c30876dfa 14 * are permitted provided that the following conditions are met:
Kojto 107:4f6c30876dfa 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 107:4f6c30876dfa 16 * this list of conditions and the following disclaimer.
Kojto 107:4f6c30876dfa 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 107:4f6c30876dfa 18 * this list of conditions and the following disclaimer in the documentation
Kojto 107:4f6c30876dfa 19 * and/or other materials provided with the distribution.
Kojto 107:4f6c30876dfa 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 107:4f6c30876dfa 21 * may be used to endorse or promote products derived from this software
Kojto 107:4f6c30876dfa 22 * without specific prior written permission.
Kojto 107:4f6c30876dfa 23 *
Kojto 107:4f6c30876dfa 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 107:4f6c30876dfa 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 107:4f6c30876dfa 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 107:4f6c30876dfa 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 107:4f6c30876dfa 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 107:4f6c30876dfa 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 107:4f6c30876dfa 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 107:4f6c30876dfa 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 107:4f6c30876dfa 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 107:4f6c30876dfa 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 107:4f6c30876dfa 34 *
Kojto 107:4f6c30876dfa 35 ******************************************************************************
Kojto 107:4f6c30876dfa 36 */
Kojto 107:4f6c30876dfa 37
Kojto 107:4f6c30876dfa 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 107:4f6c30876dfa 39 #ifndef __STM32L4xx_HAL_GPIO_EX_H
Kojto 107:4f6c30876dfa 40 #define __STM32L4xx_HAL_GPIO_EX_H
Kojto 107:4f6c30876dfa 41
Kojto 107:4f6c30876dfa 42 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 43 extern "C" {
Kojto 107:4f6c30876dfa 44 #endif
Kojto 107:4f6c30876dfa 45
Kojto 107:4f6c30876dfa 46 /* Includes ------------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 47 #include "stm32l4xx_hal_def.h"
Kojto 107:4f6c30876dfa 48
Kojto 107:4f6c30876dfa 49 /** @addtogroup STM32L4xx_HAL_Driver
Kojto 107:4f6c30876dfa 50 * @{
Kojto 107:4f6c30876dfa 51 */
Kojto 107:4f6c30876dfa 52
Kojto 107:4f6c30876dfa 53 /** @defgroup GPIOEx GPIOEx
Kojto 107:4f6c30876dfa 54 * @brief GPIO Extended HAL module driver
Kojto 107:4f6c30876dfa 55 * @{
Kojto 107:4f6c30876dfa 56 */
Kojto 107:4f6c30876dfa 57
Kojto 107:4f6c30876dfa 58 /* Exported types ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 59 /* Exported constants --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 60 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
Kojto 107:4f6c30876dfa 61 * @{
Kojto 107:4f6c30876dfa 62 */
Kojto 107:4f6c30876dfa 63
Kojto 107:4f6c30876dfa 64 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
Kojto 107:4f6c30876dfa 65 * @{
Kojto 107:4f6c30876dfa 66 */
Kojto 107:4f6c30876dfa 67
Kojto 107:4f6c30876dfa 68 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
Kojto 107:4f6c30876dfa 69 /*--------------STM32L471xx/STM32L475xx/STM32L476xx/STM32L485xx/STM32L486xx----*/
Kojto 107:4f6c30876dfa 70 /**
Kojto 107:4f6c30876dfa 71 * @brief AF 0 selection
Kojto 107:4f6c30876dfa 72 */
Kojto 107:4f6c30876dfa 73 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */
Kojto 107:4f6c30876dfa 74 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */
Kojto 107:4f6c30876dfa 75 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 107:4f6c30876dfa 76 #if defined(STM32L476xx) || defined(STM32L486xx)
Kojto 107:4f6c30876dfa 77 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */
Kojto 107:4f6c30876dfa 78 #endif /* STM32L476xx || STM32L486xx */
Kojto 107:4f6c30876dfa 79 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 107:4f6c30876dfa 80
Kojto 107:4f6c30876dfa 81 /**
Kojto 107:4f6c30876dfa 82 * @brief AF 1 selection
Kojto 107:4f6c30876dfa 83 */
Kojto 107:4f6c30876dfa 84 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 85 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 86 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */
Kojto 107:4f6c30876dfa 87 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */
Kojto 107:4f6c30876dfa 88 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 89 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */
Kojto 107:4f6c30876dfa 90
Kojto 107:4f6c30876dfa 91 /**
Kojto 107:4f6c30876dfa 92 * @brief AF 2 selection
Kojto 107:4f6c30876dfa 93 */
Kojto 107:4f6c30876dfa 94 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 95 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 96 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 107:4f6c30876dfa 97 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 107:4f6c30876dfa 98 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 107:4f6c30876dfa 99
Kojto 107:4f6c30876dfa 100 /**
Kojto 107:4f6c30876dfa 101 * @brief AF 3 selection
Kojto 107:4f6c30876dfa 102 */
Kojto 107:4f6c30876dfa 103 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */
Kojto 107:4f6c30876dfa 104 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */
Kojto 107:4f6c30876dfa 105 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */
Kojto 107:4f6c30876dfa 106
Kojto 107:4f6c30876dfa 107 /**
Kojto 107:4f6c30876dfa 108 * @brief AF 4 selection
Kojto 107:4f6c30876dfa 109 */
Kojto 107:4f6c30876dfa 110 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 111 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 112 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */
Kojto 107:4f6c30876dfa 113
Kojto 107:4f6c30876dfa 114 /**
Kojto 107:4f6c30876dfa 115 * @brief AF 5 selection
Kojto 107:4f6c30876dfa 116 */
Kojto 107:4f6c30876dfa 117 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 118 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 119
Kojto 107:4f6c30876dfa 120 /**
Kojto 107:4f6c30876dfa 121 * @brief AF 6 selection
Kojto 107:4f6c30876dfa 122 */
Kojto 107:4f6c30876dfa 123 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */
Kojto 107:4f6c30876dfa 124 #define GPIO_AF6_DFSDM ((uint8_t)0x06) /* DFSDM Alternate Function mapping */
Kojto 107:4f6c30876dfa 125
Kojto 107:4f6c30876dfa 126 /**
Kojto 107:4f6c30876dfa 127 * @brief AF 7 selection
Kojto 107:4f6c30876dfa 128 */
Kojto 107:4f6c30876dfa 129 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 130 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 131 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 107:4f6c30876dfa 132
Kojto 107:4f6c30876dfa 133 /**
Kojto 107:4f6c30876dfa 134 * @brief AF 8 selection
Kojto 107:4f6c30876dfa 135 */
Kojto 107:4f6c30876dfa 136 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 107:4f6c30876dfa 137 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 107:4f6c30876dfa 138 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 139
Kojto 107:4f6c30876dfa 140 /**
Kojto 107:4f6c30876dfa 141 * @brief AF 9 selection
Kojto 107:4f6c30876dfa 142 */
Kojto 107:4f6c30876dfa 143 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 144 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */
Kojto 107:4f6c30876dfa 145
Kojto 107:4f6c30876dfa 146 /**
Kojto 107:4f6c30876dfa 147 * @brief AF 10 selection
Kojto 107:4f6c30876dfa 148 */
Kojto 107:4f6c30876dfa 149 #if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx)
Kojto 107:4f6c30876dfa 150 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */
Kojto 107:4f6c30876dfa 151 #endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
Kojto 107:4f6c30876dfa 152 #define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */
Kojto 107:4f6c30876dfa 153
Kojto 107:4f6c30876dfa 154 #if defined(STM32L476xx) || defined(STM32L486xx)
Kojto 107:4f6c30876dfa 155 /**
Kojto 107:4f6c30876dfa 156 * @brief AF 11 selection
Kojto 107:4f6c30876dfa 157 */
Kojto 107:4f6c30876dfa 158 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */
Kojto 107:4f6c30876dfa 159 #endif /* STM32L476xx || STM32L486xx */
Kojto 107:4f6c30876dfa 160
Kojto 107:4f6c30876dfa 161 /**
Kojto 107:4f6c30876dfa 162 * @brief AF 12 selection
Kojto 107:4f6c30876dfa 163 */
Kojto 107:4f6c30876dfa 164 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */
Kojto 107:4f6c30876dfa 165 #define GPIO_AF12_SWPMI1 ((uint8_t)0xC) /* SWPMI1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 166 #define GPIO_AF12_COMP1 ((uint8_t)0xC) /* COMP1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 167 #define GPIO_AF12_COMP2 ((uint8_t)0xC) /* COMP2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 168 #define GPIO_AF12_SDMMC1 ((uint8_t)0xC) /* SDMMC1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 169
Kojto 107:4f6c30876dfa 170 /**
Kojto 107:4f6c30876dfa 171 * @brief AF 13 selection
Kojto 107:4f6c30876dfa 172 */
Kojto 107:4f6c30876dfa 173 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */
Kojto 107:4f6c30876dfa 174 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 175 #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */
Kojto 107:4f6c30876dfa 176 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */
Kojto 107:4f6c30876dfa 177
Kojto 107:4f6c30876dfa 178 /**
Kojto 107:4f6c30876dfa 179 * @brief AF 14 selection
Kojto 107:4f6c30876dfa 180 */
Kojto 107:4f6c30876dfa 181 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 182 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */
Kojto 107:4f6c30876dfa 183 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */
Kojto 107:4f6c30876dfa 184 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */
Kojto 107:4f6c30876dfa 185 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */
Kojto 107:4f6c30876dfa 186 #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */
Kojto 107:4f6c30876dfa 187
Kojto 107:4f6c30876dfa 188 /**
Kojto 107:4f6c30876dfa 189 * @brief AF 15 selection
Kojto 107:4f6c30876dfa 190 */
Kojto 107:4f6c30876dfa 191 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 107:4f6c30876dfa 192
Kojto 107:4f6c30876dfa 193 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
Kojto 107:4f6c30876dfa 194
Kojto 107:4f6c30876dfa 195 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */
Kojto 107:4f6c30876dfa 196
Kojto 107:4f6c30876dfa 197 /**
Kojto 107:4f6c30876dfa 198 * @}
Kojto 107:4f6c30876dfa 199 */
Kojto 107:4f6c30876dfa 200
Kojto 107:4f6c30876dfa 201 /**
Kojto 107:4f6c30876dfa 202 * @}
Kojto 107:4f6c30876dfa 203 */
Kojto 107:4f6c30876dfa 204
Kojto 107:4f6c30876dfa 205 /* Exported macro ------------------------------------------------------------*/
Kojto 107:4f6c30876dfa 206 /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros
Kojto 107:4f6c30876dfa 207 * @{
Kojto 107:4f6c30876dfa 208 */
Kojto 107:4f6c30876dfa 209
Kojto 107:4f6c30876dfa 210 /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index
Kojto 107:4f6c30876dfa 211 * @{
Kojto 107:4f6c30876dfa 212 */
Kojto 107:4f6c30876dfa 213 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
Kojto 107:4f6c30876dfa 214 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 107:4f6c30876dfa 215 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 107:4f6c30876dfa 216 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 107:4f6c30876dfa 217 ((__GPIOx__) == (GPIOE))? 4U :\
Kojto 107:4f6c30876dfa 218 ((__GPIOx__) == (GPIOF))? 5U :\
Kojto 107:4f6c30876dfa 219 ((__GPIOx__) == (GPIOG))? 6U : 7U)
Kojto 107:4f6c30876dfa 220
Kojto 107:4f6c30876dfa 221
Kojto 107:4f6c30876dfa 222 /**
Kojto 107:4f6c30876dfa 223 * @}
Kojto 107:4f6c30876dfa 224 */
Kojto 107:4f6c30876dfa 225
Kojto 107:4f6c30876dfa 226 /**
Kojto 107:4f6c30876dfa 227 * @}
Kojto 107:4f6c30876dfa 228 */
Kojto 107:4f6c30876dfa 229
Kojto 107:4f6c30876dfa 230 /* Exported functions --------------------------------------------------------*/
Kojto 107:4f6c30876dfa 231 /**
Kojto 107:4f6c30876dfa 232 * @}
Kojto 107:4f6c30876dfa 233 */
Kojto 107:4f6c30876dfa 234
Kojto 107:4f6c30876dfa 235 /**
Kojto 107:4f6c30876dfa 236 * @}
Kojto 107:4f6c30876dfa 237 */
Kojto 107:4f6c30876dfa 238
Kojto 107:4f6c30876dfa 239 #ifdef __cplusplus
Kojto 107:4f6c30876dfa 240 }
Kojto 107:4f6c30876dfa 241 #endif
Kojto 107:4f6c30876dfa 242
Kojto 107:4f6c30876dfa 243 #endif /* __STM32L4xx_HAL_GPIO_EX_H */
Kojto 107:4f6c30876dfa 244
Kojto 107:4f6c30876dfa 245 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/