summaryrefslogtreecommitdiffstats
path: root/firmware/buttons.h
blob: fcc8921b654ffae3b7f43bfb176e09ae804b71fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#ifndef BUTTONS_H_
#define BUTTONS_H_

#include "util.h"


enum button_id {
	BUTTON_SET,
	BUTTON_MINUS,
	BUTTON_PLUS,
	BUTTON_IRON,

	NR_BUTTONS,
};

enum button_state {
	BSTATE_POSEDGE,
	BSTATE_NEGEDGE,
	BSTATE_PRESSED,
};

typedef void (*button_handler_t)(enum button_id button,
				 enum button_state state);

void buttons_register_handler(enum button_id button,
			      button_handler_t handler);

uint8_t button_is_pressed(enum button_id button);

void buttons_work(void);
void buttons_init(void);

#endif /* BUTTONS_H_ */
bues.ch cgit interface