-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathconfig_328.h
1175 lines (1001 loc) · 52.1 KB
/
config_328.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
/* ************************************************************************
*
* ATmega 328 specific global configuration, setup and settings
*
* (c) 2012-2024 by Markus Reschke
* based on code from Markus Frejek and Karl-Heinz Kübbeler
*
* ************************************************************************ */
/* source management */
#define CONFIG_328_H
/* ************************************************************************
* display module
* ************************************************************************ */
/*
* display module / controller
*
* Please uncomment the package matching your LCD/OLED module and adjust
* settings. And comment out the default package (ST7565R, bit-bang SPI)
* if not used.
*
* To uncomment, remove the enclosing "#if 0" and "#endif" or put
* a "//" in front of both. To comment out, remove the "//" in front
* of the "#if 0" and "#endif".
*
* Individual settings can be enabled by removing the leading "//", or
* disabled by placing a "//" in front of the setting.
*/
/*
* HD44780
* - 4 bit parallel interface
* - if you change LCD_DB4/5/6/7 comment out LCD_DB_STD!
*/
#if 0
#define LCD_HD44780 /* display controller HD44780 */
#define LCD_TEXT /* character display */
#define LCD_PAR_4 /* 4 bit parallel interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_DB_STD /* use standard pins 0-3 for DB4-7 */
#define LCD_DB4 PD0 /* port pin used for DB4 */
#define LCD_DB5 PD1 /* port pin used for DB5 */
#define LCD_DB6 PD2 /* port pin used for DB6 */
#define LCD_DB7 PD3 /* port pin used for DB7 */
#define LCD_RS PD4 /* port pin used for RS */
#define LCD_EN1 PD5 /* port pin used for E */
/* display settings */
#define LCD_CHAR_X 16 /* characters per line */
#define LCD_CHAR_Y 2 /* number of lines */
/* HD44780 has an internal 5x7 font */
#define FONT_HD44780_INT /* International font (English) */
//#define FONT_HD44780_WIN1251 /* Cyrillic font (European) */
#endif
/*
* HD44780 plus PCF8574 based backpack
* - I2C interface using bit-bang I2C
* - if you change LCD_DB4/5/6/7 comment out LCD_DB_STD!
* - PCF8574T is 0x27, PCF8574AT is 0x3f
*/
#if 0
#define LCD_HD44780 /* display controller HD44780 */
#define LCD_TEXT /* character display */
#define LCD_PCF8574 /* PCF8574 backpack */
#define LCD_I2C_ADDR 0x3f /* PCF8574's I2C address */
/* control and data lines */
#define LCD_DB_STD /* use standard pins 4-7 for DB4-7 */
#define LCD_DB4 PCF8574_P4 /* port pin used for DB4 */
#define LCD_DB5 PCF8574_P5 /* port pin used for DB5 */
#define LCD_DB6 PCF8574_P6 /* port pin used for DB6 */
#define LCD_DB7 PCF8574_P7 /* port pin used for DB7 */
#define LCD_RS PCF8574_P0 /* port pin used for RS */
#define LCD_RW PCF8574_P1 /* port pin used for RW */
#define LCD_EN1 PCF8574_P2 /* port pin used for E */
#define LCD_LED PCF8574_P3 /* port pin used for backlight */
/* display settings */
#define LCD_CHAR_X 16 /* characters per line */
#define LCD_CHAR_Y 2 /* number of lines */
//#define LCD_BACKLIGHT_LOW /* backlight is low active */
/* HD44780 has an internal 5x7 font */
#define FONT_HD44780_INT /* International font (English) */
//#define FONT_HD44780_WIN1251 /* Cyrillic font (European) */
/* I2C bus */
#define I2C_BITBANG /* bit-bang I2C */
#define I2C_STANDARD_MODE /* 100kHz bus speed */
#define I2C_PORT PORTD /* I2C port data register */
#define I2C_DDR DDRD /* I2C port data direction register */
#define I2C_PIN PIND /* I2C port input pins register */
#define I2C_SDA PD0 /* port pin used for SDA */
#define I2C_SCL PD1 /* port pin used for SCL */
#endif
/*
* ILI9163
* - 4 wire SPI interface using bit-bang SPI
*/
#if 0
#define LCD_ILI9163 /* display controller ILI9163 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_COLOR /* color display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RES PD4 /* port pin used for /RESX (optional) */
#define LCD_CS PD5 /* port pin used for /CSX (optional) */
#define LCD_DC PD3 /* port pin used for D/CX */
#define LCD_SCL PD2 /* port pin used for SCL */
#define LCD_SDA PD1 /* port pin used for SDA/SDIO */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 128 /* number of vertical dots */
#define LCD_OFFSET_X 32 /* x offset of 32 dots (160-128) */
//#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
#define LCD_ROTATE /* switch X and Y (rotate by 90°) */
#define LCD_BGR /* reverse red and blue color channels */
//#define LCD_LATE_ON /* turn on LCD after clearing it */
/* font and symbols: horizonally aligned & flipped */
#define FONT_8X8_HF /* 8x8 font */
//#define FONT_8x16_ALT_HF /* 8x16 alternative font */
//#define FONT_10X16_HF /* 10x16 font */
//#define FONT_8X8_ISO8859_2_HF /* 8x8 Central European font */
//#define FONT_8X12T_ISO8859_2_HF /* thin 8x12 Central European font */
//#define FONT_8X16_ISO8859_2_HF /* 8x16 Central European font */
//#define FONT_10X16_ISO8859_2_HF /* 10x16 Central European font */
//#define FONT_8X16_WIN1251_HF /* 8x16 cyrillic font */
//#define FONT_8X16ALT_WIN1251_HF /* 8x16 alternative cyrillic font */
#define SYMBOLS_30X32_HF /* 30x32 symbols */
//#define SYMBOLS_30X32_ALT1_HF /* 30x32 alternative symbols #1 */
//#define SYMBOLS_30X32_ALT2_HF /* 30x32 alternative symbols #2 */
//#define SYMBOLS_32X32_HF /* 32x32 symbols */
//#define SYMBOLS_32X32_ALT1_HF /* 32x32 alternative symbols #1 */
//#define SYMBOLS_32X32_ALT2_HF /* 32x32 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SDA /* port pin used for MOSI */
#endif
/*
* ILI9342
* - SPI interface using bit-bang SPI
*/
#if 0
#define LCD_ILI9341 /* display controller ILI9341/ILI9342 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_COLOR /* color display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RES PD4 /* port pin used for /RES (optional) */
#define LCD_CS PD5 /* port pin used for /CS (optional) */
#define LCD_DC PD3 /* port pin used for D/C */
#define LCD_SCK PD2 /* port pin used for SCK */
#define LCD_SDI PD1 /* port pin used for SDI (data input) */
//#define LCD_SDO PD0 /* port pin used for SDO (data output) */
/* display settings */
#define LCD_DOTS_X 320 /* number of horizontal dots */
#define LCD_DOTS_Y 240 /* number of vertical dots */
//#define LCD_FLIP_X /* enable horizontal flip */
//#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_ROTATE /* switch X and Y (rotate by 90°) */
//#define LCD_BGR /* reverse red and blue color channels */
//#define LCD_EXT_CMD_OFF /* extended commands disabled */
/* font and symbols: horizontally aligned & flipped */
#define FONT_16X26_HF /* 16x26 font */
//#define FONT_16X26_ISO8859_2_HF /* 16x26 Central European font */
//#define FONT_16X26_WIN1251_HF /* 16x26 cyrillic font */
//#define SYMBOLS_32X32_HF /* 32x32 symbols */
//#define SYMBOLS_32X32_ALT1_HF /* 32x32 alternative symbols #1 */
//#define SYMBOLS_32X32_ALT2_HF /* 32x32 alternative symbols #2 */
#define SYMBOLS_32X39_HF /* 32x39 symbols */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCK /* port pin used for SCK */
#define SPI_MOSI LCD_SDI /* port pin used for MOSI */
#endif
/*
* PCD8544
* - SPI interface using bit-bang SPI
* - for a 180° rotated display (LCD_ROT180)
* - comment out "_VF" font and "_VFP" symbols
* - uncomment "_V_F" font and "_VP_F" symbols
*/
#if 0
#define LCD_PCD8544 /* display controller PCD8544 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RES PD4 /* port pin used for /RES (optional) */
#define LCD_SCE PD5 /* port pin used for /SCE (optional) */
#define LCD_DC PD3 /* port pin used for D/C */
#define LCD_SCLK PD2 /* port pin used for SCLK */
#define LCD_SDIN PD1 /* port pin used for SDIN (data input) */
/* display settings */
#define LCD_DOTS_X 84 /* number of horizontal dots */
#define LCD_DOTS_Y 48 /* number of vertical dots */
#define LCD_CONTRAST 66 /* default contrast (1-127) */
/* font and symbols: vertically aligned & flipped */
#define FONT_6X8_VF /* 6x8 font */
//#define FONT_6X8_ISO8859_2_VF /* 6x8 Central Euopean font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
//#define LCD_ROT180 /* rotate output by 180° (not supported yet) */
/* font and symbols: vertically aligned, bank-wise grouping, hor. flipped */
//#define FONT_6X8_V_F /* 6x8 font */
//#define FONT_6X8_ISO8859_2_V_F /* 6x8 Central Euopean font */
//#define SYMBOLS_24X24_VP_F /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VP_F /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VP_F /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCLK /* port pin used for SCK */
#define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
#endif
/*
* PCF8814
* - 3 wire SPI interface using bit-bang SPI
*/
#if 0
#define LCD_PCF8814 /* display controller PCF8814 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RES */
#define LCD_CS PD5 /* port pin used for /CS (optional) */
#define LCD_SCLK PD2 /* port pin used for SCLK */
#define LCD_SDIN PD1 /* port pin used for SDIN (data input) */
/* display settings */
#define LCD_DOTS_X 96 /* number of horizontal dots */
#define LCD_DOTS_Y 65 /* number of vertical dots */
//#define LCD_FLIP_Y /* enable vertical flip */
#define LCD_CONTRAST 5 /* default contrast (0-255) */
/* font and symbols: vertically aligned & flipped, page-wise grouping */
#define FONT_6X8_VF /* 6x8 font */
//#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_9 /* support 9 bit frames */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCLK /* port pin used for SCK */
#define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
#endif
/*
* SH1106
* - 4 wire SPI interface using bit-bang SPI
* - untested
*/
#if 0
#define LCD_SH1106 /* display controller SH1106 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RES (optional) */
#define LCD_CS PD5 /* port pin used for /CS (optional) */
#define LCD_A0 PD3 /* port pin used for A0 */
#define LCD_SCL PD2 /* port pin used for SCL */
#define LCD_SI PD1 /* port pin used for SI (data input) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
#define LCD_OFFSET_X 2 /* enable x offset of 2 or 4 dots */
#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_COM_SEQ /* COM pin layout: sequential */
#define LCD_CONTRAST 127 /* default contrast (0-255) */
/* font and symbols: vertically aligned & flipped, bank-wise grouping */
//#define FONT_6X8_VF /* 6x8 font */
#define FONT_8X8_VF /* 8x8 font */
//#define FONT_8X16_VFP /* 8x16 font */
//#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
//#define FONT_8X8_ISO8859_2_VF /* 8x8 Central European font */
//#define FONT_8X12T_ISO8859_2_VFP /* thin 8x12 Central European font */
//#define FONT_8X16_ISO8859_2_VFP /* 8x16 Central European font */
//#define FONT_8X8_WIN1251_VF /* 8x8 cyrillic font */
//#define FONT_8X8ALT_WIN1251_VF /* 8x8 alternative cyrillic font */
//#define FONT_8X8T_WIN1251_VF /* thin 8x8 cyrillic font */
//#define FONT_8X12T_WIN1251_VFP /* thin 8x12 cyrillic font */
//#define FONT_8X16_WIN1251_VFP /* 8x16 cyrillic font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SI /* port pin used for MOSI */
#endif
/*
* SH1106
* - 3 wire SPI interface using bit-bang SPI
* - untested
*/
#if 0
#define LCD_SH1106 /* display controller SH1106 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RES (optional) */
#define LCD_CS PD5 /* port pin used for /CS (optional) */
#define LCD_SCL PD2 /* port pin used for SCL */
#define LCD_SI PD1 /* port pin used for SI (data input) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
#define LCD_OFFSET_X 2 /* enable x offset of 2 or 4 dots */
#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_COM_SEQ /* COM pin layout: sequential */
#define LCD_CONTRAST 127 /* default contrast (0-255) */
/* font and symbols: vertically aligned & flipped, bank-wise grouping */
#define FONT_8X8_VF /* 8x8 font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_9 /* support 9 bit frames */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SI /* port pin used for MOSI */
#endif
/*
* SH1106
* - I2C interface using bit-bang I2C
*/
#if 0
#define LCD_SH1106 /* display controller SH1106 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_I2C /* I2C interface */
#define LCD_I2C_ADDR 0x3c /* SH1106's I2C address */
/* control lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
//#define LCD_RESET PD4 /* port pin used for /RES (optional) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
#define LCD_OFFSET_X 2 /* enable x offset of 2 or 4 dots */
#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_COM_SEQ /* COM pin layout: sequential */
#define LCD_CONTRAST 127 /* default contrast (0-255) */
/* font and symbols: vertically aligned & flipped, bank-wise grouping */
#define FONT_8X8_VF /* 8x8 font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* I2C bus */
#define I2C_BITBANG /* bit-bang I2C */
#define I2C_FAST_MODE /* 400kHz bus speed */
#define I2C_PORT PORTD /* I2C port data register */
#define I2C_DDR DDRD /* I2C port data direction register */
#define I2C_PIN PIND /* I2C port input pins register */
#define I2C_SDA PD0 /* port pin used for SDA */
#define I2C_SCL PD1 /* port pin used for SCL */
#endif
/*
* SSD1306
* - 4 wire SPI interface using bit-bang SPI
*/
#if 0
#define LCD_SSD1306 /* display controller SSD1306 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RES (optional) */
#define LCD_CS PD5 /* port pin used for /CS (optional) */
#define LCD_DC PD3 /* port pin used for D/C */
#define LCD_SCLK PD2 /* port pin used for SCLK */
#define LCD_SDIN PD1 /* port pin used for SDIN (data input) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_COM_SEQ /* COM pin layout: sequential */
//#define LCD_COM_REMAP /* COM pin mapping: reversed */
#define LCD_CONTRAST 127 /* default contrast (0-255) */
/* font and symbols: vertically aligned & flipped, bank-wise grouping */
//#define FONT_6X8_VF /* 6x8 font */
#define FONT_8X8_VF /* 8x8 font */
//#define FONT_8X16_VFP /* 8x16 font */
//#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
//#define FONT_8X8_ISO8859_2_VF /* 8x8 Central European font */
//#define FONT_8X12T_ISO8859_2_VFP /* thin 8x12 Central European font */
//#define FONT_8X16_ISO8859_2_VFP /* 8x16 Central European font */
//#define FONT_8X8_WIN1251_VF /* 8x8 cyrillic font */
//#define FONT_8X8ALT_WIN1251_VF /* 8x8 alternative cyrillic font */
//#define FONT_8X8T_WIN1251_VF /* thin 8x8 cyrillic font */
//#define FONT_8X12T_WIN1251_VFP /* thin 8x12 cyrillic font */
//#define FONT_8X16_WIN1251_VFP /* 8x16 cyrillic font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCLK /* port pin used for SCK */
#define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
#endif
/*
* SSD1306
* - 3 wire SPI interface using bit-bang SPI
*/
#if 0
#define LCD_SSD1306 /* display controller SSD1306 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RES (optional) */
#define LCD_CS PD5 /* port pin used for /CS (optional) */
#define LCD_SCLK PD2 /* port pin used for SCLK */
#define LCD_SDIN PD1 /* port pin used for SDIN (data input) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_COM_SEQ /* COM pin layout: sequential */
//#define LCD_COM_REMAP /* COM pin mapping: reversed */
#define LCD_CONTRAST 127 /* default contrast (0-255) */
/* font and symbols: vertically aligned & flipped, bank-wise grouping */
#define FONT_8X8_VF /* 8x8 font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_9 /* support 9 bit frames */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCLK /* port pin used for SCK */
#define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
#endif
/*
* SSD1306
* - I2C interface using bit-bang I2C
*/
#if 0
#define LCD_SSD1306 /* display controller SSD1306 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_I2C /* I2C interface */
#define LCD_I2C_ADDR 0x3c /* SSD1306's I2C address */
/* control lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RES (optional) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
//#define LCD_COM_SEQ /* COM pin layout: sequential */
//#define LCD_COM_REMAP /* COM pin mapping: reversed */
#define LCD_CONTRAST 127 /* default contrast (0-255) */
/* font and symbols: vertically aligned & flipped, bank-wise grouping */
#define FONT_8X8_VF /* 8x8 font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* I2C bus */
#define I2C_BITBANG /* bit-bang I2C */
#define I2C_FAST_MODE /* 400kHz bus speed */
#define I2C_PORT PORTD /* I2C port data register */
#define I2C_DDR DDRD /* I2C port data direction register */
#define I2C_PIN PIND /* I2C port input pins register */
#define I2C_SDA PD0 /* port pin used for SDA */
#define I2C_SCL PD1 /* port pin used for SCL */
#endif
/*
* ST7036
* - 4 bit parallel interface
* - enable LCD_DB_STD when using port pins 0-3 for LCD_DB4/5/6/7
* - untested!!!
*/
#if 0
#define LCD_ST7036 /* display controller ST7036 */
#define LCD_TEXT /* character display */
#define LCD_PAR_4 /* 4 bit parallel interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
//#define LCD_DB_STD /* use standard pins 0-3 for DB4-7 */
#define LCD_DB4 PD0 /* port pin used for DB4 */
#define LCD_DB5 PD1 /* port pin used for DB5 */
#define LCD_DB6 PD2 /* port pin used for DB6 */
#define LCD_DB7 PD3 /* port pin used for DB7 */
#define LCD_RS PD4 /* port pin used for RS */
#define LCD_EN PD5 /* port pin used for E */
//#define LCD_RW ??? /* port pin used for R/W (optional) */
//#define LCD_RESET ??? /* port pin used for XRESET (optional) */
/* display settings */
#define LCD_CHAR_X 16 /* characters per line */
#define LCD_CHAR_Y 3 /* number of lines */
#define LCD_EXTENDED_CMD /* extended instruction set (EXT pin high) */
#define LCD_CONTRAST 32 /* default contrast (0-63) */
/* ST7036 has internal 5x8 font */
#define FONT_ST7036 /* 5x8 font */
#endif
/*
* ST7036
* - 4 wire SPI interface using bit-bang SPI
* - untested!!!
*/
#if 0
#define LCD_ST7036 /* display controller ST7036 */
#define LCD_TEXT /* character display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for XRESET (optional) */
#define LCD_CS PD5 /* port pin used for CSB (optional) */
#define LCD_RS PD3 /* port pin used for RS */
#define LCD_SCL PD2 /* port pin used for SCL */
#define LCD_SI PD1 /* port pin used for SI (data input) */
/* display settings */
#define LCD_CHAR_X 16 /* characters per line */
#define LCD_CHAR_Y 3 /* number of lines */
#define LCD_EXTENDED_CMD /* extended instruction set (EXT pin high) */
#define LCD_CONTRAST 32 /* default contrast (0-63) */
/* ST7036 has internal 5x8 font */
#define FONT_ST7036 /* 5x8 font */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SI /* port pin used for MOSI */
#endif
/*
* ST7565R
* - SPI interface using bit-bang SPI
* - settings for Electronic Assembly EA DOGM/DOGL128-6
* - uses LCD_CS to support rotary encoder in parallel at PD2/3
*/
//#if 0
#define LCD_ST7565R /* display controller ST7565R */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD0 /* port pin used for /RES (optional) */
#define LCD_CS PD5 /* port pin used for /CS1 (optional) */
#define LCD_A0 PD1 /* port pin used for A0 */
#define LCD_SCL PD2 /* port pin used for SCL */
#define LCD_SI PD3 /* port pin used for SI (data input) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
#define LCD_OFFSET_X /* enable x offset of 4 dots */
//#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
#define LCD_START_Y 0 /* start line (0-63) */
#define LCD_CONTRAST 22 /* default contrast (0-63) */
//#define LCD_LONG_RESET /* long reset for NT7538 */
/* font and symbols: vertically aligned & flipped, bank-wise grouping */
//#define FONT_6X8_VF /* 6x8 font */
#define FONT_8X8_VF /* 8x8 font */
//#define FONT_8X16_VFP /* 8x16 font */
//#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
//#define FONT_8X8_ISO8859_2_VF /* 8x8 Central European font */
//#define FONT_8X12T_ISO8859_2_VFP /* thin 8x12 Central European font */
//#define FONT_8X16_ISO8859_2_VFP /* 8x16 Central European font */
//#define FONT_8X8_WIN1251_VF /* 8x8 cyrillic font */
//#define FONT_8X8ALT_WIN1251_VF /* 8x8 alternative cyrillic font */
//#define FONT_8X8T_WIN1251_VF /* thin 8x8 cyrillic font */
//#define FONT_8X12T_WIN1251_VFP /* thin 8x12 cyrillic font */
//#define FONT_8X16_WIN1251_VFP /* 8x16 cyrillic font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SI /* port pin used for MOSI */
//#endif
/*
* ST7735
* - 4 wire SPI interface using bit-bang SPI
*/
#if 0
#define LCD_ST7735 /* display controller ST7735 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_COLOR /* color display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RES PD4 /* port pin used for /RESX (optional) */
#define LCD_CS PD5 /* port pin used for /CSX (optional) */
#define LCD_DC PD3 /* port pin used for D/CX */
#define LCD_SCL PD2 /* port pin used for SCL */
#define LCD_SDA PD1 /* port pin used for SDA */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 160 /* number of vertical dots */
//#define LCD_OFFSET_X 4 /* enable x offset of 2 or 4 dots */
//#define LCD_OFFSET_Y 2 /* enable y offset of 1 or 2 dots */
//#define LCD_FLIP_X /* enable horizontal flip */
#define LCD_FLIP_Y /* enable vertical flip */
#define LCD_ROTATE /* switch X and Y (rotate by 90°) */
//#define LCD_BGR /* reverse red and blue color channels */
//#define LCD_LATE_ON /* turn on LCD after clearing it */
/* font and symbols: horizontally aligned & flipped */
//#define FONT_8x16_ALT_HF /* 8x16 alternative font */
#define FONT_10X16_HF /* 10x16 font */
//#define FONT_6X8_ISO8859_2_HF /* 6x8 Central European font */
//#define FONT_8X8_ISO8859_2_HF /* 8x8 Central European font */
//#define FONT_8X12T_ISO8859_2_HF /* thin 8x12 Central European font */
//#define FONT_8X16_ISO8859_2_HF /* 8x16 Central European font */
//#define FONT_10X16_ISO8859_2_HF /* 10x16 Central European font */
//#define FONT_8X16_WIN1251_HF /* 8x16 cyrillic font */
//#define FONT_8X16ALT_WIN1251_HF /* 8x16 alternative cyrillic font */
#define SYMBOLS_30X32_HF /* 30x32 symbols */
//#define SYMBOLS_30X32_ALT1_HF /* 30x32 alternative symbols #1 */
//#define SYMBOLS_30X32_ALT2_HF /* 30x32 alternative symbols #2 */
//#define SYMBOLS_32X32_HF /* 32x32 symbols */
//#define SYMBOLS_32X32_ALT1_HF /* 32x32 alternative symbols #1 */
//#define SYMBOLS_32X32_ALT2_HF /* 32x32 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCL /* port pin used for SCK */
#define SPI_MOSI LCD_SDA /* port pin used for MOSI */
#endif
/*
* ST7920
* - SPI interface using bit-bang SPI
* - for a 180° rotated display (LCD_ROT180)
* - comment out "_H" font and symbols
* - uncomment "_HF" font and symbols
*/
#if 0
#define LCD_ST7920 /* display controller ST7920 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RESET (optional) */
#define LCD_CS PD5 /* port pin used for CS (optional) */
#define LCD_SCLK PD2 /* port pin used for SCLK */
#define LCD_SID PD1 /* port pin used for SID (data input) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
/* font and symbols: horizonally aligned */
#define FONT_8X8_H /* 8x8 font */
//#define FONT_8X8_ISO8859_2_H /* 8x8 Central European font */
#define SYMBOLS_24X24_H /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_H /* alternative 24x24 symbols #1 */
//#define SYMBOLS_24X24_ALT2_H /* alternative 24x24 symbols #2 */
//#define LCD_ROT180 /* rotate output by 180° */
/* font and symbols: horizonally aligned & flipped */
//#define FONT_8X8_HF /* 8x8 font */
//#define FONT_8X8_ISO8859_2_HF /* 8x8 Central European font */
//#define SYMBOLS_24X24_HF /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_HF /* alternative 24x24 symbols #1 */
//#define SYMBOLS_24X24_ALT2_HF /* alternative 24x24 symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCLK /* port pin used for SCK */
#define SPI_MOSI LCD_SID /* port pin used for MOSI */
#endif
/*
* ST7920
* - 4 bit parallel interface
* - if you change LCD_DB4/5/6/7 comment out LCD_DB_STD!
* - for a 180° rotated display (LCD_ROT180)
* - comment out "_H" font and symbol
* - uncomment "_HF" font and symbol
*/
#if 0
#define LCD_ST7920 /* display controller ST7920 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_PAR_4 /* 4 bit parallel interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_DB_STD /* use standard pins 0-3 for DB4-7 */
#define LCD_DB4 PD0 /* port pin used for DB4 */
#define LCD_DB5 PD1 /* port pin used for DB5 */
#define LCD_DB6 PD2 /* port pin used for DB6 */
#define LCD_DB7 PD3 /* port pin used for DB7 */
#define LCD_RS PD4 /* port pin used for RS */
#define LCD_EN PD5 /* port pin used for E */
//#define LCD_RW PD? /* port pin used for RW (optional) */
//#define LCD_RESET PD? /* port pin used for /RESET (optional) */
/* display settings */
#define LCD_DOTS_X 128 /* number of horizontal dots */
#define LCD_DOTS_Y 64 /* number of vertical dots */
/* font and symbols: horizonally aligned */
#define FONT_8X8_H /* 8x8 font */
#define SYMBOLS_24X24_H /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_H /* alternative 24x24 symbols #1 */
//#define SYMBOLS_24X24_ALT2_H /* alternative 24x24 symbols #2 */
//#define LCD_ROT180 /* rotate output by 180° */
/* font and symbols: horizonally aligned & flipped */
//#define FONT_8X8_HF /* 8x8 font */
//#define SYMBOLS_24X24_HF /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_HF /* alternative 24x24 symbols #1 */
//#define SYMBOLS_24X24_ALT2_HF /* alternative 24x24 symbols #2 */
#endif
/*
* STE2007
* - 3 wire SPI interface using bit-bang SPI
*/
#if 0
#define LCD_STE2007 /* display controller STE2007 */
#define LCD_GRAPHIC /* graphic display */
#define LCD_SPI /* SPI interface */
/* control and data lines */
#define LCD_PORT PORTD /* port data register */
#define LCD_DDR DDRD /* port data direction register */
#define LCD_RESET PD4 /* port pin used for /RES (optional) */
#define LCD_CS PD5 /* port pin used for /CS (optional) */
#define LCD_SCLK PD2 /* port pin used for SCLK */
#define LCD_SDIN PD1 /* port pin used for SDIN (data input) */
/* display settings */
#define LCD_DOTS_X 96 /* number of horizontal dots */
#define LCD_DOTS_Y 68 /* number of vertical dots */
//#define LCD_FLIP_X /* enable horizontal flip */
//#define LCD_FLIP_Y /* enable vertical flip */
#define LCD_CONTRAST 16 /* default contrast (0-31) */
/* font and symbols: vertically aligned & flipped */
#define FONT_6X8_VF /* 6x8 font */
//#define FONT_6X8_ISO8859_2_VF /* 6x8 Central European font */
#define SYMBOLS_24X24_VFP /* 24x24 symbols */
//#define SYMBOLS_24X24_ALT1_VFP /* 24x24 alternative symbols #1 */
//#define SYMBOLS_24X24_ALT2_VFP /* 24x24 alternative symbols #2 */
/* SPI bus */
#define SPI_BITBANG /* bit-bang SPI */
#define SPI_9 /* support 9 bit frames */
#define SPI_PORT LCD_PORT /* SPI port data register */
#define SPI_DDR LCD_DDR /* SPI port data direction register */
#define SPI_SCK LCD_SCLK /* port pin used for SCK */
#define SPI_MOSI LCD_SDIN /* port pin used for MOSI */
#endif
/*
* VT100 serial terminal, TTL serial
*/
#if 0
#define LCD_VT100 /* pseudo display VT100 */
#define LCD_TEXT /* character display */
#define LCD_COLOR /* color display */
#define LCD_CHAR_X 40 /* characters per line */
#define LCD_CHAR_Y 24 /* number of lines */
#define SERIAL_BITBANG /* bit-bang serial */
//#define SERIAL_HARDWARE /* hardware serial */
#endif
/* ************************************************************************
* port and pin assignments
* ************************************************************************ */
/*
* test pins / probes:
* - Must be an ADC port!
* - It's recommended to use the lower 3 pins for the probes.
* - Don't share this port with POWER_CTRL or TEST_BUTTON!
*/
#define ADC_PORT PORTC /* port data register */
#define ADC_DDR DDRC /* port data direction register */
#define ADC_PIN PINC /* port input pins register */
#define TP1 PC0 /* test pin / probe #1 */
#define TP2 PC1 /* test pin / probe #2 */
#define TP3 PC2 /* test pin / probe #3 */
#define TP_ZENER PC3 /* test pin for for Zener check (10:1 voltage divider) */
#define TP_REF PC4 /* test pin for 2.5V reference and relay */
#define TP_BAT PC5 /* test pin for battery (4:1 voltage divider) */
#define TP_LOGIC PC3 /* test pin for Logic Probe (4:1 voltage divider) */
/*
* probe resistors
* - For PWM/squarewave output via probe #2 R_RL_2 has to be PB2/OC1B.
* - Don't share this port with POWER_CTRL or TEST_BUTTON!
*/
#define R_PORT PORTB /* port data register */
#define R_DDR DDRB /* port data direction register */
#define R_RL_1 PB0 /* Rl (680R) for test pin #1 */
#define R_RH_1 PB1 /* Rh (470k) for test pin #1 */
#define R_RL_2 PB2 /* Rl (680R) for test pin #2 */
#define R_RH_2 PB3 /* Rh (470k) for test pin #2 */
#define R_RL_3 PB4 /* Rl (680R) for test pin #3 */
#define R_RH_3 PB5 /* Rh (470k) for test pin #3 */
/*
* dedicated signal output via OC1B
* - don't change this!
*/
#define SIGNAL_PORT PORTB /* port data register */
#define SIGNAL_DDR DDRB /* port data direction register */
#define SIGNAL_OUT PB2 /* MCU's OC1B pin */
/*
* power control
* - can't be same port as ADC_PORT or R_PORT
*/
#define POWER_PORT PORTD /* port data register */
#define POWER_DDR DDRD /* port data direction register */
#define POWER_CTRL PD6 /* control pin (1: on / 0: off) */
/*
* test push button
* - can't be same port as ADC_PORT or R_PORT
*/
#define BUTTON_PORT PORTD /* port data register */
#define BUTTON_DDR DDRD /* port data direction register */
#define BUTTON_PIN PIND /* port input pins register */
#define TEST_BUTTON PD7 /* test/start push button (low active) */
/*
* rotary encoder
*/
#define ENCODER_PORT PORTD /* port data register */
#define ENCODER_DDR DDRD /* port data direction register */
#define ENCODER_PIN PIND /* port input pins register */
#define ENCODER_A PD3 /* rotary encoder A signal */
#define ENCODER_B PD2 /* rotary encoder B signal */
/*
* increase/decrease push buttons
*/
#define KEY_PORT PORTD /* port data register */
#define KEY_DDR DDRD /* port data direction register */
#define KEY_PIN PIND /* port input pins register */
#define KEY_INC PD2 /* increase push button (low active) */
#define KEY_DEC PD3 /* decrease push button (low active) */
/*
* frequency counter
* - input must be pin PD4/T0
*/
#define COUNTER_PORT PORTD /* port data register */
#define COUNTER_DDR DDRD /* port data direction register */
#define COUNTER_IN PD4 /* signal input T0 */
/*
* ring tester
* - counter input must be pin PD4/T0 (uses COUNTER_IN)
*/
#define RINGTESTER_PORT PORTD /* port data register */
#define RINGTESTER_DDR DDRD /* port data direction register */
#define RINGTESTER_OUT PD5 /* pulse output */
/*
* IR detector/decoder
* - fixed module connected to dedicated I/O pin
*/
#define IR_PORT PORTD /* port data register */
#define IR_DDR DDRD /* port data direction register */
#define IR_PIN PIND /* port input pins register */
#define IR_DATA PD5 /* data signal */
/*
* SPI