Hal Drivers for L4

Dependents:   BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo

Fork of STM32L4xx_HAL_Driver by Senior Design: Sound Monitor

Committer:
EricLew
Date:
Wed Nov 25 17:30:43 2015 +0000
Revision:
2:7aef7655b0a8
Parent:
0:80ee8f3b695e
commit;

Who changed what in which revision?

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