WB32F10x Standard Peripherals Firmware Library

wb32f10x_exti.h
浏览该文件的文档.
1
10 /* Define to prevent recursive inclusion -------------------------------------*/
11 #ifndef __WB32F10x_EXTI_H
12 #define __WB32F10x_EXTI_H
13
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17
18 /* Includes ------------------------------------------------------------------*/
19 #include "wb32f10x.h"
20
29 /* Exported types ------------------------------------------------------------*/
30
34 typedef enum
35 {
36 EXTI_Mode_Interrupt = 0x00,
37 EXTI_Mode_Event = 0x04
38 } EXTIMode_TypeDef;
39
40 #define IS_EXTI_MODE(MODE) (((MODE) == EXTI_Mode_Interrupt) || ((MODE) == EXTI_Mode_Event))
41
45 typedef enum
46 {
47 EXTI_Trigger_Rising = 0x08,
48 EXTI_Trigger_Falling = 0x0C,
49 EXTI_Trigger_Rising_Falling = 0x10
50 } EXTITrigger_TypeDef;
51
52 #define IS_EXTI_TRIGGER(TRIGGER) (((TRIGGER) == EXTI_Trigger_Rising) || \
53 ((TRIGGER) == EXTI_Trigger_Falling) || \
54 ((TRIGGER) == EXTI_Trigger_Rising_Falling))
55
59 typedef struct
60 {
61 uint32_t EXTI_Line;
64 EXTIMode_TypeDef EXTI_Mode;
67 EXTITrigger_TypeDef EXTI_Trigger;
70 FunctionalState EXTI_LineCmd;
72 } EXTI_InitTypeDef;
73
74 /* Exported constants --------------------------------------------------------*/
75
84 #define EXTI_Line0 ((uint32_t)0x00001)
85 #define EXTI_Line1 ((uint32_t)0x00002)
86 #define EXTI_Line2 ((uint32_t)0x00004)
87 #define EXTI_Line3 ((uint32_t)0x00008)
88 #define EXTI_Line4 ((uint32_t)0x00010)
89 #define EXTI_Line5 ((uint32_t)0x00020)
90 #define EXTI_Line6 ((uint32_t)0x00040)
91 #define EXTI_Line7 ((uint32_t)0x00080)
92 #define EXTI_Line8 ((uint32_t)0x00100)
93 #define EXTI_Line9 ((uint32_t)0x00200)
94 #define EXTI_Line10 ((uint32_t)0x00400)
95 #define EXTI_Line11 ((uint32_t)0x00800)
96 #define EXTI_Line12 ((uint32_t)0x01000)
97 #define EXTI_Line13 ((uint32_t)0x02000)
98 #define EXTI_Line14 ((uint32_t)0x04000)
99 #define EXTI_Line15 ((uint32_t)0x08000)
100 #define EXTI_Line16 ((uint32_t)0x10000)
101 #define EXTI_Line17 ((uint32_t)0x20000)
102 #define EXTI_Line18 ((uint32_t)0x40000)
104 #define IS_EXTI_LINE(LINE) ((((LINE) & (uint32_t)0xFFF00000) == 0x00) && ((LINE) != (uint16_t)0x00))
105 #define IS_GET_EXTI_LINE(LINE) (((LINE) == EXTI_Line0) || ((LINE) == EXTI_Line1) || \
106 ((LINE) == EXTI_Line2) || ((LINE) == EXTI_Line3) || \
107 ((LINE) == EXTI_Line4) || ((LINE) == EXTI_Line5) || \
108 ((LINE) == EXTI_Line6) || ((LINE) == EXTI_Line7) || \
109 ((LINE) == EXTI_Line8) || ((LINE) == EXTI_Line9) || \
110 ((LINE) == EXTI_Line10) || ((LINE) == EXTI_Line11) || \
111 ((LINE) == EXTI_Line12) || ((LINE) == EXTI_Line13) || \
112 ((LINE) == EXTI_Line14) || ((LINE) == EXTI_Line15) || \
113 ((LINE) == EXTI_Line16) || ((LINE) == EXTI_Line17) || \
114 ((LINE) == EXTI_Line18))
115
116
125 /* Exported macro ------------------------------------------------------------*/
126 /* Exported functions --------------------------------------------------------*/
127
128 void EXTI_DeInit(void);
129 void EXTI_Init(EXTI_InitTypeDef* EXTI_InitStruct);
130 void EXTI_StructInit(EXTI_InitTypeDef* EXTI_InitStruct);
131 void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line);
132 FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line);
133 void EXTI_ClearFlag(uint32_t EXTI_Line);
134 ITStatus EXTI_GetITStatus(uint32_t EXTI_Line);
135 void EXTI_ClearITPendingBit(uint32_t EXTI_Line);
136
145 #ifdef __cplusplus
146 }
147 #endif
148
149 #endif /* __WB32F10x_EXTI_H */
EXTI_DeInit
void EXTI_DeInit(void)
Deinitializes the EXTI peripheral registers to their default reset values.
Definition: wb32f10x_exti.c:48
EXTIMode_TypeDef
EXTIMode_TypeDef
EXTI mode enumeration
Definition: wb32f10x_exti.h:34
EXTITrigger_TypeDef
EXTITrigger_TypeDef
EXTI Trigger enumeration
Definition: wb32f10x_exti.h:45
EXTI_GetFlagStatus
FlagStatus EXTI_GetFlagStatus(uint32_t EXTI_Line)
Checks whether the specified EXTI line flag is set or not.
Definition: wb32f10x_exti.c:149
EXTI_ClearFlag
void EXTI_ClearFlag(uint32_t EXTI_Line)
Clears the EXTI's line pending flags.
Definition: wb32f10x_exti.c:172
EXTI_InitTypeDef::EXTI_Mode
EXTIMode_TypeDef EXTI_Mode
Definition: wb32f10x_exti.h:64
EXTI_Init
void EXTI_Init(EXTI_InitTypeDef *EXTI_InitStruct)
Initializes the EXTI peripheral according to the specified parameters in the EXTI_InitStruct.
Definition: wb32f10x_exti.c:64
EXTI_GetITStatus
ITStatus EXTI_GetITStatus(uint32_t EXTI_Line)
Checks whether the specified EXTI line is asserted or not.
Definition: wb32f10x_exti.c:187
EXTI_InitTypeDef
EXTI Init Structure definition
Definition: wb32f10x_exti.h:59
EXTI_ClearITPendingBit
void EXTI_ClearITPendingBit(uint32_t EXTI_Line)
Clears the EXTI's line pending bits.
Definition: wb32f10x_exti.c:212
EXTI_GenerateSWInterrupt
void EXTI_GenerateSWInterrupt(uint32_t EXTI_Line)
Generates a Software interrupt.
Definition: wb32f10x_exti.c:134
EXTI_StructInit
void EXTI_StructInit(EXTI_InitTypeDef *EXTI_InitStruct)
Fills each EXTI_InitStruct member with its reset value.
Definition: wb32f10x_exti.c:120
EXTI_InitTypeDef::EXTI_Trigger
EXTITrigger_TypeDef EXTI_Trigger
Definition: wb32f10x_exti.h:67
EXTI_InitTypeDef::EXTI_Line
uint32_t EXTI_Line
Definition: wb32f10x_exti.h:61
EXTI_InitTypeDef::EXTI_LineCmd
FunctionalState EXTI_LineCmd
Definition: wb32f10x_exti.h:70