Lancaster University's (short term!) clone of mbed-src for micro:bit. This is a copy of the github branch https://github.com/lancaster-university/mbed-classic

Fork of mbed-src by mbed official

Committer:
mbed_official
Date:
Fri Aug 14 13:15:17 2015 +0100
Revision:
610:813dcc80987e
Synchronized with git revision 6d84db41c6833e0b9b024741eb0616a5f62d5599

Full URL: https://github.com/mbedmicro/mbed/commit/6d84db41c6833e0b9b024741eb0616a5f62d5599/

DISCO_F746NG - Improvements

Who changed what in which revision?

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