stm32f4xx_hal_gpio.c 20 KB

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