BPLightContraption
 All Classes Namespaces Files Functions Variables Macros Pages
commands.h
Go to the documentation of this file.
1 /*! \file
2  * \brief Definition of commands, errors, etc, for the microcontroller
3  * \details This file is shared between the microcontroller source and GUI source and
4  * therefore is written in strict C code
5  * \author Benjamin Pritchard (ben@bennyp.org)
6  * \copyright 2013 Benjamin Pritchard. Released under the MIT License
7  */
8 
9 #ifndef COMMANDS_H
10 #define COMMANDS_H
11 
12 /* Number of dimmers and powerunits */
13 #define DIMMER_COUNT 6
14 #define PU_COUNT 3
15 #define INFO_SIZE (4+4*DIMMER_COUNT+3*PU_COUNT)
16 
17 /* IDs for the power units */
18 /* These always start at 1 */
19 #define PU_LIGHT1 1
20 #define PU_LIGHT2 2
21 #define PU_RECEPTACLE 3
22 
23 /* States of the powerunits */
24 #define PUSTATE_OFF 1
25 #define PUSTATE_ON 2
26 #define PUSTATE_DIM 3
27 
28 /* General commands */
29 #define COM_NOTHING 0
30 #define COM_INFO 1
31 #define COM_ON 2
32 #define COM_OFF 3
33 #define COM_LEVEL 4
34 
35 
36 /* Responses & error codes */
37 #define RES_SUCCESS 0
38 #define RES_INVALID_START 1
39 #define RES_INVALID_COM 2
40 #define RES_INVALID_ID 3
41 #define RES_NODIMMER 4
42 #define RES_NOGENCLOCK 5
43 #define RES_FAILURE 126
44 
45 
46 
47 #endif
48