feat: 新增编码器驱动
This commit is contained in:
20
app/by_peripheral_init.c
Normal file
20
app/by_peripheral_init.c
Normal file
@@ -0,0 +1,20 @@
|
||||
#include "by_peripheral_init.h"
|
||||
#include "zf_common_headfile.h"
|
||||
uint8_t potate_button;
|
||||
void by_gpio_init(void)
|
||||
{
|
||||
gpio_init(E10, GPI, GPIO_HIGH, GPI_PULL_UP);
|
||||
}
|
||||
|
||||
void by_exit_init(void)
|
||||
{
|
||||
exti_init(E9, EXTI_TRIGGER_FALLING);
|
||||
exti_init(E11, EXTI_TRIGGER_FALLING);
|
||||
}
|
||||
|
||||
uint8_t by_get_pb_statu(void)
|
||||
{
|
||||
uint8_t temp_s = potate_button;
|
||||
potate_button = 0;
|
||||
return temp_s;
|
||||
}
|
||||
Reference in New Issue
Block a user