8 #pragma GCC optimize ("O2") 23 { .
irq_line = EXTI_Line0, .irq_type = EXTI0_IRQn },
24 { .irq_line = EXTI_Line1, .irq_type = EXTI1_IRQn },
25 { .irq_line = EXTI_Line2, .irq_type = EXTI2_IRQn },
26 { .irq_line = EXTI_Line3, .irq_type = EXTI3_IRQn },
27 { .irq_line = EXTI_Line4, .irq_type = EXTI4_IRQn },
28 { .irq_line = EXTI_Line5, .irq_type = EXTI9_5_IRQn },
29 { .irq_line = EXTI_Line6, .irq_type = EXTI9_5_IRQn },
30 { .irq_line = EXTI_Line7, .irq_type = EXTI9_5_IRQn },
31 { .irq_line = EXTI_Line8, .irq_type = EXTI9_5_IRQn },
32 { .irq_line = EXTI_Line9, .irq_type = EXTI9_5_IRQn },
33 { .irq_line = EXTI_Line10, .irq_type = EXTI15_10_IRQn },
34 { .irq_line = EXTI_Line11, .irq_type = EXTI15_10_IRQn },
35 { .irq_line = EXTI_Line12, .irq_type = EXTI15_10_IRQn },
36 { .irq_line = EXTI_Line13, .irq_type = EXTI15_10_IRQn },
37 { .irq_line = EXTI_Line14, .irq_type = EXTI15_10_IRQn },
38 { .irq_line = EXTI_Line15, .irq_type = EXTI15_10_IRQn },
41 #define NUM_IRQ (sizeof(exti_channels)/sizeof(exti_channel)) 47 memset(handlers, 0,
sizeof(handlers));
54 return EXTI_Trigger_Rising;
56 return EXTI_Trigger_Falling;
58 return EXTI_Trigger_Rising_Falling;
62 return (EXTITrigger_TypeDef)0;
76 EXTI_InitTypeDef EXTI_InitStructure;
79 handlers[
num] = handler;
82 RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
92 EXTI_InitStructure.EXTI_Line = line;
93 EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
95 EXTI_InitStructure.EXTI_LineCmd = ENABLE;
96 EXTI_Init(&EXTI_InitStructure);
115 RCC_APB2PeriphClockCmd(RCC_APB2Periph_SYSCFG, ENABLE);
118 handlers[
num] = handler;
130 EXTI_InitTypeDef EXTI_InitStructure;
131 EXTI_InitStructure.EXTI_Line = line;
132 EXTI_InitStructure.EXTI_Mode = EXTI_Mode_Interrupt;
134 EXTI_InitStructure.EXTI_LineCmd = ENABLE;
135 EXTI_Init(&EXTI_InitStructure);
149 EXTI_InitTypeDef EXTI_InitStructure;
150 EXTI_StructInit(&EXTI_InitStructure);
151 EXTI_InitStructure.EXTI_Line = exti_channels[
num].
irq_line;
152 EXTI_InitStructure.EXTI_LineCmd = DISABLE;
153 EXTI_Init(&EXTI_InitStructure);
183 if(EXTI_GetITStatus(extline) != RESET) {
197 if(t>max_isr_time) max_isr_time=t;
static uint32_t stopwatch_getticks()
void exti_attach_interrupt(afio_exti_num num, afio_exti_port port, Handler handler, exti_trigger_mode mode)
Register a handler to run upon external interrupt.
static void exti_clear_pending_bit(uint32_t EXTI_Line)
static const exti_channel exti_channels[]
#define assert_param(expr)
void EXTI4_IRQHandler(void)
struct exti_channel exti_channel
void exti_attach_interrupt_pri(afio_exti_num num, afio_exti_port port, Handler handler, exti_trigger_mode mode, uint8_t priority)
void EXTI15_10_IRQHandler(void)
void EXTI0_IRQHandler(void)
void enable_nvic_irq(uint8_t irq, uint8_t prio)
Miscellaneous utility macros and procedures.
static EXTITrigger_TypeDef get_exti_mode(exti_trigger_mode mode)
static Handler handlers [NUM_IRQ] IN_CCM
void EXTI2_IRQHandler(void)
#define GPIO_INT_PRIORITY
void exti_enable_interrupt(afio_exti_num num, bool e)
void exti_detach_interrupt(afio_exti_num num)
Unregister an external interrupt handler.
void EXTI1_IRQHandler(void)
void revo_call_handler(Handler h, uint32_t arg)
static void afio_exti_select(afio_exti_port gpio_port, afio_exti_num pin)
void EXTI9_5_IRQHandler(void)
void EXTI3_IRQHandler(void)
static void exti_serv(uint32_t extline, uint8_t num)
afio_exti_port
External interrupt line port selector.