怎样判断STM32外部中断是由哪个引脚引起的

使用函数:__HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__)具体用法解释如下:

/**
  * @brief  Checks whether the specified EXTI line is asserted or not.
  * @param  __EXTI_LINE__: specifies the EXTI line to check.
  *          This parameter can be GPIO_PIN_x where x can be(0..15)
  * @retval The new state of __EXTI_LINE__ (SET or RESET).
  */
#define __HAL_GPIO_EXTI_GET_IT(__EXTI_LINE__) (EXTI->PR & (__EXTI_LINE__))
 

你可能感兴趣的:(stm32,嵌入式硬件,单片机)