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:
112:6f327212ef96
.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Kojto 112:6f327212ef96 1 /**
Kojto 112:6f327212ef96 2 ******************************************************************************
Kojto 112:6f327212ef96 3 * @file stm32l1xx_hal_gpio_ex.h
Kojto 112:6f327212ef96 4 * @author MCD Application Team
Kojto 112:6f327212ef96 5 * @version V1.0.0
Kojto 112:6f327212ef96 6 * @date 5-September-2014
Kojto 112:6f327212ef96 7 * @brief Header file of GPIO HAL Extension module.
Kojto 112:6f327212ef96 8 ******************************************************************************
Kojto 112:6f327212ef96 9 * @attention
Kojto 112:6f327212ef96 10 *
Kojto 112:6f327212ef96 11 * <h2><center>&copy; COPYRIGHT(c) 2014 STMicroelectronics</center></h2>
Kojto 112:6f327212ef96 12 *
Kojto 112:6f327212ef96 13 * Redistribution and use in source and binary forms, with or without modification,
Kojto 112:6f327212ef96 14 * are permitted provided that the following conditions are met:
Kojto 112:6f327212ef96 15 * 1. Redistributions of source code must retain the above copyright notice,
Kojto 112:6f327212ef96 16 * this list of conditions and the following disclaimer.
Kojto 112:6f327212ef96 17 * 2. Redistributions in binary form must reproduce the above copyright notice,
Kojto 112:6f327212ef96 18 * this list of conditions and the following disclaimer in the documentation
Kojto 112:6f327212ef96 19 * and/or other materials provided with the distribution.
Kojto 112:6f327212ef96 20 * 3. Neither the name of STMicroelectronics nor the names of its contributors
Kojto 112:6f327212ef96 21 * may be used to endorse or promote products derived from this software
Kojto 112:6f327212ef96 22 * without specific prior written permission.
Kojto 112:6f327212ef96 23 *
Kojto 112:6f327212ef96 24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
Kojto 112:6f327212ef96 25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Kojto 112:6f327212ef96 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
Kojto 112:6f327212ef96 27 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
Kojto 112:6f327212ef96 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Kojto 112:6f327212ef96 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
Kojto 112:6f327212ef96 30 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
Kojto 112:6f327212ef96 31 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
Kojto 112:6f327212ef96 32 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Kojto 112:6f327212ef96 33 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Kojto 112:6f327212ef96 34 *
Kojto 112:6f327212ef96 35 ******************************************************************************
Kojto 112:6f327212ef96 36 */
Kojto 112:6f327212ef96 37
Kojto 112:6f327212ef96 38 /* Define to prevent recursive inclusion -------------------------------------*/
Kojto 112:6f327212ef96 39 #ifndef __STM32L1xx_HAL_GPIO_EX_H
Kojto 112:6f327212ef96 40 #define __STM32L1xx_HAL_GPIO_EX_H
Kojto 112:6f327212ef96 41
Kojto 112:6f327212ef96 42 #ifdef __cplusplus
Kojto 112:6f327212ef96 43 extern "C" {
Kojto 112:6f327212ef96 44 #endif
Kojto 112:6f327212ef96 45
Kojto 112:6f327212ef96 46 /* Includes ------------------------------------------------------------------*/
Kojto 112:6f327212ef96 47 #include "stm32l1xx_hal_def.h"
Kojto 112:6f327212ef96 48
Kojto 112:6f327212ef96 49 /** @addtogroup STM32L1xx_HAL_Driver
Kojto 112:6f327212ef96 50 * @{
Kojto 112:6f327212ef96 51 */
Kojto 112:6f327212ef96 52
Kojto 112:6f327212ef96 53 /** @defgroup GPIOEx GPIOEx
Kojto 112:6f327212ef96 54 * @{
Kojto 112:6f327212ef96 55 */
Kojto 112:6f327212ef96 56
Kojto 112:6f327212ef96 57 /* Exported types ------------------------------------------------------------*/
Kojto 112:6f327212ef96 58
Kojto 112:6f327212ef96 59 /* Exported constants --------------------------------------------------------*/
Kojto 112:6f327212ef96 60
Kojto 112:6f327212ef96 61 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants
Kojto 112:6f327212ef96 62 * @{
Kojto 112:6f327212ef96 63 */
Kojto 112:6f327212ef96 64
Kojto 112:6f327212ef96 65 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection
Kojto 112:6f327212ef96 66 * @{
Kojto 112:6f327212ef96 67 */
Kojto 112:6f327212ef96 68
Kojto 112:6f327212ef96 69 /**
Kojto 112:6f327212ef96 70 * @brief AF 0 selection
Kojto 112:6f327212ef96 71 */
Kojto 112:6f327212ef96 72 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO Alternate Function mapping */
Kojto 112:6f327212ef96 73 #define GPIO_AF0_TAMPER ((uint8_t)0x00) /* TAMPER Alternate Function mapping */
Kojto 112:6f327212ef96 74 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */
Kojto 112:6f327212ef96 75 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */
Kojto 112:6f327212ef96 76 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_OUT Alternate Function mapping */
Kojto 112:6f327212ef96 77
Kojto 112:6f327212ef96 78 /**
Kojto 112:6f327212ef96 79 * @brief AF 1 selection
Kojto 112:6f327212ef96 80 */
Kojto 112:6f327212ef96 81 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */
Kojto 112:6f327212ef96 82
Kojto 112:6f327212ef96 83 /**
Kojto 112:6f327212ef96 84 * @brief AF 2 selection
Kojto 112:6f327212ef96 85 */
Kojto 112:6f327212ef96 86 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */
Kojto 112:6f327212ef96 87 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */
Kojto 112:6f327212ef96 88 #if defined (STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE) || defined (STM32L162xC) || defined (STM32L152xC) || defined (STM32L151xC)
Kojto 112:6f327212ef96 89 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */
Kojto 112:6f327212ef96 90
Kojto 112:6f327212ef96 91 #endif /* STM32L151xCA || STM32L151xD || STM32L152xCA || STM32L152xD || STM32L162xCA || STM32L162xD ...STM32L151xC */
Kojto 112:6f327212ef96 92
Kojto 112:6f327212ef96 93 /**
Kojto 112:6f327212ef96 94 * @brief AF 3 selection
Kojto 112:6f327212ef96 95 */
Kojto 112:6f327212ef96 96 #define GPIO_AF3_TIM9 ((uint8_t)0x03) /* TIM9 Alternate Function mapping */
Kojto 112:6f327212ef96 97 #define GPIO_AF3_TIM10 ((uint8_t)0x03) /* TIM10 Alternate Function mapping */
Kojto 112:6f327212ef96 98 #define GPIO_AF3_TIM11 ((uint8_t)0x03) /* TIM11 Alternate Function mapping */
Kojto 112:6f327212ef96 99
Kojto 112:6f327212ef96 100
Kojto 112:6f327212ef96 101 /**
Kojto 112:6f327212ef96 102 * @brief AF 4 selection
Kojto 112:6f327212ef96 103 */
Kojto 112:6f327212ef96 104 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */
Kojto 112:6f327212ef96 105 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */
Kojto 112:6f327212ef96 106
Kojto 112:6f327212ef96 107 /**
Kojto 112:6f327212ef96 108 * @brief AF 5 selection
Kojto 112:6f327212ef96 109 */
Kojto 112:6f327212ef96 110 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1/I2S1 Alternate Function mapping */
Kojto 112:6f327212ef96 111 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2/I2S2 Alternate Function mapping */
Kojto 112:6f327212ef96 112
Kojto 112:6f327212ef96 113 /**
Kojto 112:6f327212ef96 114 * @brief AF 6 selection
Kojto 112:6f327212ef96 115 */
Kojto 112:6f327212ef96 116 #if defined (STM32L100xC) || defined (STM32L151xC) || defined (STM32L151xCA) || defined (STM32L151xD) || defined (STM32L151xE) ||\
Kojto 112:6f327212ef96 117 defined (STM32L152xC) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L152xE) ||\
Kojto 112:6f327212ef96 118 defined (STM32L162xC) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L162xE)
Kojto 112:6f327212ef96 119
Kojto 112:6f327212ef96 120 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3/I2S3 Alternate Function mapping */
Kojto 112:6f327212ef96 121
Kojto 112:6f327212ef96 122 #endif /* STM32L100xC || STM32L151xC || (...) || STM32L162xD || STM32L162xE */
Kojto 112:6f327212ef96 123
Kojto 112:6f327212ef96 124
Kojto 112:6f327212ef96 125 /**
Kojto 112:6f327212ef96 126 * @brief AF 7 selection
Kojto 112:6f327212ef96 127 */
Kojto 112:6f327212ef96 128 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */
Kojto 112:6f327212ef96 129 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */
Kojto 112:6f327212ef96 130 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */
Kojto 112:6f327212ef96 131
Kojto 112:6f327212ef96 132 /**
Kojto 112:6f327212ef96 133 * @brief AF 8 selection
Kojto 112:6f327212ef96 134 */
Kojto 112:6f327212ef96 135 #if defined (STM32L151xD) || defined (STM32L151xE) ||\
Kojto 112:6f327212ef96 136 defined (STM32L152xD) || defined (STM32L152xE) ||\
Kojto 112:6f327212ef96 137 defined (STM32L162xD) || defined (STM32L162xE)
Kojto 112:6f327212ef96 138
Kojto 112:6f327212ef96 139 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */
Kojto 112:6f327212ef96 140 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */
Kojto 112:6f327212ef96 141
Kojto 112:6f327212ef96 142 #endif /* STM32L151xD || STM32L151xE || STM32L152xD || STM32L 152xE || STM32L162xD || STM32L162xE */
Kojto 112:6f327212ef96 143
Kojto 112:6f327212ef96 144
Kojto 112:6f327212ef96 145 /**
Kojto 112:6f327212ef96 146 * @brief AF 9 selection
Kojto 112:6f327212ef96 147 */
Kojto 112:6f327212ef96 148
Kojto 112:6f327212ef96 149 /**
Kojto 112:6f327212ef96 150 * @brief AF 10 selection
Kojto 112:6f327212ef96 151 */
Kojto 112:6f327212ef96 152
Kojto 112:6f327212ef96 153 /**
Kojto 112:6f327212ef96 154 * @brief AF 11 selection
Kojto 112:6f327212ef96 155 */
Kojto 112:6f327212ef96 156 #if defined (STM32L100xB) || defined (STM32L100xBA) || defined (STM32L100xC) ||\
Kojto 112:6f327212ef96 157 defined (STM32L152xB) || defined (STM32L152xBA) || defined (STM32L152xC) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L152xE) ||\
Kojto 112:6f327212ef96 158 defined (STM32L162xC) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L162xE)
Kojto 112:6f327212ef96 159
Kojto 112:6f327212ef96 160 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */
Kojto 112:6f327212ef96 161
Kojto 112:6f327212ef96 162 #endif /* STM32L100xB || STM32L100xBA || STM32L100xC || (...) || STM32L162xCA || STM32L162xD || STM32L162xE */
Kojto 112:6f327212ef96 163
Kojto 112:6f327212ef96 164 /**
Kojto 112:6f327212ef96 165 * @brief AF 12 selection
Kojto 112:6f327212ef96 166 */
Kojto 112:6f327212ef96 167 #if defined (STM32L151xD) || defined (STM32L152xD) || defined (STM32L162xD)
Kojto 112:6f327212ef96 168
Kojto 112:6f327212ef96 169 #define GPIO_AF12_FSMC ((uint8_t)0x0C) /* FSMC Alternate Function mapping */
Kojto 112:6f327212ef96 170 #define GPIO_AF12_SDIO ((uint8_t)0x0C) /* SDIO Alternate Function mapping */
Kojto 112:6f327212ef96 171
Kojto 112:6f327212ef96 172 #endif /* STM32L151xD || STM32L152xD || STM32L162xD */
Kojto 112:6f327212ef96 173 /**
Kojto 112:6f327212ef96 174 * @brief AF 13 selection
Kojto 112:6f327212ef96 175 */
Kojto 112:6f327212ef96 176
Kojto 112:6f327212ef96 177 /**
Kojto 112:6f327212ef96 178 * @brief AF 14 selection
Kojto 112:6f327212ef96 179 */
Kojto 112:6f327212ef96 180 #define GPIO_AF14_TIM_IC1 ((uint8_t)0x0E) /* TIMER INPUT CAPTURE Alternate Function mapping */
Kojto 112:6f327212ef96 181 #define GPIO_AF14_TIM_IC2 ((uint8_t)0x0E) /* TIMER INPUT CAPTURE Alternate Function mapping */
Kojto 112:6f327212ef96 182 #define GPIO_AF14_TIM_IC3 ((uint8_t)0x0E) /* TIMER INPUT CAPTURE Alternate Function mapping */
Kojto 112:6f327212ef96 183 #define GPIO_AF14_TIM_IC4 ((uint8_t)0x0E) /* TIMER INPUT CAPTURE Alternate Function mapping */
Kojto 112:6f327212ef96 184
Kojto 112:6f327212ef96 185 /**
Kojto 112:6f327212ef96 186 * @brief AF 15 selection
Kojto 112:6f327212ef96 187 */
Kojto 112:6f327212ef96 188 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */
Kojto 112:6f327212ef96 189
Kojto 112:6f327212ef96 190 /**
Kojto 112:6f327212ef96 191 * @}
Kojto 112:6f327212ef96 192 */
Kojto 112:6f327212ef96 193
Kojto 112:6f327212ef96 194 /**
Kojto 112:6f327212ef96 195 * @}
Kojto 112:6f327212ef96 196 */
Kojto 112:6f327212ef96 197
Kojto 112:6f327212ef96 198 /** @defgroup GPIOEx_Private_Macros GPIOEx Private Macros
Kojto 112:6f327212ef96 199 * @{
Kojto 112:6f327212ef96 200 */
Kojto 112:6f327212ef96 201
Kojto 112:6f327212ef96 202
Kojto 112:6f327212ef96 203 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F)
Kojto 112:6f327212ef96 204
Kojto 112:6f327212ef96 205
Kojto 112:6f327212ef96 206 #if defined (STM32L151xCA) || defined (STM32L151xD) || defined (STM32L152xCA) || defined (STM32L152xD) || defined (STM32L162xCA) || defined (STM32L162xD) || defined (STM32L151xE) || defined (STM32L152xE) || defined (STM32L162xE)
Kojto 112:6f327212ef96 207 #define GET_GPIO_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
Kojto 112:6f327212ef96 208 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 112:6f327212ef96 209 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 112:6f327212ef96 210 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 112:6f327212ef96 211 ((__GPIOx__) == (GPIOE))? 4U :\
Kojto 112:6f327212ef96 212 ((__GPIOx__) == (GPIOF))? 5U :\
Kojto 112:6f327212ef96 213 ((__GPIOx__) == (GPIOG))? 6U :\
Kojto 112:6f327212ef96 214 ((__GPIOx__) == (GPIOH))? 7U : 8U)
Kojto 112:6f327212ef96 215 #endif
Kojto 112:6f327212ef96 216
Kojto 112:6f327212ef96 217 #if defined (STM32L151xB) || defined (STM32L151xBA) || defined (STM32L151xC) || defined (STM32L152xB) || defined (STM32L152xBA) || defined (STM32L152xC) || defined (STM32L162xC)
Kojto 112:6f327212ef96 218 #define GET_GPIO_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
Kojto 112:6f327212ef96 219 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 112:6f327212ef96 220 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 112:6f327212ef96 221 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 112:6f327212ef96 222 ((__GPIOx__) == (GPIOE))? 4U :\
Kojto 112:6f327212ef96 223 ((__GPIOx__) == (GPIOH))? 7U : 8U)
Kojto 112:6f327212ef96 224 #endif
Kojto 112:6f327212ef96 225
Kojto 112:6f327212ef96 226 #if defined (STM32L100xB) || defined (STM32L100xBA) || defined (STM32L100xC)
Kojto 112:6f327212ef96 227 #define GET_GPIO_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\
Kojto 112:6f327212ef96 228 ((__GPIOx__) == (GPIOB))? 1U :\
Kojto 112:6f327212ef96 229 ((__GPIOx__) == (GPIOC))? 2U :\
Kojto 112:6f327212ef96 230 ((__GPIOx__) == (GPIOD))? 3U :\
Kojto 112:6f327212ef96 231 ((__GPIOx__) == (GPIOH))? 7U : 8U)
Kojto 112:6f327212ef96 232 #endif
Kojto 112:6f327212ef96 233
Kojto 112:6f327212ef96 234
Kojto 112:6f327212ef96 235
Kojto 112:6f327212ef96 236 /**
Kojto 112:6f327212ef96 237 * @}
Kojto 112:6f327212ef96 238 */
Kojto 112:6f327212ef96 239
Kojto 112:6f327212ef96 240
Kojto 112:6f327212ef96 241
Kojto 112:6f327212ef96 242 /* Exported macro ------------------------------------------------------------*/
Kojto 112:6f327212ef96 243 /* Exported functions --------------------------------------------------------*/
Kojto 112:6f327212ef96 244
Kojto 112:6f327212ef96 245
Kojto 112:6f327212ef96 246 /**
Kojto 112:6f327212ef96 247 * @}
Kojto 112:6f327212ef96 248 */
Kojto 112:6f327212ef96 249
Kojto 112:6f327212ef96 250 /**
Kojto 112:6f327212ef96 251 * @}
Kojto 112:6f327212ef96 252 */
Kojto 112:6f327212ef96 253
Kojto 112:6f327212ef96 254 #ifdef __cplusplus
Kojto 112:6f327212ef96 255 }
Kojto 112:6f327212ef96 256 #endif
Kojto 112:6f327212ef96 257
Kojto 112:6f327212ef96 258 #endif /* __STM32L1xx_HAL_GPIO_EX_H */
Kojto 112:6f327212ef96 259
Kojto 112:6f327212ef96 260 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/