Files
QD4C-firmware/app/by_rt_button.h

23 lines
545 B
C
Raw Normal View History

#ifndef _BY_RT_BUTTON_H__
#define _BY_RT_BUTTON_H__
#include "stdio.h"
#include "ch32v30x.h"
2024-01-05 16:00:06 +08:00
2024-01-06 16:47:15 +08:00
#define LONG_PRESS_THRESHOLD_MS (300ULL)
#define LONG_PRESS_THRESHOLD_TICK (LONG_PRESS_THRESHOLD_MS * 18000ULL)
typedef enum rotate_button_event {
2024-02-07 10:24:11 +08:00
rotate_button_none = 0,
rotate_button_press_short = 1,
2024-01-06 16:47:15 +08:00
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);
2024-02-07 10:24:11 +08:00
extern void by_rb_init(void);
#endif