Hal Drivers for L4
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
stm32l4xx_hal_gpio.c
00001 /** 00002 ****************************************************************************** 00003 * @file stm32l4xx_hal_gpio.c 00004 * @author MCD Application Team 00005 * @version V1.1.0 00006 * @date 16-September-2015 00007 * @brief GPIO HAL module driver. 00008 * This file provides firmware functions to manage the following 00009 * functionalities of the General Purpose Input/Output (GPIO) peripheral: 00010 * + Initialization and de-initialization functions 00011 * + IO operation functions 00012 * 00013 @verbatim 00014 ============================================================================== 00015 ##### GPIO Peripheral features ##### 00016 ============================================================================== 00017 [..] 00018 (+) Each port bit of the general-purpose I/O (GPIO) ports can be individually 00019 configured by software in several modes: 00020 (++) Input mode 00021 (++) Analog mode 00022 (++) Output mode 00023 (++) Alternate function mode 00024 (++) External interrupt/event lines 00025 00026 (+) During and just after reset, the alternate functions and external interrupt 00027 lines are not active and the I/O ports are configured in input floating mode. 00028 00029 (+) All GPIO pins have weak internal pull-up and pull-down resistors, which can be 00030 activated or not. 00031 00032 (+) In Output or Alternate mode, each IO can be configured on open-drain or push-pull 00033 type and the IO speed can be selected depending on the VDD value. 00034 00035 (+) The microcontroller IO pins are connected to onboard peripherals/modules through a 00036 multiplexer that allows only one peripheral alternate function (AF) connected 00037 to an IO pin at a time. In this way, there can be no conflict between peripherals 00038 sharing the same IO pin. 00039 00040 (+) All ports have external interrupt/event capability. To use external interrupt 00041 lines, the port must be configured in input mode. All available GPIO pins are 00042 connected to the 16 external interrupt/event lines from EXTI0 to EXTI15. 00043 00044 (+) The external interrupt/event controller consists of up to 39 edge detectors 00045 (16 lines are connected to GPIO) for generating event/interrupt requests (each 00046 input line can be independently configured to select the type (interrupt or event) 00047 and the corresponding trigger event (rising or falling or both). Each line can 00048 also be masked independently. 00049 00050 ##### How to use this driver ##### 00051 ============================================================================== 00052 [..] 00053 (#) Enable the GPIO AHB clock using the following function: __HAL_RCC_GPIOx_CLK_ENABLE(). 00054 00055 (#) Configure the GPIO pin(s) using HAL_GPIO_Init(). 00056 (++) Configure the IO mode using "Mode" member from GPIO_InitTypeDef structure 00057 (++) Activate Pull-up, Pull-down resistor using "Pull" member from GPIO_InitTypeDef 00058 structure. 00059 (++) In case of Output or alternate function mode selection: the speed is 00060 configured through "Speed" member from GPIO_InitTypeDef structure. 00061 (++) In alternate mode is selection, the alternate function connected to the IO 00062 is configured through "Alternate" member from GPIO_InitTypeDef structure. 00063 (++) Analog mode is required when a pin is to be used as ADC channel 00064 or DAC output. 00065 (++) In case of external interrupt/event selection the "Mode" member from 00066 GPIO_InitTypeDef structure select the type (interrupt or event) and 00067 the corresponding trigger event (rising or falling or both). 00068 00069 (#) In case of external interrupt/event mode selection, configure NVIC IRQ priority 00070 mapped to the EXTI line using HAL_NVIC_SetPriority() and enable it using 00071 HAL_NVIC_EnableIRQ(). 00072 00073 (#) To get the level of a pin configured in input mode use HAL_GPIO_ReadPin(). 00074 00075 (#) To set/reset the level of a pin configured in output mode use 00076 HAL_GPIO_WritePin()/HAL_GPIO_TogglePin(). 00077 00078 (#) To lock pin configuration until next reset use HAL_GPIO_LockPin(). 00079 00080 (#) During and just after reset, the alternate functions are not 00081 active and the GPIO pins are configured in input floating mode (except JTAG 00082 pins). 00083 00084 (#) The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general purpose 00085 (PC14 and PC15, respectively) when the LSE oscillator is off. The LSE has 00086 priority over the GPIO function. 00087 00088 (#) The HSE oscillator pins OSC_IN/OSC_OUT can be used as 00089 general purpose PH0 and PH1, respectively, when the HSE oscillator is off. 00090 The HSE has priority over the GPIO function. 00091 00092 @endverbatim 00093 ****************************************************************************** 00094 * @attention 00095 * 00096 * <h2><center>© COPYRIGHT(c) 2015 STMicroelectronics</center></h2> 00097 * 00098 * Redistribution and use in source and binary forms, with or without modification, 00099 * are permitted provided that the following conditions are met: 00100 * 1. Redistributions of source code must retain the above copyright notice, 00101 * this list of conditions and the following disclaimer. 00102 * 2. Redistributions in binary form must reproduce the above copyright notice, 00103 * this list of conditions and the following disclaimer in the documentation 00104 * and/or other materials provided with the distribution. 00105 * 3. Neither the name of STMicroelectronics nor the names of its contributors 00106 * may be used to endorse or promote products derived from this software 00107 * without specific prior written permission. 00108 * 00109 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00110 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00111 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 00112 * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 00113 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 00114 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 00115 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 00116 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 00117 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 00118 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 00119 * 00120 ****************************************************************************** 00121 */ 00122 00123 /* Includes ------------------------------------------------------------------*/ 00124 #include "stm32l4xx_hal.h" 00125 00126 /** @addtogroup STM32L4xx_HAL_Driver 00127 * @{ 00128 */ 00129 00130 /** @defgroup GPIO GPIO 00131 * @brief GPIO HAL module driver 00132 * @{ 00133 */ 00134 00135 #ifdef HAL_GPIO_MODULE_ENABLED 00136 00137 /* Private typedef -----------------------------------------------------------*/ 00138 /* Private defines -----------------------------------------------------------*/ 00139 /** @defgroup GPIO_Private_Defines GPIO Private Defines 00140 * @{ 00141 */ 00142 #define GPIO_MODE ((uint32_t)0x00000003) 00143 #define ANALOG_MODE ((uint32_t)0x00000008) 00144 #define EXTI_MODE ((uint32_t)0x10000000) 00145 #define GPIO_MODE_IT ((uint32_t)0x00010000) 00146 #define GPIO_MODE_EVT ((uint32_t)0x00020000) 00147 #define RISING_EDGE ((uint32_t)0x00100000) 00148 #define FALLING_EDGE ((uint32_t)0x00200000) 00149 #define GPIO_OUTPUT_TYPE ((uint32_t)0x00000010) 00150 00151 #define GPIO_NUMBER ((uint32_t)16) 00152 /** 00153 * @} 00154 */ 00155 00156 /* Private macros ------------------------------------------------------------*/ 00157 /* Private macros ------------------------------------------------------------*/ 00158 /** @defgroup GPIO_Private_Macros GPIO Private Macros 00159 * @{ 00160 */ 00161 /** 00162 * @} 00163 */ 00164 /* Private variables ---------------------------------------------------------*/ 00165 /* Private function prototypes -----------------------------------------------*/ 00166 /* Exported functions --------------------------------------------------------*/ 00167 00168 /** @defgroup GPIO_Exported_Functions GPIO Exported Functions 00169 * @{ 00170 */ 00171 00172 /** @defgroup GPIO_Exported_Functions_Group1 Initialization/de-initialization functions 00173 * @brief Initialization and Configuration functions 00174 * 00175 @verbatim 00176 =============================================================================== 00177 ##### Initialization and de-initialization functions ##### 00178 =============================================================================== 00179 00180 @endverbatim 00181 * @{ 00182 */ 00183 00184 /** 00185 * @brief Initialize the GPIOx peripheral according to the specified parameters in the GPIO_Init. 00186 * @param GPIOx: where x can be (A..H) to select the GPIO peripheral for STM32L4 family 00187 * @param GPIO_Init: pointer to a GPIO_InitTypeDef structure that contains 00188 * the configuration information for the specified GPIO peripheral. 00189 * @retval None 00190 */ 00191 void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init) 00192 { 00193 uint32_t position = 0x00; 00194 uint32_t iocurrent = 0x00; 00195 uint32_t temp = 0x00; 00196 00197 /* Check the parameters */ 00198 assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); 00199 assert_param(IS_GPIO_PIN(GPIO_Init->Pin)); 00200 assert_param(IS_GPIO_MODE(GPIO_Init->Mode)); 00201 assert_param(IS_GPIO_PULL(GPIO_Init->Pull)); 00202 00203 /* Configure the port pins */ 00204 while (((GPIO_Init->Pin) >> position) != RESET) 00205 { 00206 /* Get current io position */ 00207 iocurrent = (GPIO_Init->Pin) & (1U << position); 00208 00209 if(iocurrent) 00210 { 00211 /*--------------------- GPIO Mode Configuration ------------------------*/ 00212 /* In case of Alternate function mode selection */ 00213 if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) 00214 { 00215 /* Check the Alternate function parameters */ 00216 assert_param(IS_GPIO_AF_INSTANCE(GPIOx)); 00217 assert_param(IS_GPIO_AF(GPIO_Init->Alternate)); 00218 00219 /* Configure Alternate function mapped with the current IO */ 00220 temp = GPIOx->AFR[position >> 3]; 00221 temp &= ~((uint32_t)0xF << ((uint32_t)(position & (uint32_t)0x07) * 4)) ; 00222 temp |= ((uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & (uint32_t)0x07) * 4)); 00223 GPIOx->AFR[position >> 3] = temp; 00224 } 00225 00226 /* Configure IO Direction mode (Input, Output, Alternate or Analog) */ 00227 temp = GPIOx->MODER; 00228 temp &= ~(GPIO_MODER_MODER0 << (position * 2)); 00229 temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2)); 00230 GPIOx->MODER = temp; 00231 00232 /* In case of Output or Alternate function mode selection */ 00233 if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) || 00234 (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD)) 00235 { 00236 /* Check the Speed parameter */ 00237 assert_param(IS_GPIO_SPEED(GPIO_Init->Speed)); 00238 /* Configure the IO Speed */ 00239 temp = GPIOx->OSPEEDR; 00240 temp &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2)); 00241 temp |= (GPIO_Init->Speed << (position * 2)); 00242 GPIOx->OSPEEDR = temp; 00243 00244 /* Configure the IO Output Type */ 00245 temp = GPIOx->OTYPER; 00246 temp &= ~(GPIO_OTYPER_OT_0 << position) ; 00247 temp |= (((GPIO_Init->Mode & GPIO_OUTPUT_TYPE) >> 4) << position); 00248 GPIOx->OTYPER = temp; 00249 } 00250 00251 /* In case of Analog mode, check if ADC control mode is selected */ 00252 if((GPIO_Init->Mode & GPIO_MODE_ANALOG) == GPIO_MODE_ANALOG) 00253 { 00254 /* Configure the IO Output Type */ 00255 temp = GPIOx->ASCR; 00256 temp &= ~(GPIO_ASCR_EN_0 << position) ; 00257 temp |= (((GPIO_Init->Mode & ANALOG_MODE) >> 3) << position); 00258 GPIOx->ASCR = temp; 00259 } 00260 00261 /* Activate the Pull-up or Pull down resistor for the current IO */ 00262 temp = GPIOx->PUPDR; 00263 temp &= ~(GPIO_PUPDR_PUPDR0 << (position * 2)); 00264 temp |= ((GPIO_Init->Pull) << (position * 2)); 00265 GPIOx->PUPDR = temp; 00266 00267 /*--------------------- EXTI Mode Configuration ------------------------*/ 00268 /* Configure the External Interrupt or event for the current IO */ 00269 if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE) 00270 { 00271 /* Enable SYSCFG Clock */ 00272 __HAL_RCC_SYSCFG_CLK_ENABLE(); 00273 00274 temp = SYSCFG->EXTICR[position >> 2]; 00275 temp &= ~(((uint32_t)0x0F) << (4 * (position & 0x03))); 00276 temp |= (GPIO_GET_INDEX(GPIOx) << (4 * (position & 0x03))); 00277 SYSCFG->EXTICR[position >> 2] = temp; 00278 00279 /* Clear EXTI line configuration */ 00280 temp = EXTI->IMR1; 00281 temp &= ~((uint32_t)iocurrent); 00282 if((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT) 00283 { 00284 temp |= iocurrent; 00285 } 00286 EXTI->IMR1 = temp; 00287 00288 temp = EXTI->EMR1; 00289 temp &= ~((uint32_t)iocurrent); 00290 if((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT) 00291 { 00292 temp |= iocurrent; 00293 } 00294 EXTI->EMR1 = temp; 00295 00296 /* Clear Rising Falling edge configuration */ 00297 temp = EXTI->RTSR1; 00298 temp &= ~((uint32_t)iocurrent); 00299 if((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE) 00300 { 00301 temp |= iocurrent; 00302 } 00303 EXTI->RTSR1 = temp; 00304 00305 temp = EXTI->FTSR1; 00306 temp &= ~((uint32_t)iocurrent); 00307 if((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE) 00308 { 00309 temp |= iocurrent; 00310 } 00311 EXTI->FTSR1 = temp; 00312 } 00313 } 00314 00315 position++; 00316 } 00317 } 00318 00319 /** 00320 * @brief De-initialize the GPIOx peripheral registers to their default reset values. 00321 * @param GPIOx: where x can be (A..H) to select the GPIO peripheral for STM32L4 family 00322 * @param GPIO_Pin: specifies the port bit to be written. 00323 * This parameter can be one of GPIO_PIN_x where x can be (0..15). 00324 * @retval None 00325 */ 00326 void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin) 00327 { 00328 uint32_t position = 0x00; 00329 uint32_t iocurrent = 0x00; 00330 uint32_t tmp = 0x00; 00331 00332 /* Check the parameters */ 00333 assert_param(IS_GPIO_ALL_INSTANCE(GPIOx)); 00334 assert_param(IS_GPIO_PIN(GPIO_Pin)); 00335 00336 /* Configure the port pins */ 00337 while ((GPIO_Pin >> position) != RESET) 00338 { 00339 /* Get current io position */ 00340 iocurrent = (GPIO_Pin) & (1U << position); 00341 00342 if (iocurrent) 00343 { 00344 /*------------------------- GPIO Mode Configuration --------------------*/ 00345 /* Configure IO in Analog Mode */ 00346 GPIOx->MODER |= (GPIO_MODER_MODER0 << (position * 2)); 00347 00348 /* Configure the default Alternate Function in current IO */ 00349 GPIOx->AFR[position >> 3] &= ~((uint32_t)0xF << ((uint32_t)(position & (uint32_t)0x07) * 4)) ; 00350 00351 /* Configure the default value for IO Speed */ 00352 GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEEDR0 << (position * 2)); 00353 00354 /* Configure the default value IO Output Type */ 00355 GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position) ; 00356 00357 /* Deactivate the Pull-up and Pull-down resistor for the current IO */ 00358 GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPDR0 << (position * 2)); 00359 00360 /* Deactivate the Control bit of Analog mode for the current IO */ 00361 GPIOx->ASCR &= ~(GPIO_ASCR_EN_0<< position); 00362 00363 /*------------------------- EXTI Mode Configuration --------------------*/ 00364 /* Clear the External Interrupt or Event for the current IO */ 00365 00366 tmp = SYSCFG->EXTICR[position >> 2]; 00367 tmp &= (((uint32_t)0x0F) << (4 * (position & 0x03))); 00368 if(tmp == (GPIO_GET_INDEX(GPIOx) << (4 * (position & 0x03)))) 00369 { 00370 tmp = ((uint32_t)0x0F) << (4 * (position & 0x03)); 00371 SYSCFG->EXTICR[position >> 2] &= ~tmp; 00372 00373 /* Clear EXTI line configuration */ 00374 EXTI->IMR1 &= ~((uint32_t)iocurrent); 00375 EXTI->EMR1 &= ~((uint32_t)iocurrent); 00376 00377 /* Clear Rising Falling edge configuration */ 00378 EXTI->RTSR1 &= ~((uint32_t)iocurrent); 00379 EXTI->FTSR1 &= ~((uint32_t)iocurrent); 00380 } 00381 } 00382 00383 position++; 00384 } 00385 } 00386 00387 /** 00388 * @} 00389 */ 00390 00391 /** @defgroup GPIO_Exported_Functions_Group2 IO operation functions 00392 * @brief GPIO Read, Write, Toggle, Lock and EXTI management functions. 00393 * 00394 @verbatim 00395 =============================================================================== 00396 ##### IO operation functions ##### 00397 =============================================================================== 00398 00399 @endverbatim 00400 * @{ 00401 */ 00402 00403 /** 00404 * @brief Read the specified input port pin. 00405 * @param GPIOx: where x can be (A..H) to select the GPIO peripheral for STM32L4 family 00406 * @param GPIO_Pin: specifies the port bit to read. 00407 * This parameter can be GPIO_PIN_x where x can be (0..15). 00408 * @retval The input port pin value. 00409 */ 00410 GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) 00411 { 00412 GPIO_PinState bitstatus; 00413 00414 /* Check the parameters */ 00415 assert_param(IS_GPIO_PIN(GPIO_Pin)); 00416 00417 if((GPIOx->IDR & GPIO_Pin) != (uint32_t)GPIO_PIN_RESET) 00418 { 00419 bitstatus = GPIO_PIN_SET; 00420 } 00421 else 00422 { 00423 bitstatus = GPIO_PIN_RESET; 00424 } 00425 return bitstatus; 00426 } 00427 00428 /** 00429 * @brief Set or clear the selected data port bit. 00430 * 00431 * @note This function uses GPIOx_BSRR and GPIOx_BRR registers to allow atomic read/modify 00432 * accesses. In this way, there is no risk of an IRQ occurring between 00433 * the read and the modify access. 00434 * 00435 * @param GPIOx: where x can be (A..H) to select the GPIO peripheral for STM32L4 family 00436 * @param GPIO_Pin: specifies the port bit to be written. 00437 * This parameter can be one of GPIO_PIN_x where x can be (0..15). 00438 * @param PinState: specifies the value to be written to the selected bit. 00439 * This parameter can be one of the GPIO_PinState enum values: 00440 * @arg GPIO_PIN_RESET: to clear the port pin 00441 * @arg GPIO_PIN_SET: to set the port pin 00442 * @retval None 00443 */ 00444 void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState) 00445 { 00446 /* Check the parameters */ 00447 assert_param(IS_GPIO_PIN(GPIO_Pin)); 00448 assert_param(IS_GPIO_PIN_ACTION(PinState)); 00449 00450 if(PinState != GPIO_PIN_RESET) 00451 { 00452 GPIOx->BSRR = (uint32_t)GPIO_Pin; 00453 } 00454 else 00455 { 00456 GPIOx->BRR = (uint32_t)GPIO_Pin; 00457 } 00458 } 00459 00460 /** 00461 * @brief Toggle the specified GPIO pin. 00462 * @param GPIOx: where x can be (A..H) to select the GPIO peripheral for STM32L4 family 00463 * @param GPIO_Pin: specifies the pin to be toggled. 00464 * @retval None 00465 */ 00466 void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) 00467 { 00468 /* Check the parameters */ 00469 assert_param(IS_GPIO_PIN(GPIO_Pin)); 00470 00471 GPIOx->ODR ^= GPIO_Pin; 00472 } 00473 00474 /** 00475 * @brief Lock GPIO Pins configuration registers. 00476 * @note The locked registers are GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR, 00477 * GPIOx_PUPDR, GPIOx_AFRL and GPIOx_AFRH. 00478 * @note The configuration of the locked GPIO pins can no longer be modified 00479 * until the next reset. 00480 * @param GPIOx: where x can be (A..H) to select the GPIO peripheral for STM32L4 family 00481 * @param GPIO_Pin: specifies the port bits to be locked. 00482 * This parameter can be any combination of GPIO_Pin_x where x can be (0..15). 00483 * @retval None 00484 */ 00485 HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin) 00486 { 00487 __IO uint32_t tmp = GPIO_LCKR_LCKK; 00488 00489 /* Check the parameters */ 00490 assert_param(IS_GPIO_LOCK_INSTANCE(GPIOx)); 00491 assert_param(IS_GPIO_PIN(GPIO_Pin)); 00492 00493 /* Apply lock key write sequence */ 00494 tmp |= GPIO_Pin; 00495 /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */ 00496 GPIOx->LCKR = tmp; 00497 /* Reset LCKx bit(s): LCKK='0' + LCK[15-0] */ 00498 GPIOx->LCKR = GPIO_Pin; 00499 /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */ 00500 GPIOx->LCKR = tmp; 00501 /* Read LCKK bit*/ 00502 tmp = GPIOx->LCKR; 00503 00504 if((GPIOx->LCKR & GPIO_LCKR_LCKK) != RESET) 00505 { 00506 return HAL_OK; 00507 } 00508 else 00509 { 00510 return HAL_ERROR; 00511 } 00512 } 00513 00514 /** 00515 * @brief Handle EXTI interrupt request. 00516 * @param GPIO_Pin: Specifies the port pin connected to corresponding EXTI line. 00517 * @retval None 00518 */ 00519 void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin) 00520 { 00521 /* EXTI line interrupt detected */ 00522 if(__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != RESET) 00523 { 00524 __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin); 00525 HAL_GPIO_EXTI_Callback(GPIO_Pin); 00526 } 00527 } 00528 00529 /** 00530 * @brief EXTI line detection callback. 00531 * @param GPIO_Pin: Specifies the port pin connected to corresponding EXTI line. 00532 * @retval None 00533 */ 00534 __weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) 00535 { 00536 /* NOTE: This function should not be modified, when the callback is needed, 00537 the HAL_GPIO_EXTI_Callback could be implemented in the user file 00538 */ 00539 } 00540 00541 /** 00542 * @} 00543 */ 00544 00545 00546 /** 00547 * @} 00548 */ 00549 00550 #endif /* HAL_GPIO_MODULE_ENABLED */ 00551 /** 00552 * @} 00553 */ 00554 00555 /** 00556 * @} 00557 */ 00558 00559 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/ 00560
Generated on Tue Jul 12 2022 11:35:10 by 1.7.2