34 lines
468 B
C
34 lines
468 B
C
#pragma once
|
|
|
|
#include <stdint.h>
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
typedef enum {
|
|
BTN_NONE = 0,
|
|
BTN_D0,
|
|
BTN_D1,
|
|
BTN_D2,
|
|
} btn_id_t;
|
|
|
|
typedef enum {
|
|
BTN_EVT_NONE = 0,
|
|
BTN_EVT_PRESS,
|
|
BTN_EVT_LONG_PRESS,
|
|
} btn_event_kind_t;
|
|
|
|
typedef struct {
|
|
btn_id_t id;
|
|
btn_event_kind_t kind;
|
|
} btn_event_t;
|
|
|
|
void buttons_init(void);
|
|
btn_event_t buttons_wait(uint32_t timeout_ms);
|
|
btn_event_t buttons_poll(void);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|