forked from komby/RFShowControl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRFShowControlConfig.h
243 lines (206 loc) · 7.27 KB
/
RFShowControlConfig.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
/*
* Author: Greg Scull/Mat Mrosko
*
* License:
* Users of this software agree to hold harmless the creators and
* contributors of this software. By using this software you agree that
* you are doing so at your own risk, you could kill yourself or someone
* else by using this software and/or modifying the factory controller.
* By using this software you are assuming all legal responsibility for
* the use of the software and any hardware it is used on.
*
* The Commercial Use of this Software is Prohibited.
*/
#ifndef __RF_PIXEL_CONTROL_CONFIG__
#define __RF_PIXEL_CONTROL_CONFIG__
#include "RFShowControl.h"
#if (NRF_TYPE == MINIMALIST_SHIELD)
#define __CE 9
#define __CSN 8
#elif \
(NRF_TYPE == RF1) || \
(NRF_TYPE == RF1_0_2) || \
(NRF_TYPE == RF1_1_2) || \
(NRF_TYPE == RF1_1_3) || \
(NRF_TYPE == RF1_12V_0_1) ||\
(NRF_TYPE == KOMBLINKIN) ||\
(NRF_TYPE == KOMBEE)
#define __CE 8
#define __CSN 7
#define HEARTBEAT_PIN A1
#define HEARTBEAT_PIN_1 3
#elif (NRF_TYPE == WM_2999_NRF) || \
(NRF_TYPE == RFCOLOR_2_4) || \
(NRF_TYPE == RAPTOR12)
#define __CE 9
#define __CSN 10
#else
#error Must define an NRF type!
#endif
#if (RF_WRAPPER==1)
RF24Wrapper radio = RF24Wrapper(__CE, __CSN);
#else
RFShowControl radio = RFShowControl(__CE, __CSN);
#endif
#if (PIXEL_TYPE == GWTS_EARS)
#include "GWTSControl.h"
#include <GwtS.h>
GWTSControl strip = GWTSControl();
#endif
#if (PIXEL_TYPE == GECE)
#if (HARDCODED_NUM_PIXELS > 63 )
#error "GECE only uses 6 address bits, maximum of 63 pixels allowed!"
#endif
#include "GECERFShowControl.h"
#include <GEColorEffects.h>
GECERFShowControl strip = GECERFShowControl(PIXEL_DATA_PIN, HARDCODED_NUM_PIXELS);
#warning "PIXEL_COLOR_ORDER Unsupported for GECEs"
#endif
#if (PIXEL_TYPE == RENARD)
#if ((RENARD_BAUD_RATE != 460800) && \
(RENARD_BAUD_RATE != 230400) && \
(RENARD_BAUD_RATE != 115200) && \
(RENARD_BAUD_RATE != 57600) && \
(RENARD_BAUD_RATE != 38400) && \
(RENARD_BAUD_RATE != 19200))
#error "Invalid Renard BAUD RATE"
#endif
#if (RENARD_BAUD_RATE == 460800)
#if (HARDCODED_NUM_CHANNELS >= 4584)
#error "Cannot have more than 4584 channels with 460800 baud, even with 100ms refresh interval"
#endif
#if (HARDCODED_NUM_CHANNELS >= 2292)
#warning "Cannot have more than 2292 channels with 460800 baud with 50ms refresh interval"
#if (HARDCODED_NUM_CHANNELS >= 1146)
#warning "Cannot have more than 1146 channels with 460800 baud with 25ms refresh interval"
#endif
#endif
#endif
#if (RENARD_BAUD_RATE == 230400)
#if (HARDCODED_NUM_CHANNELS >= 2292)
#error "Cannot have more than 2292 channels with 230400 baud, even with 100ms refresh interval"
#endif
#if (HARDCODED_NUM_CHANNELS >= 1146)
#warning "Cannot have more than 1146 channels with 230400 baud with 50ms refresh interval"
#if (HARDCODED_NUM_CHANNELS >= 573)
#warning "Cannot have more than 573 channels with 230400 baud with 25ms refresh interval"
#endif
#endif
#endif
#if (RENARD_BAUD_RATE == 115200)
#if (HARDCODED_NUM_CHANNELS >= 1146)
#error "Cannot have more than 1146 channels with 115200 baud, even with 100ms refresh interval"
#endif
#if (HARDCODED_NUM_CHANNELS >= 573)
#warning "Cannot have more than 573 channels with 115200 baud with 50ms refresh interval"
#if (HARDCODED_NUM_CHANNELS >= 285)
#warning "Cannot have more than 285 channels with 115200 baud with 25ms refresh interval"
#endif
#endif
#endif
#if (RENARD_BAUD_RATE == 57600)
#if (HARDCODED_NUM_CHANNELS >= 573)
#error "Cannot have more than 573 channels with 57600 baud, even with 100ms refresh interval"
#endif
#if (HARDCODED_NUM_CHANNELS >= 285)
#warning "Cannot have more than 285 channels with 57600 baud with 50ms refresh interval"
#if (HARDCODED_NUM_CHANNELS >= 141)
#warning "Cannot have more than 141 channels with 57600 baud with 25ms refresh interval"
#endif
#endif
#endif
#if (RENARD_BAUD_RATE == 38400)
#if (HARDCODED_NUM_CHANNELS >= 381)
#error "Cannot have more than 381 channels with 38400 baud, even with 100ms refresh interval"
#endif
#if (HARDCODED_NUM_CHANNELS >= 189)
#warning "Cannot have more than 189 channels with 38400 baud with 50ms refresh interval"
#if (HARDCODED_NUM_CHANNELS >= 93)
#warning "Cannot have more than 93 channels with 38400 baud with 25ms refresh interval"
#endif
#endif
#endif
#if (RENARD_BAUD_RATE == 19200)
#if (HARDCODED_NUM_CHANNELS >= 189)
#error "Cannot have more than 189 channels with 19200 baud, even with 100ms refresh interval"
#endif
#if (HARDCODED_NUM_CHANNELS >= 93)
#warning "Cannot have more than 93 channels with 19200 baud with 50ms refresh interval"
#if (HARDCODED_NUM_CHANNELS >= 45)
#warning "Cannot have more than 45 channels with 19200 baud with 25ms refresh interval"
#endif
#endif
#endif
#include <RenardControl.h>
RenardControl strip = RenardControl(RENARD_BAUD_RATE);
#endif
#if (PIXEL_TYPE == WM_2999)
#include <WM2999.h>
#include "WM2999RFShowControl.h"
WM2999RFShowControl strip = WM2999RFShowControl(PIXEL_DATA_PIN);
#warning "PIXEL_COLOR_ORDER Unsupported for WM2999"
#endif
#if (PIXEL_TYPE == LPD_6803)
#ifndef ADAFRUITILIB6803
#define ADAFRUITILIB6803
#include <LPD6803.h>
#endif
#include "LPD6803RFShowControl.h"
#include <TimerOne.h>
LPD6803RFShowControl strip = LPD6803RFShowControl(PIXEL_DATA_PIN, PIXEL_CLOCK_PIN);
#warning "PIXEL_COLOR_ORDER Unsupported for LPD6803"
#endif
#if (PIXEL_TYPE == STROBE)
#include <ShiftPWM.h>
#include <lib8tion.h>
#ifndef ShiftPWM_H
#error "You are missing the ShiftPWM library you need to download it from 'https://github.com/elcojacobs/ShiftPWM' and put it in your libraries folder"
#endif
#ifndef __INC_LIB8TION_H
#error "You are missing the FastLED Library. You need to download it from 'https://github.com/FastLED/FastLED' and put it in your libraries folder"
#endif
#endif
#ifdef PIXEL_TYPE
#if ((PIXEL_TYPE == LPD_8806) || \
(PIXEL_TYPE == WS_2801) || \
(PIXEL_TYPE == SM_16716) || \
(PIXEL_TYPE == TM_1809) || \
(PIXEL_TYPE == TM_1803) || \
(PIXEL_TYPE == UCS_1903) || \
(PIXEL_TYPE == WS_2811))
#include <FastLED.h>
CRGB *leds;
#define FAST_SPI_CONTROL
#ifndef __INC_FASTSPI_LED2_H
#error "You are missing the newest FastLED Library. You need to download it from 'https://github.com/FastLED/FastLED' and put it in your libraries folder"
#endif
#endif
#endif
// Radio pipe
// addresses for the 2 nodes to communicate.
const uint64_t pipes[2] = {
0xF0F0F0F0E1LL, 0xF0F0F0F0D2LL
};
#if ((PIXEL_TYPE != GECE) && \
(PIXEL_TYPE != WS_2801) && \
(PIXEL_TYPE != WS_2811) && \
(PIXEL_TYPE != RENARD) && \
(PIXEL_TYPE != WM_2999) && \
(PIXEL_TYPE != LPD_6803) && \
(PIXEL_TYPE != GWTS_EARS) && \
(PIXEL_TYPE != LPD_8806) && \
(PIXEL_TYPE != SM_16716) && \
(PIXEL_TYPE != TM_1809) && \
(PIXEL_TYPE != TM_1803) && \
(PIXEL_TYPE != UCS_1903) && \
(PIXEL_TYPE != DMX) && \
(PIXEL_TYPE != STROBE) && \
(PIXEL_TYPE != NONE))
#error "You must define PIXEL_TYPE as one of the following:"
#error " GECE, WS_2801, WS_2811, RENARD, WM_2999,LPD_6803 , GWTS_EARS"
#error " LPD_8806, SM_16716, TM_1809, TM_1803, UCS_1903, DMX, STROBE"
#endif
#if (FCC_RESTRICT && LISTEN_CHANNEL > 83 && LISTEN_CHANNEL < 101 )
#error "FCC Restricts the use of channels 84-100 see http://learn.komby.com/wiki/58/configuration-settings#FCC_RESTRICT"
#endif
#endif //__RF_PIXEL_CONTROL_CONFIG__