stm32l1xx_hal_gpio.c 20 KB

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