Chameleon-Mini
Button.h
1 /*
2  * Button.h
3  *
4  * Created on: 13.05.2013
5  * Author: skuser
6  */
7 
8 #ifndef BUTTON_H_
9 #define BUTTON_H_
10 
11 #include "Common.h"
12 
13 typedef enum {
14  BUTTON_R_PRESS_SHORT = 0,
15  BUTTON_R_PRESS_LONG,
16  BUTTON_L_PRESS_SHORT,
17  BUTTON_L_PRESS_LONG,
18 
19  /* Must be last element */
20  BUTTON_TYPE_COUNT
21 } ButtonTypeEnum;
22 
23 typedef enum {
24  BUTTON_ACTION_NONE,
25  BUTTON_ACTION_UID_RANDOM,
26  BUTTON_ACTION_UID_LEFT_INCREMENT,
27  BUTTON_ACTION_UID_RIGHT_INCREMENT,
28  BUTTON_ACTION_UID_LEFT_DECREMENT,
29  BUTTON_ACTION_UID_RIGHT_DECREMENT,
30  BUTTON_ACTION_CYCLE_SETTINGS,
31  BUTTON_ACTION_STORE_MEM,
32  BUTTON_ACTION_RECALL_MEM,
33  BUTTON_ACTION_TOGGLE_FIELD,
34  BUTTON_ACTION_STORE_LOG,
35 
36  /* This has to be last element */
37  BUTTON_ACTION_COUNT
38 } ButtonActionEnum;
39 
40 void ButtonInit(void);
41 void ButtonTick(void);
42 
43 void ButtonGetActionList(char* List, uint16_t BufferSize);
44 void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action);
45 void ButtonGetActionByName(ButtonTypeEnum Type, char* Action, uint16_t BufferSize);
46 bool ButtonSetActionByName(ButtonTypeEnum Type, const char* Action);
47 
48 #endif /* BUTTON_H_ */