forked from akafugu/VFDDeluxe
-
Notifications
You must be signed in to change notification settings - Fork 0
/
features.h
387 lines (292 loc) · 10.2 KB
/
features.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
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
/*
* VFD Deluxe
* (C) 2011-12 Akafugu Corporation
*
* This program is free software; you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation; either version 2 of the License, or (at your option) any later
* version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
* PARTICULAR PURPOSE. See the GNU General Public License for more details.
*
*/
#ifndef FEATURES_H_
#define FEATURES_H_
// fixme: add config.h that contains local config for each compile
// Boards
#define BOARD_VFD_DELUXE 0
#define BOARD_VFD_MODULAR_CLOCK 1
// fixme: this is just a convenience declaration for now since there are only two board types
#ifdef __AVR_ATmega32U4__
#define BOARD BOARD_VFD_DELUXE
#else
#define BOARD BOARD_VFD_MODULAR_CLOCK
#endif
//#define BOARD BOARD_VFD_DELUXE
//#define BOARD BOARD_VFD_MODULAR_CLOCK
// Display Shields
enum shield_t {
SHIELD_NONE = 0,
// VFD displays
SHIELD_7SEG, // generic 7-seg display
SHIELD_14SEG, // generic 14-seg display
SHIELD_16SEG, // generic 16-seg display
SHIELD_IV6, // VFD Modular Clock IV-6 shield
SHIELD_IV17, // VFD Modular Clock IV-17 shield
SHIELD_IV18, // VFD Modular Clock IV-18 shield
SHIELD_IV17_6D, // VFD Modular Clock IV-17 6-digit shield
// Nixie displays
SHIELD_IN8_2, // VFDDeluxe, IN-8-2 6-digit Nixie
SHIELD_IN14, // VFDDeluxe IN-14 6-digit Nixie
SHIELD_HYBRID, // VFDDeluxe IV-18+IN-17 VFD/Nixie hybrid shield
};
//#define SHIELD SHIELD_IV18
//#define SHIELD_DIGITS 8
//#define SHIELD SHIELD_IN14
//#define SHIELD SHIELD_IN8_2
//#define SHIELD_DIGITS 6
//#define IN14_FIX
#define SHIELD SHIELD_IV17
#define SHIELD_DIGITS 4
// Display Shield identifiers
// add here
/*
#define FEATURE_HV518
#define FEATURE_NIXIE
#define FEATURE_BUTTONS
#define FEATURE_FLW
#define FEATURE_LEONARDO
#define FEATURE_MEGA328
#define FEATURE_ALARM_SWITCH
#define FEATURE_ALARM_BUTTON
*/
#define YES 2
#define NO 1
#define FEATURE_NIXIE_SUPPORT NO
#define FEATURE_SHIELD_AUTODETECT YES
#define FEATURE_RTC_TEMP YES // Get temperature from RTC
#define FEATURE_MPL115A2 NO // Temperature and Atmospheric pressure sensor
#define FEATURE_HIH6121 NO // Temperature and Humidity sensor
#define FEATURE_ROTARY NO
#define FEATURE_GPS YES
#define FEATURE_GPS_DEBUG YES
#define FEATURE_RGB_BACKLIGHT NO
#define FEATURE_LOWERCASE YES
#define FEATURE_ALTERNATE_FONT YES
#define FEATURE_SERIAL_DEBUG NO // Wait for serial console to open before booting
//#define FEATURE_SERIAL_DEBUG YES
#define FEATURE_FLW YES
//#define FEATURE_FLW NO
#define FEATURE_RTC_SQW YES
//#define FEATURE_RTC_SQW NO // wbp
#define FEATURE_AUTO_DATE YES
#define FEATURE_AUTO_DST YES
#define FEATURE_AUTO_DIM YES
#define FEATURE_SET_DATE YES // set date in menu?
#define FEATURE_SET_TIME YES // add "TIME" to menu?
#define FEATURE_MESSAGES YES // birthday, etc
// Support for generic displays (excludes the standard shields)
#define FEATURE_7SEG_SUPPORT NO
#define FEATURE_14SEG_SUPPORT NO
#define FEATURE_16SEG_SUPPORT NO
// fixme: this can be automatic based on __AVR_ATmega32U4__ define
#ifdef __AVR_ATmega32U4__
#define FEATURE_LEONARDO YES
#define FEATURE_ATMEGA328 NO
#elif defined(__AVR_ATmega328P__)
#define FEATURE_LEONARDO NO
#define FEATURE_ATMEGA328 YES
#else
#error Unsupported board: Only ATmega328 and ATmega32U4 are supported at this time
#endif
// fixme: this should probably be generated from a script
// list FEATURES and what each feature defines when set to on
// could also do dependencies
///////////////////////////////////////////
// Experimental support for driving nixies
#if !(defined FEATURE_NIXIE_SUPPORT) || FEATURE_NIXIE_SUPPORT < NO || FEATURE_NIXIE_SUPPORT > YES
# error Must define FEATURE_NIXIE_SUPPORT to be YES or NO
#endif
#if FEATURE_NIXIE_SUPPORT == YES
# define HAVE_NIXIE_SUPPORT
#endif
///////////////////////////////////////////
#if !(defined FEATURE_SHIELD_AUTODETECT) || FEATURE_SHIELD_AUTODETECT < NO || FEATURE_SHIELD_AUTODETECT > YES
# error Must define FEATURE_SHIELD_AUTODETECT to be YES or NO
#endif
#if FEATURE_SHIELD_AUTODETECT == YES
# define HAVE_SHIELD_AUTODETECT
#endif
///////////////////////////////////////////
#if !(defined FEATURE_MPL115A2) || FEATURE_MPL115A2 < NO || FEATURE_MPL115A2 > YES
# error Must define FEATURE_MPL115A2 to be YES or NO
#endif
#if FEATURE_MPL115A2 == YES
# define HAVE_MPL115A2
# define HAVE_TEMPERATURE
# define HAVE_PRESSURE
#endif
///////////////////////////////////////////
#if !(defined FEATURE_HIH6121) || FEATURE_HIH6121 < NO || FEATURE_HIH6121 > YES
# error Must define FEATURE_HIH6121 to be YES or NO
#endif
#if FEATURE_HIH6121 == YES
# define HAVE_HIH6121
# define HAVE_TEMPERATURE
# define HAVE_HUMIDITY
#endif
///////////////////////////////////////////
#if !(defined FEATURE_ROTARY) || FEATURE_ROTARY < NO || FEATURE_ROTARY > YES
# error Must define FEATURE_ROTARY to be YES or NO
#endif
#if FEATURE_ROTARY == YES
// we have a rotary encoder with a single button for input
# define HAVE_ROTARY
#else
// we have two buttons for input
# define HAVE_BUTTONS
#endif
///////////////////////////////////////////
#if !(defined FEATURE_GPS) || FEATURE_GPS < NO || FEATURE_GPS > YES
# error Must define FEATURE_GPS to be YES or NO
#endif
#if FEATURE_GPS == YES
# define HAVE_GPS
#endif
///////////////////////////////////////////
#if !(defined FEATURE_GPS_DEBUG) || FEATURE_GPS_DEBUG < NO || FEATURE_GPS_DEBUG > YES
# error Must define FEATURE_GPS_DEBUG to be YES or NO
#endif
#if FEATURE_GPS_DEBUG == YES
# define HAVE_GPS_DEBUG
#endif
///////////////////////////////////////////
#if !(defined FEATURE_LEONARDO) || FEATURE_LEONARDO < NO || FEATURE_LEONARDO > YES
# error Must define FEATURE_LEONARDO to be YES or NO
#endif
#if FEATURE_LEONARDO == YES
# define HAVE_LEONARDO
#endif
///////////////////////////////////////////
#if !(defined FEATURE_ATMEGA328) || FEATURE_ATMEGA328 < NO || FEATURE_ATMEGA328 > YES
# error Must define FEATURE_ATMEGA328 to be YES or NO
#endif
#if FEATURE_ATMEGA328 == YES
# define HAVE_ATMEGA328
#endif
///////////////////////////////////////////
#if !(defined FEATURE_RGB_BACKLIGHT) || FEATURE_RGB_BACKLIGHT < NO || FEATURE_RGB_BACKLIGHT > YES
# error Must define FEATURE_RGB_BACKLIGHT to be YES or NO
#endif
#if FEATURE_RGB_BACKLIGHT == YES
# define HAVE_RGB_BACKLIGHT
#endif
///////////////////////////////////////////
#if !(defined FEATURE_LOWERCASE) || FEATURE_LOWERCASE < NO || FEATURE_LOWERCASE > YES
# error Must define FEATURE_LOWERCASE to be YES or NO
#endif
#if FEATURE_LOWERCASE == YES
# define HAVE_LOWERCASE
#endif
///////////////////////////////////////////
#if !(defined FEATURE_ALTERNATE_FONT) || FEATURE_ALTERNATE_FONT < NO || FEATURE_ALTERNATE_FONT > YES
# error Must define FEATURE_ALTERNATE_FONT to be YES or NO
#endif
#if FEATURE_ALTERNATE_FONT == YES
# define HAVE_ALTERNATE_FONT
#endif
///////////////////////////////////////////
#if !(defined FEATURE_SERIAL_DEBUG) || FEATURE_SERIAL_DEBUG < NO || FEATURE_SERIAL_DEBUG > YES
# error Must define FEATURE_SERIAL_DEBUG to be YES or NO
#endif
#if FEATURE_SERIAL_DEBUG == YES
# define HAVE_SERIAL_DEBUG
#endif
///////////////////////////////////////////
#if !(defined FEATURE_FLW) || FEATURE_FLW < NO || FEATURE_FLW > YES
# error Must define FEATURE_FLW to be YES or NO
#endif
#if FEATURE_FLW == YES
# define HAVE_FLW
#endif
///////////////////////////////////////////
#if !(defined FEATURE_RTC_SQW) || FEATURE_RTC_SQW < NO || FEATURE_RTC_SQW > YES
# error Must define FEATURE_RTC_SQW to be YES or NO
#endif
#if FEATURE_RTC_SQW == YES
# define HAVE_RTC_SQW
#endif
///////////////////////////////////////////
#if !(defined FEATURE_RTC_TEMP) || FEATURE_RTC_TEMP < NO || FEATURE_RTC_TEMP > YES
# error Must define FEATURE_RTC_TEMP to be YES or NO
#endif
#if FEATURE_RTC_TEMP == YES
# define HAVE_RTC_TEMP
# define HAVE_TEMPERATURE
#endif
///////////////////////////////////////////
#if !(defined FEATURE_AUTO_DATE) || FEATURE_AUTO_DATE < NO || FEATURE_AUTO_DATE > YES
# error Must define FEATURE_AUTO_DATE to be YES or NO
#endif
#if FEATURE_AUTO_DATE == YES
# define HAVE_AUTO_DATE
#endif
///////////////////////////////////////////
#if !(defined FEATURE_AUTO_DST) || FEATURE_AUTO_DST < NO || FEATURE_AUTO_DST > YES
# error Must define FEATURE_AUTO_DST to be YES or NO
#endif
#if FEATURE_AUTO_DST == YES
# define HAVE_AUTO_DST
#endif
///////////////////////////////////////////
#if !(defined FEATURE_AUTO_DIM) || FEATURE_AUTO_DIM < NO || FEATURE_AUTO_DIM > YES
# error Must define FEATURE_AUTO_DIM to be YES or NO
#endif
#if FEATURE_AUTO_DIM == YES
# define HAVE_AUTO_DIM
#endif
///////////////////////////////////////////
#if !(defined FEATURE_SET_DATE) || FEATURE_SET_DATE < NO || FEATURE_SET_DATE > YES
# error Must define FEATURE_SET_DATE to be YES or NO
#endif
#if FEATURE_SET_DATE == YES
# define HAVE_SET_DATE
#endif
///////////////////////////////////////////
#if !(defined FEATURE_SET_TIME) || FEATURE_SET_TIME < NO || FEATURE_SET_TIME > YES
# error Must define FEATURE_SET_TIME to be YES or NO
#endif
#if FEATURE_SET_TIME == YES
# define HAVE_MENU_TIME
#endif
///////////////////////////////////////////
#if !(defined FEATURE_MESSAGES) || FEATURE_MESSAGES < NO || FEATURE_MESSAGES > YES
# error Must define FEATURE_MESSAGES to be YES or NO
#endif
#if FEATURE_MESSAGES == YES
# define HAVE_MESSAGES
#endif
///////////////////////////////////////////
#if !(defined FEATURE_7SEG_SUPPORT) || FEATURE_7SEG_SUPPORT < NO || FEATURE_7SEG_SUPPORT > YES
# error Must define FEATURE_7SEG_SUPPORT to be YES or NO
#endif
#if FEATURE_7SEG_SUPPORT == YES
# define HAVE_7SEG_SUPPORT
#endif
///////////////////////////////////////////
#if !(defined FEATURE_14SEG_SUPPORT) || FEATURE_14SEG_SUPPORT < NO || FEATURE_14SEG_SUPPORT > YES
# error Must define FEATURE_14SEG_SUPPORT to be YES or NO
#endif
#if FEATURE_14SEG_SUPPORT == YES
# define HAVE_14SEG_SUPPORT
#endif
///////////////////////////////////////////
#if !(defined FEATURE_16SEG_SUPPORT) || FEATURE_16SEG_SUPPORT < NO || FEATURE_16SEG_SUPPORT > YES
# error Must define FEATURE_16SEG_SUPPORT to be YES or NO
#endif
#if FEATURE_16SEG_SUPPORT == YES
# define HAVE_16SEG_SUPPORT
#endif
#endif // FEATURES_H_