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  BUTTON_ACTION_CLONE,
36  BUTTON_ACTION_CLONE_MFU,
37 
38  /* This has to be last element */
39  BUTTON_ACTION_COUNT
40 } ButtonActionEnum;
41 
42 void ButtonInit(void);
43 void ButtonTick(void);
44 
45 void ButtonGetActionList(char *List, uint16_t BufferSize);
46 void ButtonSetActionById(ButtonTypeEnum Type, ButtonActionEnum Action);
47 void ButtonGetActionByName(ButtonTypeEnum Type, char *Action, uint16_t BufferSize);
48 bool ButtonSetActionByName(ButtonTypeEnum Type, const char *Action);
49 
50 #endif /* BUTTON_H_ */