]>
Commit | Line | Data |
---|---|---|
1 | /* vim:ts=4 sts=4 et tw=80 | |
2 | * | |
3 | * fnordlicht firmware | |
4 | * | |
5 | * for additional information please | |
6 | * see http://lochraster.org/fnordlichtmini | |
7 | * | |
8 | * (c) by Alexander Neumann <alexander@bumpern.de> | |
9 | * | |
10 | * This program is free software: you can redistribute it and/or modify it | |
11 | * under the terms of the GNU General Public License version 3 as published by | |
12 | * the Free Software Foundation. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, but WITHOUT | |
15 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
16 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
17 | * more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License along with | |
20 | * this program. If not, see <http://www.gnu.org/licenses/>. | |
21 | */ | |
22 | ||
23 | #ifndef __REMOTE_PROTO | |
24 | #define __REMOTE_PROTO 1 | |
25 | ||
26 | #include "../common/remote-proto.h" | |
27 | #include "color.h" | |
28 | #include "static_programs.h" | |
29 | ||
30 | struct remote_msg_fade_rgb_t | |
31 | { | |
32 | uint8_t address; | |
33 | uint8_t cmd; | |
34 | uint8_t step; | |
35 | uint8_t delay; | |
36 | struct rgb_color_t color; | |
37 | }; | |
38 | ||
39 | struct remote_msg_fade_hsv_t | |
40 | { | |
41 | uint8_t address; | |
42 | uint8_t cmd; | |
43 | uint8_t step; | |
44 | uint8_t delay; | |
45 | struct hsv_color_t color; | |
46 | }; | |
47 | ||
48 | struct remote_msg_save_rgb_t | |
49 | { | |
50 | uint8_t address; | |
51 | uint8_t cmd; | |
52 | uint8_t slot; | |
53 | uint8_t step; | |
54 | uint8_t delay; | |
55 | uint16_t pause; | |
56 | struct rgb_color_t color; | |
57 | }; | |
58 | ||
59 | struct remote_msg_save_hsv_t | |
60 | { | |
61 | uint8_t address; | |
62 | uint8_t cmd; | |
63 | uint8_t slot; | |
64 | uint8_t step; | |
65 | uint8_t delay; | |
66 | uint16_t pause; | |
67 | struct hsv_color_t color; | |
68 | }; | |
69 | ||
70 | struct remote_msg_save_current_t | |
71 | { | |
72 | uint8_t address; | |
73 | uint8_t cmd; | |
74 | uint8_t slot; | |
75 | uint8_t step; | |
76 | uint8_t delay; | |
77 | uint16_t pause; | |
78 | }; | |
79 | ||
80 | struct remote_msg_config_offsets_t | |
81 | { | |
82 | uint8_t address; | |
83 | uint8_t cmd; | |
84 | int8_t step; | |
85 | int8_t delay; | |
86 | int16_t hue; | |
87 | uint8_t saturation; | |
88 | uint8_t value; | |
89 | }; | |
90 | ||
91 | struct remote_msg_start_program_t | |
92 | { | |
93 | uint8_t address; | |
94 | uint8_t cmd; | |
95 | uint8_t script; | |
96 | union program_params_t params; | |
97 | }; | |
98 | ||
99 | struct remote_msg_stop_t | |
100 | { | |
101 | uint8_t address; | |
102 | uint8_t cmd; | |
103 | uint8_t fade; | |
104 | }; | |
105 | ||
106 | struct remote_msg_modify_current_t | |
107 | { | |
108 | uint8_t address; | |
109 | uint8_t cmd; | |
110 | uint8_t step; | |
111 | uint8_t delay; | |
112 | struct rgb_color_offset_t rgb; | |
113 | struct hsv_color_offset_t hsv; | |
114 | }; | |
115 | ||
116 | struct remote_msg_pull_int_t | |
117 | { | |
118 | uint8_t address; | |
119 | uint8_t cmd; | |
120 | uint8_t delay; | |
121 | }; | |
122 | ||
123 | enum startup_mode_t | |
124 | { | |
125 | STARTUP_NOTHING = 0, | |
126 | STARTUP_PROGRAM = 1, | |
127 | }; | |
128 | ||
129 | /* startup parameters including mode, size: 12 byte */ | |
130 | struct startup_parameters_t | |
131 | { | |
132 | enum startup_mode_t mode; | |
133 | ||
134 | union { | |
135 | /* raw access to data, size: 11 byte */ | |
136 | uint8_t raw[11]; | |
137 | ||
138 | /* structure for startup_mode == STARTUP_PROGRAM | |
139 | * size: 11 byte */ | |
140 | struct { | |
141 | uint8_t program; | |
142 | uint8_t program_parameters[PROGRAM_PARAMETER_SIZE]; | |
143 | }; | |
144 | }; | |
145 | }; | |
146 | ||
147 | struct remote_msg_config_startup_t | |
148 | { | |
149 | uint8_t address; | |
150 | uint8_t cmd; | |
151 | struct startup_parameters_t params; | |
152 | }; | |
153 | ||
154 | #endif |