AskSin++
cm.h
1 //- -----------------------------------------------------------------------------------------------------------------------
2 // AskSin driver implementation
3 // 2013-08-03 <trilu@gmx.de>, <dirk@hfma.de> Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
4 //- -----------------------------------------------------------------------------------------------------------------------
5 
6 #ifndef _CM_H
7  #define _CM_H
8 
9  #define GET_2_BYTE_VALUE(n) ( ((uint16_t)n >> 8) | ((uint16_t)n << 8) ) // macro for changing byte order for ARV little endian
10 
11  #define AS_CM_JT_NONE 0
12  #define AS_CM_JT_ONDELAY 1
13  #define AS_CM_JT_REFON 2 // Ignore for dimmer
14  #define AS_CM_JT_ON 3
15  #define AS_CM_JT_OFFDELAY 4
16  #define AS_CM_JT_REFOFF 5 // Ignore for dimmer
17  #define AS_CM_JT_OFF 6
18  #define AS_CM_JT_RAMPON 8
19  #define AS_CM_JT_RAMPOFF 9
20 
21  #define AS_CM_ACTIONTYPE_INACTIVE 0
22  #define AS_CM_ACTIONTYPE_JUMP_TO_TARGET 1
23  #define AS_CM_ACTIONTYPE_TOGGLE_TO_COUNTER 2
24  #define AS_CM_ACTIONTYPE_TOGGLE_INVERSE_TO_COUNTER 3
25  #define AS_CM_ACTIONTYPE_UPDIM 4 // check
26  #define AS_CM_ACTIONTYPE_DOWNDIM 5 // check
27  #define AS_CM_ACTIONTYPE_TOGGLEDIM 6 // check
28  #define AS_CM_ACTIONTYPE_TOGGLEDIM_TO_COUNTER 7 // check
29  #define AS_CM_ACTIONTYPE_TOGGLEDIM_TO_COUNTER_INVERSE 8 // check
30 
31  #define AS_CM_CT_X_GE_COND_VALUE_LO 0
32  #define AS_CM_CT_X_GE_COND_VALUE_HI 1
33  #define AS_CM_CT_X_LT_COND_VALUE_LO 2
34  #define AS_CM_CT_X_LT_COND_VALUE_HI 3
35  #define AS_CM_CT_COND_VALUE_LO_LE_X_LT_COND_VALUE_HI 4
36  #define AS_CM_CT_X_LT_COND_VALUE_LO_OR_X_GE_COND_VALUE_HI 5
37 
38  #define AS_CM_DRIVINGMODE_DRIVE_DIRECTLY 0
39  #define AS_CM_DRIVINGMODE_DRIVE_VIA_UPPER_END_POSITION 1
40  #define AS_CM_DRIVINGMODE_DRIVE_VIA_LOWER_END_POSITION 2
41  #define AS_CM_DRIVINGMODE_DRIVE_VIA_NEXT_END_POSITION 3
42 
43  #define AS_CM_STATETOSEND_NONE 0
44  #define AS_CM_STATETOSEND_ACK 1
45  #define AS_CM_STATETOSEND_STATE 2
46 
47  #define AS_CM_EXTSTATE_NONE 0x00
48  #define AS_CM_EXTSTATE_UP 0x10
49  #define AS_CM_EXTSTATE_DOWN 0x20
50  #define AS_CM_EXTSTATE_RUNNING 0x40
51  #define AS_CM_EXTSTATE_LOWBAT 0x80
52 
53  #define AS_CM_EXTSTATE_OVERLOAD 0x02
54  #define AS_CM_EXTSTATE_OVERHEAT 0x04
55  #define AS_CM_EXTSTATE_REDUCED 0x08
56 
57  #define AS_CM_KEYCODE_NONE 0
58  #define AS_CM_KEYCODE_SHORT 1
59  #define AS_CM_KEYCODE_LONG 2
60 
61 #endif