Files
QD4C-firmware/app/by_rt_button.h
2024-02-07 10:24:11 +08:00

23 lines
545 B
C

#ifndef _BY_RT_BUTTON_H__
#define _BY_RT_BUTTON_H__
#include "stdio.h"
#include "ch32v30x.h"
#define LONG_PRESS_THRESHOLD_MS (300ULL)
#define LONG_PRESS_THRESHOLD_TICK (LONG_PRESS_THRESHOLD_MS * 18000ULL)
typedef enum rotate_button_event {
rotate_button_none = 0,
rotate_button_press_short = 1,
rotate_button_press_long = 2,
rotate_button_forward = 3,
rotate_button_backward = 4,
} rotate_button_event;
extern uint8_t rotate_button;
extern uint8_t by_get_rb_status(void);
extern void by_rb_init(void);
#endif