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