1.void EXTI_DeInit(void);
函数解释:EXTI的反初始化函数,即恢复默认状态。
参数解释:无参数
2.void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
函数解释:EXTI的初始化函数
参数解释:注意要加&号
3.void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
函数解释:
将EXTI_InitStruct结构体中各成员按照默认值填充。只填充了结构体,还没有将参数写入到寄存器中(xxx_Init)。
例子:EXTI_StructInit (&EXTI_InitStruct);
温馨提示:EXTI_InitStruct的默认值如下
EXTI_Line:EXTI_LineNone
EXTI_Mode:EXTI_Mode_Interrupt
EXTI_Trigger:EXTI_Trigger_Falling
EXTI_LineCmd:DISABLE
参数解释:注意加&号
4.void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
函数解释: 产生一个软件中断。
参数解释:无
例如:EXTI_GenerateSWInterrupt(EXTI_Line1);
可以选择的参数有:#define EXTI_Line0 ((uint32_t)0x00001) /*!< External interrupt line 0 */
#define EXTI_Line1 ((uint32_t)0x00002) /*!< External interrupt line 1 */
#define EXTI_Line2 ((uint32_t)0x00004) /*!< External interrupt line 2 */
#define EXTI_Line3 ((uint32_t)0x00008) /*!< External interrupt line 3 */
#define EXTI_Line4 ((uint32_t)0x00010) /*!< External interrupt line 4 */
#define EXTI_Line5 ((uint32_t)0x00020) /*!< External interrupt line 5 */
#define EXTI_Line6 ((uint32_t)0x00040) /*!< External interrupt line 6 */
#define EXTI_Line7 ((uint32_t)0x00080) /*!< External interrupt line 7 */
#define EXTI_Line8 ((uint32_t)0x00100) /*!< External interrupt line 8 */
#define EXTI_Line9 ((uint32_t)0x00200) /*!< External interrupt line 9 */
#define EXTI_Line10 ((uint32_t)0x00400) /*!< External interrupt line 10 */
#define EXTI_Line11 ((uint32_t)0x00800) /*!< External interrupt line 11 */
#define EXTI_Line12 ((uint32_t)0x01000) /*!< External interrupt line 12 */
#define EXTI_Line13 ((uint32_t)0x02000) /*!< External interrupt line 13 */
#define EXTI_Line14 ((uint32_t)0x04000) /*!< External interrupt line 14 */
#define EXTI_Line15 ((uint32_t)0x08000) /*!< External interrupt line 15 */
#define EXTI_Line16 ((uint32_t)0x10000) /*!< External interrupt line 16 Connected to the PVD Output */
#define EXTI_Line17 ((uint32_t)0x20000) /*!< External interrupt line 17 Connected to the RTC Alarm event */
#define EXTI_Line18 ((uint32_t)0x40000) /*!< External interrupt line 18 Connected to the USB Device/USB OTG FS
Wakeup from suspend event */
#define EXTI_Line19 ((uint32_t)0x80000) /*!< External interrupt line 19 Connected to the Ethernet Wakeup event */
5.FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
函数解释:检查指定的外部中断线的标志是否被置位。
注释:该函数没有检查EXTI_IMR和EXTI_EMR状态,它只是纯粹读取中断标志位的状态,但是不一定会响应中断
中断发生有两个条件,一是中断标志位置位,二是中断允许。
参数解释:无
6.void EXTI_ClearFlag(uint32_t EXTI_Line);
函数解释:清除EXTI线路的挂起标志位。
例如:EXTI_ClearFlag(EXTI_Line6);
参数解释:无
7.ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
函数解释:检查指定外部中断线的状态是否有效,检查中断状态,检查中断是否发生。
例如:ITStatus EXTIStatus;
EXTIStatus= EXTI_GetITStatus ( EXTI_Line6);
参数解释:无
8.void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
函数解释:清除EXTI线路的挂起位。
例如:EXTI_ClearITPendingBit(EXTI_Line6);
参数解释:无
标签:STM32,External,interrupt,line,define,uint32,EXTI,库函数 From: https://blog.csdn.net/2302_81647853/article/details/140438282