-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig_support.h
1249 lines (955 loc) · 24.7 KB
/
config_support.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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* ************************************************************************
*
* support for global configuration
*
* (c) 2012-2024 by Markus Reschke
* based on code from Markus Frejek and Karl-Heinz Kübbeler
*
* ************************************************************************ */
/* source management */
#define CONFIG_SUPPORT_H
/* ************************************************************************
* ADC clock
* ************************************************************************ */
/*
* define clock divider
* - supports 1MHz, 2MHz, 4MHz, 8MHz, 16MHz and 20MHz MCU clocks
* - we got only 7 fixed prescalers from 2 up to 128
*/
/* 1MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 4
#define ADC_CLOCK_DIV (1 << ADPS1)
#endif
/* 1MHz/125kHz 2MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 8
#define ADC_CLOCK_DIV (1 << ADPS1) | (1 << ADPS0)
#endif
/* 2MHz/125kHz 4MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 16
#define ADC_CLOCK_DIV (1 << ADPS2)
#endif
/* 4MHz/125kHz 8MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 32
#define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS0)
#endif
/* 8MHz/125kHz 16MHz/250kHz */
#if CPU_FREQ / ADC_FREQ == 64
#define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS1)
#endif
/* 16MHz/125kHz 20MHz/156.25kHz */
#if CPU_FREQ / ADC_FREQ == 128
#define ADC_CLOCK_DIV (1 << ADPS2) | (1 << ADPS1) | (1 << ADPS0)
#endif
/* ************************************************************************
* derived values
* ************************************************************************ */
/*
* number of MCU cycles per µs
* - min. 1 (for 1MHz)
* - max. 20 (for 20MHz)
*/
#define MCU_CYCLES_PER_US (CPU_FREQ / 1000000)
/*
* number of MCU cycles per ADC cycle
* - min. 4
* - max. 128
*/
#define MCU_CYCLES_PER_ADC (CPU_FREQ / ADC_FREQ)
/*
* time of a MCU cycle (in 0.1 ns)
*/
#define MCU_CYCLE_TIME (10000 / (CPU_FREQ / 1000000))
/* ************************************************************************
* check display drivers
* ************************************************************************ */
/*
* check if a display module is enabled
*/
#if ! defined (LCD_TEXT) && ! defined (LCD_GRAPHIC)
#error <<< No display module enabled! >>>
#endif
/*
* check if more than one display module is enabled
* - does not work for enabling same display driver multiple times
*/
#ifdef LCD_HD44780
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ILI9163
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ILI9341
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ILI9481
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ILI9486
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ILI9488
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_PCD8544
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_PCF8814
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_SH1106
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_SSD1306
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ST7036
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ST7565R
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ST7735
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_SEMI_ST7735
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_ST7920
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_STE2007
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
#ifdef LCD_VT100
#ifdef DISPLAY_ONE
#ifndef DISPLAY_MULTI
#define DISPLAY_MULTI
#endif
#else
#define DISPLAY_ONE
#endif
#endif
/* multiple displays: show error */
#ifdef DISPLAY_MULTI
#error <<< Multiple display modules enabled! >>>
#endif
/* clean up */
#undef DISPLAY_ONE
#undef DISPLAY_MULTI
/* ************************************************************************
* check touchscreen drivers
* ************************************************************************ */
/* check for activated drivers */
#ifdef TOUCH_ADS7843
#ifndef TOUCH_ONE
#define TOUCH_ONE
#endif
#endif
/* touchscreen: common switch */
#ifdef TOUCH_ONE
#define HW_TOUCH
#endif
/* clean up */
#undef TOUCH_ONE
/* ************************************************************************
* memory/storage options
* ************************************************************************ */
/*
* storage of program data (EEPROM/Flash)
*/
#if defined (DATA_EEPROM)
/* memory type EEPROM */
#define MEM_TYPE EEMEM
/* read functions */
#define DATA_read_byte(addr) eeprom_read_byte(addr)
#define DATA_read_word(addr) eeprom_read_word(addr)
#elif defined (DATA_FLASH)
/* memory type Flash */
#define MEM_TYPE PROGMEM
/* read functions */
#define DATA_read_byte(addr) pgm_read_byte(addr)
#define DATA_read_word(addr) pgm_read_word(addr)
#endif
/* ************************************************************************
* hardware/software options
* ************************************************************************ */
/*
* power management
*/
/* power switch: prefer soft-latching type */
#ifdef POWER_SWITCH_SOFT
#ifdef POWER_SWITCH_MANUAL
#undef POWER_SWITCH_MANUAL
#endif
#endif
/*
* additional keys / user input
*/
/* rotary encoder, increase/decrease push buttons or touch screen */
#if defined (HW_ENCODER) || defined (HW_INCDEC_KEYS) | defined (HW_TOUCH)
#define HW_KEYS
#endif
/* options which require additional keys */
#ifndef HW_KEYS
/* key hints */
#ifdef UI_KEY_HINTS
#undef UI_KEY_HINTS
#endif
/* PWM+ */
#ifdef SW_PWM_PLUS
#undef SW_PWM_PLUS
#define SW_PWM_SIMPLE
#endif
/* squarewave generator */
#ifdef SW_SQUAREWAVE
#undef SW_SQUAREWAVE
#endif
/* Servo Check */
#ifdef SW_SERVO
#undef SW_SERVO
#endif
/* event counter */
#ifdef HW_EVENT_COUNTER
#undef HW_EVENT_COUNTER
#endif
/* IR Sender */
#ifdef SW_IR_TRANSMITTER
#undef SW_IR_TRANSMITTER
#endif
/* logic probe */
#ifdef HW_LOGIC_PROBE
#undef HW_LOGIC_PROBE
#endif
#endif
/*
* inductance measurement
*/
/* options which require inductance measurement */
#ifndef SW_INDUCTOR
/* L monitor */
#ifdef SW_MONITOR_L
#undef SW_MONITOR_L
#endif
/* RCL Monitor */
#ifdef SW_MONITOR_RCL
#undef SW_MONITOR_RCL
#endif
/* RL Monitor */
#ifdef SW_MONITOR_RL
#undef SW_MONITOR_RL
#endif
#endif
/*
* ESR measurement
*/
/* options which require ESR measurement */
#if ! defined (SW_ESR) && ! defined (SW_OLD_ESR)
/* ESR tool */
#ifdef SW_ESR_TOOL
#undef SW_ESR_TOOL
#endif
#endif
/*
* buzzer
*/
/* buzzer type: either active or passive */
#ifdef HW_BUZZER
#if defined (BUZZER_ACTIVE) && defined (BUZZER_PASSIVE)
#error <<< Buzzer: select either active or passive buzzer! >>>
#endif
#if ! defined (BUZZER_ACTIVE) && ! defined (BUZZER_PASSIVE)
#error <<< Buzzer: select buzzer type! >>>
#endif
#endif
/* options which require a buzzer */
#if ! defined (HW_BUZZER)
/* continuity check */
#ifdef SW_CONTINUITY_CHECK
#undef SW_CONTINUITY_CHECK
#endif
/* probing: confirmation beep when done */
#ifdef UI_PROBING_DONE_BEEP
#undef UI_PROBING_DONE_BEEP
#endif
/* IR receiver/decoder: confirmation beep for valid frame/packet */
#ifdef SW_IR_RX_BEEP
#undef SW_IR_RX_BEEP
#endif
#endif
/*
* MCU clock
*/
/* options which require a MCU clock >= 8MHz */
#if CPU_FREQ < 8000000
/* ESR measurement */
#ifdef SW_ESR
#undef SW_ESR
#endif
/* old ESR measurement */
#ifdef SW_OLD_ESR
#undef SW_OLD_ESR
#endif
#endif
/*
* battery monitoring
*/
/* battery monitoring: if disabled */
#ifdef BAT_NONE
/* no need for fancy battery status */
#ifdef UI_BATTERY
#undef UI_BATTERY
#endif
/* no need for battery status in last line */
#ifdef UI_BATTERY_LASTLINE
#undef UI_BATTERY_LASTLINE
#endif
#endif
/*
* SPI
*/
/* SPI: either bit-bang or hardware */
#if defined (SPI_BITBANG) && defined (SPI_HARDWARE)
#error <<< SPI: select either bitbang or hardware SPI! >>>
#endif
/* SPI: common switch */
#if defined (SPI_BITBANG) || defined (SPI_HARDWARE)
#define HW_SPI
#endif
/* 9-Bit SPI requires bit-bang mode */
#ifdef SPI_9
#ifndef SPI_BITBANG
#error <<< SPI: 9-Bit SPI requires bit-bang mode! >>>
#endif
#endif
/* options which require SPI */
#ifndef HW_SPI
/* SPI read support */
#ifdef SPI_RW
#undef SPI_RW
#endif
#endif
/* options which require SPI read support */
#ifndef SPI_RW
/* MAX6675 */
#ifdef HW_MAX6675
#undef HW_MAX6675
#endif
/* MAX31855 */
#ifdef HW_MAX31855
#undef HW_MAX31855
#endif
#endif
/* bit-bang SPI with read support requires SPI_PIN and SPI_MISO */
#if defined (SPI_BITBANG) && defined (SPI_RW)
#ifndef SPI_PIN
#error <<< SPI: bit-bang SPI with read support requires SPI_PIN to be set! >>>
#endif
#ifndef SPI_MISO
#error <<< SPI: bit-bang SPI with read support requires SPI_MISO to be set! >>>
#endif
#endif
/*
* I2C
*/
/* I2C: either bit-bang or hardware */
#if defined (I2C_BITBANG) && defined (I2C_HARDWARE)
#error <<< I2C: select either bitbang or hardware I2C! >>>
#endif
/* I2C: common switch */
#if defined (I2C_BITBANG) || defined (I2C_HARDWARE)
#define HW_I2C
#endif
/* options which require I2C */
#ifndef HW_I2C
/* I2C read support */
#ifdef I2C_RW
#undef I2C_RW
#endif
#endif
/* options which require I2C read support */
#ifndef I2C_RW
/* BH1750 */
#ifdef HW_BH1750
#undef HW_BH1750
#endif
#endif
/*
* TTL serial
*/
/* TTL serial: either bit-bang or hardware */
#if defined (SERIAL_BITBANG) && defined (SERIAL_HARDWARE)
#error <<< Serial: select either bitbang or hardware serial interface! >>>
#endif
/* TTL serial: common switch */
#if defined (SERIAL_BITBANG) || defined (SERIAL_HARDWARE)
#define HW_SERIAL
#endif
/* VT100 display driver disables other options for serial interface */
#ifdef LCD_VT100
#ifdef UI_SERIAL_COPY
#undef UI_SERIAL_COPY
#endif
#ifdef UI_SERIAL_COMMANDS
#undef UI_SERIAL_COMMANDS
#endif
/* and also fancy battery status */
#ifdef UI_BATTERY
#undef UI_BATTERY
#endif
#endif
/* options which require TTL serial */
#ifndef HW_SERIAL
/* VT100 display */
#ifdef LCD_VT100
#undef LCD_VT100
#endif
/* serial copy */
#ifdef UI_SERIAL_COPY
#undef UI_SERIAL_COPY
#endif
/* remote commands */
#ifdef UI_SERIAL_COMMANDS
#undef UI_SERIAL_COMMANDS
#endif
#endif
/* options which require TTL serial RW */
#ifndef SERIAL_RW
#ifdef UI_SERIAL_COMMANDS
#undef UI_SERIAL_COMMANDS
#endif
#endif
/*
* OneWire
*/
/* OneWire: either via probes or dedicated pin */
#if defined (ONEWIRE_PROBES) && defined (ONEWIRE_IO_PIN)
#error <<< OneWire: select either probes or dedicated IO pin! >>>
#endif
/* options which require OneWire */
#if ! defined (ONEWIRE_PROBES) && ! defined (ONEWIRE_IO_PIN)
/* DS18B20 */
#ifdef SW_DS18B20
#undef SW_DS18B20
#endif
/* DS18S20 */
#ifdef SW_DS18S20
#undef SW_DS18S20
#endif
/* OneWire scan */
#ifdef SW_ONEWIRE_SCAN
#undef SW_ONEWIRE_SCAN
#endif
#endif
/*
* display module
*/
/* LCD module: contrast */
#ifdef LCD_CONTRAST
#define SW_CONTRAST
#else
#define LCD_CONTRAST 0
#endif
/* options which require a color display */
#ifndef LCD_COLOR
/* color coding for probes */
#ifdef UI_PROBE_COLORS
#undef UI_PROBE_COLORS
#endif
/* colored titles */
#ifdef UI_COLORED_TITLES
#undef UI_COLORED_TITLES
#endif
/* colored values */
#ifdef UI_COLORED_VALUES
#undef UI_COLORED_VALUES
#endif
/* colored cursor and key hints */
#ifdef UI_COLORED_CURSOR
#undef UI_COLORED_CURSOR
#endif
#endif
/* options which require a color graphics display */
#if ! defined (LCD_COLOR) || ! defined (LCD_GRAPHIC)
/* resistor color-codes */
#ifdef SW_R_E24_5_CC
#undef SW_R_E24_5_CC
#endif
#ifdef SW_R_E24_1_CC
#undef SW_R_E24_1_CC
#endif
#ifdef SW_R_E96_CC
#undef SW_R_E96_CC
#endif
#endif
/*
* fonts: additional characters
*/
/* additional font characters: probe numbers with reversed colors */
#ifdef UI_PROBE_REVERSED
#ifndef FONT_EXTRA
#define FONT_EXTRA
#endif
#endif
/* additional font characters: battery symbol */
#ifdef UI_BATTERY
#ifndef FONT_EXTRA
#define FONT_EXTRA
#endif
#endif
/*
* component symbols
*/
/* component symbols for fancy pinout */
#if defined (SYMBOLS_24X24_H) || defined (SYMBOLS_24X24_OLD_H) || defined (SYMBOLS_24X24_ALT1_H) || defined (SYMBOLS_24X24_ALT2_H)
#define SYMBOLS_SELECTED
#endif
#if defined (SYMBOLS_24X24_HF) || defined (SYMBOLS_24X24_OLD_HF) || defined (SYMBOLS_24X24_ALT1_HF) || defined (SYMBOLS_24X24_ALT2_HF)
#define SYMBOLS_SELECTED
#endif
#if defined (SYMBOLS_24X24_VFP) || defined (SYMBOLS_24X24_OLD_VFP) || defined (SYMBOLS_24X24_ALT1_VFP) || defined (SYMBOLS_24X24_ALT2_VFP)
#define SYMBOLS_SELECTED
#endif
#if defined (SYMBOLS_24X24_VP_F) || defined (SYMBOLS_24X24_OLD_VP_F) || defined (SYMBOLS_24X24_ALT1_VP_F) || defined (SYMBOLS_24X24_ALT2_VP_F)
#define SYMBOLS_SELECTED
#endif
#if defined (SYMBOLS_30X32_HF) || defined (SYMBOLS_30X32_OLD_HF) || defined (SYMBOLS_30X32_ALT1_HF) || defined (SYMBOLS_30X32_ALT2_HF)
#define SYMBOLS_SELECTED
#endif
#if defined (SYMBOLS_32X32_HF) || defined (SYMBOLS_32X32_OLD_HF) || defined (SYMBOLS_32X32_ALT1_HF) || defined (SYMBOLS_32X32_ALT2_HF)
#define SYMBOLS_SELECTED
#endif
#if defined (SYMBOLS_32X39_HF)
#define SYMBOLS_SELECTED
#endif
/* fancy pinout requires graphic display and symbol set */
#ifdef SW_SYMBOLS
/* graphic display */
#ifndef LCD_GRAPHIC
#undef SW_SYMBOLS
#endif
/* symbol set */
#ifndef SYMBOLS_SELECTED
#undef SW_SYMBOLS
#endif
#endif
/* additional component symbols */
#if defined (UI_QUESTION_MARK) || defined (UI_ZENER_DIODE) || defined (UI_QUARTZ_CRYSTAL) || defined (UI_ONEWIRE)
#ifndef SYMBOLS_EXTRA
#define SYMBOLS_EXTRA
#endif
#endif
/* options which require component symbols / fancy pinout */
#ifndef SW_SYMBOLS
/* question mark symbol */
#ifdef UI_QUESTION_MARK
#undef UI_QUESTION_MARK
#endif
/* Zener diode symbol */
#ifdef UI_ZENER_DIODE
#undef UI_ZENER_DIODE
#endif
/* quartz crystal symbol */
#ifdef UI_QUARTZ_CRYSTAL
#undef UI_QUARTZ_CRYSTAL
#endif
/* OneWire sensor symbol */
#ifdef UI_ONEWIRE
#undef UI_ONEWIRE
#endif
/* disabling text pinout */
#ifdef UI_NO_TEXTPINOUT
#undef UI_NO_TEXTPINOUT
#endif
/* test-output of component symbols */
#ifdef SW_SYMBOL_TEST
#undef SW_SYMBOL_TEST
#endif
#endif
/*
* PWM and counters
*/
/* PWM generators: can't have both variants */
#if defined (SW_PWM_SIMPLE) && defined (SW_PWM_PLUS)
#error <<< PWM: select either PWM generator with simple UI or fancy UI! >>>
#endif
/* frequency counter: can't have both variants */
#if defined (HW_FREQ_COUNTER_BASIC) && defined (HW_FREQ_COUNTER_EXT)
#error <<< Counter: select either basic or extended frequency counter! >>>
#endif
/* frequency counter: common switch */
#if defined (HW_FREQ_COUNTER_BASIC) || defined (HW_FREQ_COUNTER_EXT)
#define HW_FREQ_COUNTER
#endif
/* ring tester */
#if defined (HW_RING_TESTER)
/* requires pulse output */
#if ! defined (RING_TESTER_PIN) && ! defined (RING_TESTER_PROBES)
#error <<< Ring tester: select pulse output! >>>
#endif
/* prefer dedicated pin */
#if defined (RING_TESTER_PIN) && defined (RING_TESTER_PROBES)
#undef RING_TESTER_PROBES
#endif
#endif
/*
* IR detector/decoder
*/
/* IR detector/decoder: can't have probes and dedicated pin */
#if defined (SW_IR_RECEIVER) && defined (HW_IR_RECEIVER)
#error <<< Select either probes or dedicated IO pin for IR detector! >>>
#endif
/* IR detector/decoder (via probes): one pinout variant */
#if defined (SW_IR_RECEIVER)
#if ! defined (SW_IR_RX_PINOUT_G_V_D) && ! defined (SW_IR_RX_PINOUT_D_G_V) && ! defined (SW_IR_RX_PINOUT_D_V_G)
#error <<< IR receiver: no pinout selected! >>>
#endif
#endif
/*
* DS18B20
*/
/* rounding for DS18B20 requires DS18B20 support */
#ifdef UI_ROUND_DS18B20
#ifndef SW_DS18B20
#undef UI_ROUND_DS18B20
#endif
#endif
/*
* Zener check
*/
/* Zener check: can't have unswitched and switched mode */
#if defined (ZENER_UNSWITCHED) && defined (ZENER_SWITCHED)
#error <<< Zener check: select either unswitched or switched mode! >>>
#endif
/* Zener check, switched mode: boost converter drive methods */
#ifdef ZENER_SWITCHED
/* can't have high and low active */
#if defined (ZENER_BOOST_HIGH) && defined (ZENER_BOOST_LOW)
#error <<< Zener check: select either high or low active for boost converter! >>>
#endif
/* must have one drive method */
#if ! defined (ZENER_BOOST_HIGH) && ! defined (ZENER_BOOST_LOW)
#error <<< Zener check: select drive method for boost converter! >>>
#endif
#endif
/* Zener check during normal probing requires unswitched or switched mode */
#ifdef HW_PROBE_ZENER
#if ! defined (ZENER_UNSWITCHED) && ! defined (ZENER_SWITCHED)
#undef HW_PROBE_ZENER
#endif
#endif
/*
* R & D
*/
/* read functions for display require bus with read support enabled */
#ifdef LCD_READ
#if defined (LCD_SPI) && ! defined (SPI_RW)
#undef LCD_READ
#endif
#if defined (LCD_I2C) && ! defined (I2C_RW)
#undef LCD_READ
#endif
/* can't check parallel busses */
#endif
/* display ID requires read functions for display */
#ifdef SW_DISPLAY_ID
#ifndef LCD_READ
#undef SW_DISPLAY_ID
#endif
#endif
/* output of display registers requires read functions for display
and serial output */
#ifdef SW_DISPLAY_REG
#ifndef LCD_READ
#undef SW_DISPLAY_REG
#endif
#ifndef UI_SERIAL_COPY
#undef SW_DISPLAY_REG
#endif
#endif
/* ************************************************************************