stm32l0xx_hal_gpio.c 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546
  1. /**
  2. ******************************************************************************
  3. * @file stm32l0xx_hal_gpio.c
  4. * @author MCD Application Team
  5. * @version V1.7.0
  6. * @date 31-May-2016
  7. * @brief GPIO HAL module driver.
  8. * This file provides firmware functions to manage the following
  9. * functionalities of the General Purpose Input/Output (GPIO) peripheral:
  10. * + Initialization and de-initialization functions
  11. * + IO operation functions
  12. *
  13. @verbatim
  14. ==============================================================================
  15. ##### GPIO Peripheral features #####
  16. ==============================================================================
  17. [..]
  18. (+) Each port bit of the general-purpose I/O (GPIO) ports can be individually
  19. configured by software in several modes:
  20. (++) Input mode
  21. (++) Analog mode
  22. (++) Output mode
  23. (++) Alternate function mode
  24. (++) External interrupt/event lines
  25. (+) During and just after reset, the alternate functions and external interrupt
  26. lines are not active and the I/O ports are configured in input floating mode.
  27. (+) All GPIO pins have weak internal pull-up and pull-down resistors, which can be
  28. activated or not.
  29. (+) In Output or Alternate mode, each IO can be configured on open-drain or push-pull
  30. type and the IO speed can be selected depending on the VDD value.
  31. (+) The microcontroller IO pins are connected to onboard peripherals/modules through a
  32. multiplexer that allows only one peripheral alternate function (AF) connected
  33. to an IO pin at a time. In this way, there can be no conflict between peripherals
  34. sharing the same IO pin.
  35. (+) All ports have external interrupt/event capability. To use external interrupt
  36. lines, the port must be configured in input mode. All available GPIO pins are
  37. connected to the 16 external interrupt/event lines from EXTI0 to EXTI15.
  38. (+) The external interrupt/event controller consists of up to 28 edge detectors
  39. (16 lines are connected to GPIO) for generating event/interrupt requests (each
  40. input line can be independently configured to select the type (interrupt or event)
  41. and the corresponding trigger event (rising or falling or both). Each line can
  42. also be masked independently.
  43. ##### How to use this driver #####
  44. ==============================================================================
  45. [..]
  46. (#) Enable the GPIO IOPORT clock using the following function: __HAL_RCC_GPIOx_CLK_ENABLE().
  47. (#) Configure the GPIO pin(s) using HAL_GPIO_Init().
  48. (++) Configure the IO mode using "Mode" member from GPIO_InitTypeDef structure
  49. (++) Activate Pull-up, Pull-down resistor using "Pull" member from GPIO_InitTypeDef
  50. structure.
  51. (++) In case of Output or alternate function mode selection: the speed is
  52. configured through "Speed" member from GPIO_InitTypeDef structure.
  53. (++) In alternate mode is selection, the alternate function connected to the IO
  54. is configured through "Alternate" member from GPIO_InitTypeDef structure.
  55. (++) Analog mode is required when a pin is to be used as ADC channel
  56. or DAC output.
  57. (++) In case of external interrupt/event selection the "Mode" member from
  58. GPIO_InitTypeDef structure select the type (interrupt or event) and
  59. the corresponding trigger event (rising or falling or both).
  60. (#) In case of external interrupt/event mode selection, configure NVIC IRQ priority
  61. mapped to the EXTI line using HAL_NVIC_SetPriority() and enable it using
  62. HAL_NVIC_EnableIRQ().
  63. (#) HAL_GPIO_DeInit allows to set register values to their reset value. This function
  64. is also to be used when unconfiguring pin which was used as an external interrupt
  65. or in event mode. That is the only way to reset the corresponding bit in
  66. EXTI & SYSCFG registers.
  67. (#) To get the level of a pin configured in input mode use HAL_GPIO_ReadPin().
  68. (#) To set/reset the level of a pin configured in output mode use
  69. HAL_GPIO_WritePin()/HAL_GPIO_TogglePin().
  70. (#) To lock pin configuration until next reset use HAL_GPIO_LockPin().
  71. (#) During and just after reset, the alternate functions are not
  72. active and the GPIO pins are configured in input floating mode (except JTAG
  73. pins).
  74. (#) The LSE oscillator pins OSC32_IN and OSC32_OUT can be used as general purpose
  75. (PC14 and PC15, respectively) when the LSE oscillator is off. The LSE has
  76. priority over the GPIO function.
  77. (#) The HSE oscillator pins OSC_IN/OSC_OUT can be used as
  78. general purpose PH0 and PH1, respectively, when the HSE oscillator is off.
  79. The HSE has priority over the GPIO function.
  80. @endverbatim
  81. ******************************************************************************
  82. * @attention
  83. *
  84. * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2>
  85. *
  86. * Redistribution and use in source and binary forms, with or without modification,
  87. * are permitted provided that the following conditions are met:
  88. * 1. Redistributions of source code must retain the above copyright notice,
  89. * this list of conditions and the following disclaimer.
  90. * 2. Redistributions in binary form must reproduce the above copyright notice,
  91. * this list of conditions and the following disclaimer in the documentation
  92. * and/or other materials provided with the distribution.
  93. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  94. * may be used to endorse or promote products derived from this software
  95. * without specific prior written permission.
  96. *
  97. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  98. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  99. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  100. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  101. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  102. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  103. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  104. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  105. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  106. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  107. *
  108. ******************************************************************************
  109. */
  110. /* Includes ------------------------------------------------------------------*/
  111. #include "stm32l0xx_hal.h"
  112. /** @addtogroup STM32L0xx_HAL_Driver
  113. * @{
  114. */
  115. #ifdef HAL_GPIO_MODULE_ENABLED
  116. /** @addtogroup GPIO
  117. * @brief GPIO HAL module driver
  118. * @{
  119. */
  120. /** @addtogroup GPIO_Private
  121. * @{
  122. */
  123. /* Private define ------------------------------------------------------------*/
  124. #define GPIO_MODE ((uint32_t)0x00000003U)
  125. #define EXTI_MODE ((uint32_t)0x10000000U)
  126. #define GPIO_MODE_IT ((uint32_t)0x00010000U)
  127. #define GPIO_MODE_EVT ((uint32_t)0x00020000U)
  128. #define RISING_EDGE ((uint32_t)0x00100000U)
  129. #define FALLING_EDGE ((uint32_t)0x00200000U)
  130. #define GPIO_OUTPUT_TYPE ((uint32_t)0x00000010U)
  131. #define GPIO_NUMBER ((uint32_t)16U)
  132. /**
  133. * @}
  134. */
  135. /** @addtogroup GPIO_Exported_Functions
  136. * @{
  137. */
  138. /** @addtogroup GPIO_Exported_Functions_Group1
  139. * @brief Initialization and de-initialization functions
  140. *
  141. @verbatim
  142. ===============================================================================
  143. ##### Initialization and de-initialization functions #####
  144. ===============================================================================
  145. @endverbatim
  146. * @{
  147. */
  148. /**
  149. * @brief Initializes the GPIOx peripheral according to the specified parameters in the GPIO_Init.
  150. * @param GPIOx: where x can be (A..E and H) to select the GPIO peripheral for STM32L0XX family devices.
  151. * Note that GPIOE is not available on all devices.
  152. * @param GPIO_Init: pointer to a GPIO_InitTypeDef structure that contains
  153. * the configuration information for the specified GPIO peripheral.
  154. * @retval None
  155. */
  156. void HAL_GPIO_Init(GPIO_TypeDef *GPIOx, GPIO_InitTypeDef *GPIO_Init)
  157. {
  158. uint32_t position = 0x00U;
  159. uint32_t iocurrent = 0x00U;
  160. uint32_t temp = 0x00U;
  161. /* Check the parameters */
  162. assert_param(IS_GPIO_MODE(GPIO_Init->Mode));
  163. assert_param(IS_GPIO_PULL(GPIO_Init->Pull));
  164. assert_param(IS_GPIO_PIN_AVAILABLE(GPIOx,(GPIO_Init->Pin)));
  165. /* Configure the port pins */
  166. while ((GPIO_Init->Pin) >> position)
  167. {
  168. /* Get the IO position */
  169. iocurrent = (GPIO_Init->Pin) & (1U << position);
  170. if(iocurrent)
  171. {
  172. /*--------------------- GPIO Mode Configuration ------------------------*/
  173. /* In case of Alternate function mode selection */
  174. if((GPIO_Init->Mode == GPIO_MODE_AF_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
  175. {
  176. /* Check if the Alternate function is compliant with the GPIO in use */
  177. assert_param(IS_GPIO_AF_AVAILABLE(GPIOx,(GPIO_Init->Alternate)));
  178. /* Configure Alternate function mapped with the current IO */
  179. temp = GPIOx->AFR[position >> 3U];
  180. temp &= ~((uint32_t)0xFU << ((uint32_t)(position & (uint32_t)0x07U) * 4U)) ;
  181. temp |= ((uint32_t)(GPIO_Init->Alternate) << (((uint32_t)position & (uint32_t)0x07U) * 4U)) ;
  182. GPIOx->AFR[position >> 3U] = temp;
  183. }
  184. /* In case of Output or Alternate function mode selection */
  185. if((GPIO_Init->Mode == GPIO_MODE_OUTPUT_PP) || (GPIO_Init->Mode == GPIO_MODE_AF_PP) ||
  186. (GPIO_Init->Mode == GPIO_MODE_OUTPUT_OD) || (GPIO_Init->Mode == GPIO_MODE_AF_OD))
  187. {
  188. /* Check the Speed parameter */
  189. assert_param(IS_GPIO_SPEED(GPIO_Init->Speed));
  190. /* Configure the IO Speed */
  191. temp = GPIOx->OSPEEDR;
  192. temp &= ~(GPIO_OSPEEDER_OSPEED0 << (position * 2U));
  193. temp |= (GPIO_Init->Speed << (position * 2U));
  194. GPIOx->OSPEEDR = temp;
  195. /* Configure the IO Output Type */
  196. temp= GPIOx->OTYPER;
  197. temp &= ~(GPIO_OTYPER_OT_0 << position) ;
  198. temp |= (((GPIO_Init->Mode & GPIO_OUTPUT_TYPE) >> 4U) << position);
  199. GPIOx->OTYPER = temp;
  200. }
  201. /* Configure IO Direction mode (Input, Output, Alternate or Analog) */
  202. temp = GPIOx->MODER;
  203. temp &= ~(GPIO_MODER_MODE0 << (position * 2U));
  204. temp |= ((GPIO_Init->Mode & GPIO_MODE) << (position * 2U));
  205. GPIOx->MODER = temp;
  206. /* Activate the Pull-up or Pull down resistor for the current IO */
  207. temp = GPIOx->PUPDR;
  208. temp &= ~(GPIO_PUPDR_PUPD0 << (position * 2U));
  209. temp |= ((GPIO_Init->Pull) << (position * 2U));
  210. GPIOx->PUPDR = temp;
  211. /*--------------------- EXTI Mode Configuration ------------------------*/
  212. /* Configure the External Interrupt or event for the current IO */
  213. if((GPIO_Init->Mode & EXTI_MODE) == EXTI_MODE)
  214. {
  215. /* Enable SYSCFG Clock */
  216. __HAL_RCC_SYSCFG_CLK_ENABLE();
  217. temp = SYSCFG->EXTICR[position >> 2U];
  218. temp &= ~(((uint32_t)0x0FU) << (4U * (position & 0x03U)));
  219. temp |= ((uint32_t)(GPIO_GET_INDEX(GPIOx)) << (4U * (position & 0x03U)));
  220. SYSCFG->EXTICR[position >> 2U] = temp;
  221. /* Clear EXTI line configuration */
  222. temp = EXTI->IMR;
  223. temp &= ~((uint32_t)iocurrent);
  224. if((GPIO_Init->Mode & GPIO_MODE_IT) == GPIO_MODE_IT)
  225. {
  226. temp |= iocurrent;
  227. }
  228. EXTI->IMR = temp;
  229. temp = EXTI->EMR;
  230. temp &= ~((uint32_t)iocurrent);
  231. if((GPIO_Init->Mode & GPIO_MODE_EVT) == GPIO_MODE_EVT)
  232. {
  233. temp |= iocurrent;
  234. }
  235. EXTI->EMR = temp;
  236. /* Clear Rising Falling edge configuration */
  237. temp = EXTI->RTSR;
  238. temp &= ~((uint32_t)iocurrent);
  239. if((GPIO_Init->Mode & RISING_EDGE) == RISING_EDGE)
  240. {
  241. temp |= iocurrent;
  242. }
  243. EXTI->RTSR = temp;
  244. temp = EXTI->FTSR;
  245. temp &= ~((uint32_t)iocurrent);
  246. if((GPIO_Init->Mode & FALLING_EDGE) == FALLING_EDGE)
  247. {
  248. temp |= iocurrent;
  249. }
  250. EXTI->FTSR = temp;
  251. }
  252. }
  253. position++;
  254. }
  255. }
  256. /**
  257. * @brief De-initializes the GPIOx peripheral registers to their default reset values.
  258. * @param GPIOx: where x can be (A..E and H) to select the GPIO peripheral for STM32L0XX family devices.
  259. * Note that GPIOE is not available on all devices.
  260. * @param GPIO_Pin: specifies the port bit to be written.
  261. * This parameter can be one of GPIO_PIN_x where x can be (0..15).
  262. * All port bits are not necessarily available on all GPIOs.
  263. * @retval None
  264. */
  265. void HAL_GPIO_DeInit(GPIO_TypeDef *GPIOx, uint32_t GPIO_Pin)
  266. {
  267. uint32_t position = 0x00U;
  268. uint32_t iocurrent = 0x00U;
  269. uint32_t tmp = 0x00U;
  270. /* Check the parameters */
  271. assert_param(IS_GPIO_PIN_AVAILABLE(GPIOx,GPIO_Pin));
  272. /* Configure the port pins */
  273. while (GPIO_Pin >> position)
  274. {
  275. /* Get the IO position */
  276. iocurrent = (GPIO_Pin) & (1U << position);
  277. if(iocurrent)
  278. {
  279. /*------------------------- GPIO Mode Configuration --------------------*/
  280. /* Configure IO Direction in Input Floting Mode */
  281. GPIOx->MODER &= ~(GPIO_MODER_MODE0 << (position * 2U));
  282. /* Configure the default Alternate Function in current IO */
  283. GPIOx->AFR[position >> 3U] &= ~((uint32_t)0xFU << ((uint32_t)(position & (uint32_t)0x07U) * 4U)) ;
  284. /* Configure the default value for IO Speed */
  285. GPIOx->OSPEEDR &= ~(GPIO_OSPEEDER_OSPEED0 << (position * 2U));
  286. /* Configure the default value IO Output Type */
  287. GPIOx->OTYPER &= ~(GPIO_OTYPER_OT_0 << position) ;
  288. /* Deactivate the Pull-up oand Pull-down resistor for the current IO */
  289. GPIOx->PUPDR &= ~(GPIO_PUPDR_PUPD0 << (position * 2U));
  290. /*------------------------- EXTI Mode Configuration --------------------*/
  291. /* Clear the External Interrupt or Event for the current IO */
  292. tmp = SYSCFG->EXTICR[position >> 2U];
  293. tmp &= (((uint32_t)0x0FU) << (4U * (position & 0x03U)));
  294. if(tmp == (GPIO_GET_INDEX(GPIOx) << (4U * (position & 0x03U))))
  295. {
  296. tmp = ((uint32_t)0x0FU) << (4U * (position & 0x03U));
  297. SYSCFG->EXTICR[position >> 2U] &= ~tmp;
  298. /* Clear EXTI line configuration */
  299. EXTI->IMR &= ~((uint32_t)iocurrent);
  300. EXTI->EMR &= ~((uint32_t)iocurrent);
  301. /* Clear Rising Falling edge configuration */
  302. EXTI->RTSR &= ~((uint32_t)iocurrent);
  303. EXTI->FTSR &= ~((uint32_t)iocurrent);
  304. }
  305. }
  306. position++;
  307. }
  308. }
  309. /**
  310. * @}
  311. */
  312. /** @addtogroup GPIO_Exported_Functions_Group2
  313. * @brief GPIO Read and Write
  314. *
  315. @verbatim
  316. ===============================================================================
  317. ##### IO operation functions #####
  318. ===============================================================================
  319. @endverbatim
  320. * @{
  321. */
  322. /**
  323. * @brief Reads the specified input port pin.
  324. * @param GPIOx: where x can be (A..E and H) to select the GPIO peripheral for STM32L0xx family devices.
  325. * Note that GPIOE is not available on all devices.
  326. * @param GPIO_Pin: specifies the port bit to read.
  327. * This parameter can be GPIO_PIN_x where x can be (0..15).
  328. * All port bits are not necessarily available on all GPIOs.
  329. * @retval The input port pin value.
  330. */
  331. GPIO_PinState HAL_GPIO_ReadPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
  332. {
  333. GPIO_PinState bitstatus;
  334. /* Check the parameters */
  335. assert_param(IS_GPIO_PIN_AVAILABLE(GPIOx,GPIO_Pin));
  336. if((GPIOx->IDR & GPIO_Pin) != (uint32_t)GPIO_PIN_RESET)
  337. {
  338. bitstatus = GPIO_PIN_SET;
  339. }
  340. else
  341. {
  342. bitstatus = GPIO_PIN_RESET;
  343. }
  344. return bitstatus;
  345. }
  346. /**
  347. * @brief Sets or clears the selected data port bit.
  348. *
  349. * @note This function uses GPIOx_BSRR register to allow atomic read/modify
  350. * accesses. In this way, there is no risk of an IRQ occurring between
  351. * the read and the modify access.
  352. *
  353. * @param GPIOx: where x can be (A..E and H) to select the GPIO peripheral for STM32L0xx family devices.
  354. * Note that GPIOE is not available on all devices.
  355. * @param GPIO_Pin: specifies the port bit to be written.
  356. * This parameter can be one of GPIO_PIN_x where x can be (0..15).
  357. * All port bits are not necessarily available on all GPIOs.
  358. * @param PinState: specifies the value to be written to the selected bit.
  359. * This parameter can be one of the GPIO_PinState enum values:
  360. * GPIO_PIN_RESET: to clear the port pin
  361. * GPIO_PIN_SET: to set the port pin
  362. * @retval None
  363. */
  364. void HAL_GPIO_WritePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin, GPIO_PinState PinState)
  365. {
  366. /* Check the parameters */
  367. assert_param(IS_GPIO_PIN_AVAILABLE(GPIOx,GPIO_Pin));
  368. assert_param(IS_GPIO_PIN_ACTION(PinState));
  369. if(PinState != GPIO_PIN_RESET)
  370. {
  371. GPIOx->BSRR = GPIO_Pin;
  372. }
  373. else
  374. {
  375. GPIOx->BRR = GPIO_Pin ;
  376. }
  377. }
  378. /**
  379. * @brief Toggles the specified GPIO pins.
  380. * @param GPIOx: Where x can be (A..E and H) to select the GPIO peripheral for STM32L0xx family devices.
  381. * Note that GPIOE is not available on all devices.
  382. * All port bits are not necessarily available on all GPIOs.
  383. * @param GPIO_Pin: Specifies the pins to be toggled.
  384. * @retval None
  385. */
  386. void HAL_GPIO_TogglePin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
  387. {
  388. /* Check the parameters */
  389. assert_param(IS_GPIO_PIN_AVAILABLE(GPIOx,GPIO_Pin));
  390. GPIOx->ODR ^= GPIO_Pin;
  391. }
  392. /**
  393. * @brief Locks GPIO Pins configuration registers.
  394. * @note The locked registers are GPIOx_MODER, GPIOx_OTYPER, GPIOx_OSPEEDR,
  395. * GPIOx_PUPDR, GPIOx_AFRL and GPIOx_AFRH.
  396. * @note The configuration of the locked GPIO pins can no longer be modified
  397. * until the next reset.
  398. * @param GPIOx: where x can be (A..E and H) to select the GPIO peripheral for STM32L0xx family.
  399. * Note that GPIOE is not available on all devices.
  400. * @param GPIO_Pin: specifies the port bit to be locked.
  401. * This parameter can be any combination of GPIO_Pin_x where x can be (0..15).
  402. * All port bits are not necessarily available on all GPIOs.
  403. * @retval None
  404. */
  405. HAL_StatusTypeDef HAL_GPIO_LockPin(GPIO_TypeDef* GPIOx, uint16_t GPIO_Pin)
  406. {
  407. __IO uint32_t tmp = GPIO_LCKR_LCKK;
  408. /* Check the parameters */
  409. assert_param(IS_GPIO_PIN_AVAILABLE(GPIOx,GPIO_Pin));
  410. /* Apply lock key write sequence */
  411. tmp |= GPIO_Pin;
  412. /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */
  413. GPIOx->LCKR = tmp;
  414. /* Reset LCKx bit(s): LCKK='0' + LCK[15-0] */
  415. GPIOx->LCKR = GPIO_Pin;
  416. /* Set LCKx bit(s): LCKK='1' + LCK[15-0] */
  417. GPIOx->LCKR = tmp;
  418. /* Read LCKK bit*/
  419. tmp = GPIOx->LCKR;
  420. if((GPIOx->LCKR & GPIO_LCKR_LCKK) != RESET)
  421. {
  422. return HAL_OK;
  423. }
  424. else
  425. {
  426. return HAL_ERROR;
  427. }
  428. }
  429. /**
  430. * @brief This function handles EXTI interrupt request.
  431. * @param GPIO_Pin: Specifies the pins connected to the EXTI line.
  432. * @retval None
  433. */
  434. void HAL_GPIO_EXTI_IRQHandler(uint16_t GPIO_Pin)
  435. {
  436. /* EXTI line interrupt detected */
  437. if(__HAL_GPIO_EXTI_GET_IT(GPIO_Pin) != RESET)
  438. {
  439. __HAL_GPIO_EXTI_CLEAR_IT(GPIO_Pin);
  440. HAL_GPIO_EXTI_Callback(GPIO_Pin);
  441. }
  442. }
  443. /**
  444. * @brief EXTI line detection callbacks.
  445. * @param GPIO_Pin: Specifies the pins connected to the EXTI line.
  446. * @retval None
  447. */
  448. __weak void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin)
  449. {
  450. /* Prevent unused argument(s) compilation warning */
  451. UNUSED(GPIO_Pin);
  452. /* NOTE: This function Should not be modified, when the callback is needed,
  453. the HAL_GPIO_EXTI_Callback could be implemented in the user file
  454. */
  455. }
  456. /**
  457. * @}
  458. */
  459. /**
  460. * @}
  461. */
  462. /**
  463. * @}
  464. */
  465. #endif /* HAL_GPIO_MODULE_ENABLED */
  466. /**
  467. * @}
  468. */
  469. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/