| | |
| | | // rcu_periph_clock_enable(RCU_GPIOF); |
| | | /* enable the CFGCMP clock */ |
| | | rcu_periph_clock_enable(RCU_CFGCMP); |
| | | exti_deinit(); |
| | | //初始化配置霍尔输入引脚 |
| | | gpio_mode_set(HALL_SENSOR_A_PORT, GPIO_MODE_INPUT, GPIO_PUPD_NONE, HALL_SENSOR_A_PIN); |
| | | gpio_mode_set(HALL_SENSOR_B_PORT, GPIO_MODE_INPUT, GPIO_PUPD_NONE, HALL_SENSOR_B_PIN); |
| | |
| | | syscfg_exti_line_config(EXTI_SOURCE_GPIOB, EXTI_SOURCE_PIN5); |
| | | syscfg_exti_line_config(EXTI_SOURCE_GPIOA, EXTI_SOURCE_PIN15); |
| | | |
| | | exti_init(EXTI_4, EXTI_INTERRUPT, EXTI_TRIG_RISING); //配置外部上升沿中断 |
| | | exti_init(EXTI_5, EXTI_INTERRUPT, EXTI_TRIG_RISING); //配置外部上升沿中断 |
| | | exti_init(EXTI_15, EXTI_INTERRUPT, EXTI_TRIG_RISING); //配置外部上升沿中断 |
| | | exti_init(EXTI_4, EXTI_INTERRUPT, EXTI_TRIG_BOTH); //配置外部上升沿中断 |
| | | exti_init(EXTI_5, EXTI_INTERRUPT, EXTI_TRIG_BOTH); //配置外部上升沿中断 |
| | | exti_init(EXTI_15, EXTI_INTERRUPT, EXTI_TRIG_BOTH); //配置外部上升沿中断 |
| | | nvic_irq_enable(EXTI4_15_IRQn, 0U); |
| | | exti_interrupt_flag_clear(EXTI_4 | EXTI_5 | EXTI_15); |
| | | |