-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathses_button.h
40 lines (30 loc) · 909 Bytes
/
ses_button.h
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
34
35
36
37
38
39
40
#ifndef SES_BUTTON_H_
#define SES_BUTTON_H_
/* INCLUDES ******************************************************************/
#include "ses_common.h"
#include "ses_uart.h"
#include "ses_timer.h"
/* FUNCTION PROTOTYPES *******************************************************/
/**
* Initializes rotary encoder and joystick button
*/
void button_init(bool debouncing);
/**
* Prepare function pointer for buttons Interrupt
*/
typedef void (*pButtonCallback)();
void button_setRotaryButtonCallback(pButtonCallback callback);
void button_setJoystickButtonCallback(pButtonCallback callback);
/**
* Get the state of the joystick button.
*/
bool button_isJoystickPressed(void);
/**
* Get the state of the rotary button.
*/
bool button_isRotaryPressed(void);
/**
* Check the state and eliminate bouncing
*/
void button_checkState();
#endif /* SES_BUTTON_H_ */