3 #include <libopencm3/stm32/rcc.h>
4 #include <libopencm3/stm32/gpio.h>
5 #include <libopencm3/stm32/exti.h>
6 #include <libopencm3/cm3/nvic.h>
12 rcc_periph_clock_enable(RCC_SYSCFG);
13 rcc_periph_clock_enable(RCC_GPIOB);
14 rcc_periph_clock_enable(RCC_GPIOB);
15 gpio_mode_setup(
GPIOB, GPIO_MODE_INPUT, GPIO_PUPD_NONE,
GPIO5);
16 gpio_mode_setup(
GPIOC, GPIO_MODE_INPUT, GPIO_PUPD_NONE,
GPIO6);
18 nvic_enable_irq(NVIC_EXTI9_5_IRQ);
19 exti_select_source(EXTI5,
GPIOB);
20 exti_select_source(EXTI6,
GPIOC);
21 exti_set_trigger(EXTI5, EXTI_TRIGGER_RISING);
22 exti_set_trigger(EXTI6, EXTI_TRIGGER_FALLING);
23 exti_enable_request(EXTI5);
24 exti_enable_request(EXTI6);
25 nvic_set_priority(NVIC_EXTI9_5_IRQ, 0x0F);
31 if (EXTI_PR & EXTI6) {
32 exti_reset_request(EXTI6);
35 if (EXTI_PR & EXTI5) {
36 exti_reset_request(EXTI5);
void imu_krooz_sd_arch_init(void)
Inertial Measurement Unit interface.
struct ImuKrooz imu_krooz