Hal Drivers for L4
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
stm32l4xx_hal_gpio_ex.h
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4xx_hal_gpio_ex.h 00004 * @author MCD Application Team 00005 * @version V1.1.0 00006 * @date 16-September-2015 00007 * @brief Header file of GPIO HAL Extended module. 00008 ****************************************************************************** 00009 * @attention 00010 * 00011 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 00012 * 00013 * Redistribution and use in source and binary forms, with or without modification, 00014 * are permitted provided that the following conditions are met: 00015 * 1. Redistributions of source code must retain the above copyright notice, 00016 * this list of conditions and the following disclaimer. 00017 * 2. Redistributions in binary form must reproduce the above copyright notice, 00018 * this list of conditions and the following disclaimer in the documentation 00019 * and/or other materials provided with the distribution. 00020 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00021 * may be used to endorse or promote products derived from this software 00022 * without specific prior written permission. 00023 * 00024 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00025 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00026 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00027 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00028 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00029 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00030 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00031 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00032 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00033 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00034 * 00035 ****************************************************************************** 00036 */ 00037 00038 /* Define to prevent recursive inclusion -------------------------------------*/ 00039 #ifndef __STM32L4xx_HAL_GPIO_EX_H 00040 #define __STM32L4xx_HAL_GPIO_EX_H 00041 00042 #ifdef __cplusplus 00043 extern "C" { 00044 #endif 00045 00046 /* Includes ------------------------------------------------------------------*/ 00047 #include "stm32l4xx_hal_def.h" 00048 00049 /** @addtogroup STM32L4xx_HAL_Driver 00050 * @{ 00051 */ 00052 00053 /** @defgroup GPIOEx GPIOEx 00054 * @brief GPIO Extended HAL module driver 00055 * @{ 00056 */ 00057 00058 /* Exported types ------------------------------------------------------------*/ 00059 /* Exported constants --------------------------------------------------------*/ 00060 /** @defgroup GPIOEx_Exported_Constants GPIOEx Exported Constants 00061 * @{ 00062 */ 00063 00064 /** @defgroup GPIOEx_Alternate_function_selection GPIOEx Alternate function selection 00065 * @{ 00066 */ 00067 00068 #if defined(STM32L471xx) || defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) 00069 /*--------------STM32L471xx/STM32L475xx/STM32L476xx/STM32L485xx/STM32L486xx----*/ 00070 /** 00071 * @brief AF 0 selection 00072 */ 00073 #define GPIO_AF0_RTC_50Hz ((uint8_t)0x00) /* RTC_50Hz Alternate Function mapping */ 00074 #define GPIO_AF0_MCO ((uint8_t)0x00) /* MCO (MCO1 and MCO2) Alternate Function mapping */ 00075 #define GPIO_AF0_SWJ ((uint8_t)0x00) /* SWJ (SWD and JTAG) Alternate Function mapping */ 00076 #if defined(STM32L476xx) || defined(STM32L486xx) 00077 #define GPIO_AF0_LCDBIAS ((uint8_t)0x00) /* LCDBIAS Alternate Function mapping */ 00078 #endif /* STM32L476xx || STM32L486xx */ 00079 #define GPIO_AF0_TRACE ((uint8_t)0x00) /* TRACE Alternate Function mapping */ 00080 00081 /** 00082 * @brief AF 1 selection 00083 */ 00084 #define GPIO_AF1_TIM1 ((uint8_t)0x01) /* TIM1 Alternate Function mapping */ 00085 #define GPIO_AF1_TIM2 ((uint8_t)0x01) /* TIM2 Alternate Function mapping */ 00086 #define GPIO_AF1_TIM5 ((uint8_t)0x01) /* TIM5 Alternate Function mapping */ 00087 #define GPIO_AF1_TIM8 ((uint8_t)0x01) /* TIM8 Alternate Function mapping */ 00088 #define GPIO_AF1_LPTIM1 ((uint8_t)0x01) /* LPTIM1 Alternate Function mapping */ 00089 #define GPIO_AF1_IR ((uint8_t)0x01) /* IR Alternate Function mapping */ 00090 00091 /** 00092 * @brief AF 2 selection 00093 */ 00094 #define GPIO_AF2_TIM1 ((uint8_t)0x02) /* TIM1 Alternate Function mapping */ 00095 #define GPIO_AF2_TIM2 ((uint8_t)0x02) /* TIM2 Alternate Function mapping */ 00096 #define GPIO_AF2_TIM3 ((uint8_t)0x02) /* TIM3 Alternate Function mapping */ 00097 #define GPIO_AF2_TIM4 ((uint8_t)0x02) /* TIM4 Alternate Function mapping */ 00098 #define GPIO_AF2_TIM5 ((uint8_t)0x02) /* TIM5 Alternate Function mapping */ 00099 00100 /** 00101 * @brief AF 3 selection 00102 */ 00103 #define GPIO_AF3_TIM8 ((uint8_t)0x03) /* TIM8 Alternate Function mapping */ 00104 #define GPIO_AF3_TIM1_COMP2 ((uint8_t)0x03) /* TIM1/COMP2 Break in Alternate Function mapping */ 00105 #define GPIO_AF3_TIM1_COMP1 ((uint8_t)0x03) /* TIM1/COMP1 Break in Alternate Function mapping */ 00106 00107 /** 00108 * @brief AF 4 selection 00109 */ 00110 #define GPIO_AF4_I2C1 ((uint8_t)0x04) /* I2C1 Alternate Function mapping */ 00111 #define GPIO_AF4_I2C2 ((uint8_t)0x04) /* I2C2 Alternate Function mapping */ 00112 #define GPIO_AF4_I2C3 ((uint8_t)0x04) /* I2C3 Alternate Function mapping */ 00113 00114 /** 00115 * @brief AF 5 selection 00116 */ 00117 #define GPIO_AF5_SPI1 ((uint8_t)0x05) /* SPI1 Alternate Function mapping */ 00118 #define GPIO_AF5_SPI2 ((uint8_t)0x05) /* SPI2 Alternate Function mapping */ 00119 00120 /** 00121 * @brief AF 6 selection 00122 */ 00123 #define GPIO_AF6_SPI3 ((uint8_t)0x06) /* SPI3 Alternate Function mapping */ 00124 #define GPIO_AF6_DFSDM ((uint8_t)0x06) /* DFSDM Alternate Function mapping */ 00125 00126 /** 00127 * @brief AF 7 selection 00128 */ 00129 #define GPIO_AF7_USART1 ((uint8_t)0x07) /* USART1 Alternate Function mapping */ 00130 #define GPIO_AF7_USART2 ((uint8_t)0x07) /* USART2 Alternate Function mapping */ 00131 #define GPIO_AF7_USART3 ((uint8_t)0x07) /* USART3 Alternate Function mapping */ 00132 00133 /** 00134 * @brief AF 8 selection 00135 */ 00136 #define GPIO_AF8_UART4 ((uint8_t)0x08) /* UART4 Alternate Function mapping */ 00137 #define GPIO_AF8_UART5 ((uint8_t)0x08) /* UART5 Alternate Function mapping */ 00138 #define GPIO_AF8_LPUART1 ((uint8_t)0x08) /* LPUART1 Alternate Function mapping */ 00139 00140 /** 00141 * @brief AF 9 selection 00142 */ 00143 #define GPIO_AF9_CAN1 ((uint8_t)0x09) /* CAN1 Alternate Function mapping */ 00144 #define GPIO_AF9_TSC ((uint8_t)0x09) /* TSC Alternate Function mapping */ 00145 00146 /** 00147 * @brief AF 10 selection 00148 */ 00149 #if defined(STM32L475xx) || defined(STM32L476xx) || defined(STM32L485xx) || defined(STM32L486xx) 00150 #define GPIO_AF10_OTG_FS ((uint8_t)0xA) /* OTG_FS Alternate Function mapping */ 00151 #endif /* STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ 00152 #define GPIO_AF10_QUADSPI ((uint8_t)0xA) /* QUADSPI Alternate Function mapping */ 00153 00154 #if defined(STM32L476xx) || defined(STM32L486xx) 00155 /** 00156 * @brief AF 11 selection 00157 */ 00158 #define GPIO_AF11_LCD ((uint8_t)0x0B) /* LCD Alternate Function mapping */ 00159 #endif /* STM32L476xx || STM32L486xx */ 00160 00161 /** 00162 * @brief AF 12 selection 00163 */ 00164 #define GPIO_AF12_FMC ((uint8_t)0xC) /* FMC Alternate Function mapping */ 00165 #define GPIO_AF12_SWPMI1 ((uint8_t)0xC) /* SWPMI1 Alternate Function mapping */ 00166 #define GPIO_AF12_COMP1 ((uint8_t)0xC) /* COMP1 Alternate Function mapping */ 00167 #define GPIO_AF12_COMP2 ((uint8_t)0xC) /* COMP2 Alternate Function mapping */ 00168 #define GPIO_AF12_SDMMC1 ((uint8_t)0xC) /* SDMMC1 Alternate Function mapping */ 00169 00170 /** 00171 * @brief AF 13 selection 00172 */ 00173 #define GPIO_AF13_SAI1 ((uint8_t)0x0D) /* SAI1 Alternate Function mapping */ 00174 #define GPIO_AF13_SAI2 ((uint8_t)0x0D) /* SAI2 Alternate Function mapping */ 00175 #define GPIO_AF13_TIM8_COMP2 ((uint8_t)0x0D) /* TIM8/COMP2 Break in Alternate Function mapping */ 00176 #define GPIO_AF13_TIM8_COMP1 ((uint8_t)0x0D) /* TIM8/COMP1 Break in Alternate Function mapping */ 00177 00178 /** 00179 * @brief AF 14 selection 00180 */ 00181 #define GPIO_AF14_TIM2 ((uint8_t)0x0E) /* TIM2 Alternate Function mapping */ 00182 #define GPIO_AF14_TIM15 ((uint8_t)0x0E) /* TIM15 Alternate Function mapping */ 00183 #define GPIO_AF14_TIM16 ((uint8_t)0x0E) /* TIM16 Alternate Function mapping */ 00184 #define GPIO_AF14_TIM17 ((uint8_t)0x0E) /* TIM17 Alternate Function mapping */ 00185 #define GPIO_AF14_LPTIM2 ((uint8_t)0x0E) /* LPTIM2 Alternate Function mapping */ 00186 #define GPIO_AF14_TIM8_COMP1 ((uint8_t)0x0E) /* TIM8/COMP1 Break in Alternate Function mapping */ 00187 00188 /** 00189 * @brief AF 15 selection 00190 */ 00191 #define GPIO_AF15_EVENTOUT ((uint8_t)0x0F) /* EVENTOUT Alternate Function mapping */ 00192 00193 #define IS_GPIO_AF(AF) ((AF) <= (uint8_t)0x0F) 00194 00195 #endif /* STM32L471xx || STM32L475xx || STM32L476xx || STM32L485xx || STM32L486xx */ 00196 00197 /** 00198 * @} 00199 */ 00200 00201 /** 00202 * @} 00203 */ 00204 00205 /* Exported macro ------------------------------------------------------------*/ 00206 /** @defgroup GPIOEx_Exported_Macros GPIOEx Exported Macros 00207 * @{ 00208 */ 00209 00210 /** @defgroup GPIOEx_Get_Port_Index GPIOEx_Get Port Index 00211 * @{ 00212 */ 00213 #define GPIO_GET_INDEX(__GPIOx__) (((__GPIOx__) == (GPIOA))? 0U :\ 00214 ((__GPIOx__) == (GPIOB))? 1U :\ 00215 ((__GPIOx__) == (GPIOC))? 2U :\ 00216 ((__GPIOx__) == (GPIOD))? 3U :\ 00217 ((__GPIOx__) == (GPIOE))? 4U :\ 00218 ((__GPIOx__) == (GPIOF))? 5U :\ 00219 ((__GPIOx__) == (GPIOG))? 6U : 7U) 00220 00221 00222 /** 00223 * @} 00224 */ 00225 00226 /** 00227 * @} 00228 */ 00229 00230 /* Exported functions --------------------------------------------------------*/ 00231 /** 00232 * @} 00233 */ 00234 00235 /** 00236 * @} 00237 */ 00238 00239 #ifdef __cplusplus 00240 } 00241 #endif 00242 00243 #endif /* __STM32L4xx_HAL_GPIO_EX_H */ 00244 00245 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 00246
Generated on Tue Jul 12 2022 11:35:10 by 1.7.2