Skip to content

Commit 7c7bad8

Browse files
committed
added avr mega 2560 support
1 parent 3aaf622 commit 7c7bad8

14 files changed

+719
-295
lines changed

v2/AciduinoV2/0_hardware_setup.ino

Lines changed: 168 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,168 @@
1+
// Display device
2+
//U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8X8_PIN_NONE);
3+
U8G2_SH1106_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE);
4+
5+
//
6+
// Pinout configuration
7+
//
8+
// Pre-defined released schematic pinout
9+
// for protoboard teensy 3.2+, protoboard avr mega, uOne and mega shield
10+
//
11+
// if you need change pinout, please do
12+
// it under USE_CUSTOM_PINOUT definitions
13+
// and ucomment the line bellow:
14+
//#define USE_CUSTOM_PINOUT
15+
#define USE_PROTOBOARD_PINOUT
16+
//#define USE_UONE_PINOUT
17+
//#define USE_MEGA_SHIELD_PINOUT
18+
19+
//
20+
// USE_CUSTOM_PINOUT
21+
//
22+
#if defined (USE_CUSTOM_PINOUT)
23+
24+
// going to use changer encoder?
25+
//#define NAV_ENCODER_DEC_PIN 24
26+
//#define NAV_ENCODER_INC_PIN 25
27+
28+
#define NAV_SHIFT_PIN 4
29+
30+
#define NAV_FUNCTION1_PIN 6
31+
#define NAV_FUNCTION2_PIN 7
32+
#define NAV_GENERAL1_PIN 3
33+
#define NAV_GENERAL2_PIN 5
34+
#define NAV_RIGHT_PIN 15
35+
#define NAV_UP_PIN 14
36+
#define NAV_DOWN_PIN 9
37+
#define NAV_LEFT_PIN 16
38+
39+
// going to use changer pot?
40+
#define CHANGER_POT_PIN A9
41+
42+
// any module pinout extension?
43+
//...
44+
45+
//
46+
// PROTOBOARD pinout for teensy and mega
47+
//
48+
#elif defined(USE_PROTOBOARD_PINOUT)
49+
50+
//
51+
// TEENSYDUINO generic
52+
//
53+
#if defined(TEENSYDUINO)
54+
55+
// going to use changer encoder?
56+
//#define NAV_ENCODER_DEC_PIN 24
57+
//#define NAV_ENCODER_INC_PIN 25
58+
59+
#define NAV_SHIFT_PIN 4
60+
61+
#define NAV_FUNCTION1_PIN 6
62+
#define NAV_FUNCTION2_PIN 7
63+
#define NAV_GENERAL1_PIN 3
64+
#define NAV_GENERAL2_PIN 5
65+
#define NAV_RIGHT_PIN 15
66+
#define NAV_UP_PIN 17
67+
#define NAV_DOWN_PIN 9
68+
#define NAV_LEFT_PIN 16
69+
70+
// going to use changer pot?
71+
#define CHANGER_POT_PIN A9
72+
73+
//
74+
// ARDUINO_ARCH_AVR Mega 2560 generic
75+
//
76+
#elif defined(ARDUINO_ARCH_AVR)
77+
78+
// going to use changer encoder?
79+
#define NAV_ENCODER_DEC_PIN 26
80+
#define NAV_ENCODER_INC_PIN 28
81+
82+
// or use changer pot?
83+
#define CHANGER_POT_PIN A8
84+
85+
#define NAV_SHIFT_PIN 13
86+
87+
#define NAV_FUNCTION1_PIN 12
88+
#define NAV_FUNCTION2_PIN 11
89+
#define NAV_GENERAL1_PIN 10
90+
#define NAV_GENERAL2_PIN 6
91+
#define NAV_RIGHT_PIN 5
92+
#define NAV_UP_PIN 4
93+
#define NAV_DOWN_PIN 3
94+
#define NAV_LEFT_PIN 2
95+
96+
#endif
97+
98+
//
99+
// Mega 2560 uModular shield
100+
//
101+
#elif defined(USE_MEGA_SHIELD_PINOUT)
102+
103+
// going to use changer encoder?
104+
#define NAV_ENCODER_DEC_PIN 26
105+
#define NAV_ENCODER_INC_PIN 28
106+
107+
// or use changer pot?
108+
#define CHANGER_POT_PIN A8
109+
110+
#define NAV_SHIFT_PIN 13
111+
112+
#define NAV_FUNCTION1_PIN 12
113+
#define NAV_FUNCTION2_PIN 11
114+
#define NAV_GENERAL1_PIN 10
115+
#define NAV_GENERAL2_PIN 6
116+
#define NAV_RIGHT_PIN 5
117+
#define NAV_UP_PIN 4
118+
#define NAV_DOWN_PIN 3
119+
#define NAV_LEFT_PIN 2
120+
121+
// the other controls are handled
122+
// by touch driver
123+
124+
// Extension modules
125+
// PUSH
126+
#define PUSH_LATCH_PIN 18
127+
// LED
128+
#define LED_LATCH_PIN 17
129+
// POT
130+
#define POT_CTRL_PIN1 45
131+
#define POT_CTRL_PIN2 47
132+
#define POT_CTRL_PIN3 49
133+
#define POT_MUX_COMM1 A0
134+
#define POT_MUX_COMM2 A1
135+
136+
//
137+
// uOne board
138+
//
139+
#elif defined(USE_UONE_PINOUT)
140+
141+
// going to use changer encoder?
142+
// teensy lc
143+
//#define NAV_ENCODER_DEC_PIN 24
144+
//#define NAV_ENCODER_INC_PIN 25
145+
// teensy 3.2+
146+
// on 3.2+ there are no digital port only analog :(
147+
#define NAV_ENCODER_DEC_PIN A10
148+
#define NAV_ENCODER_INC_PIN A11
149+
// swap per A6, A7? make nav encoder dec=20(A6) inc=21(A7)
150+
151+
#define NAV_SHIFT_PIN 23
152+
153+
// the other controls are handled
154+
// by touch driver
155+
156+
// Extension modules
157+
// LED
158+
#define LED_LATCH_PIN 17
159+
// TOUCH
160+
// 4 and 3 needs a swap, fix it on rev 0.2
161+
#define TOUCH_CTRL_PIN1 6
162+
#define TOUCH_CTRL_PIN2 5
163+
#define TOUCH_CTRL_PIN3 3
164+
#define TOUCH_CTRL_PIN4 4
165+
#define TOUCH_MUX_COMM1 A6
166+
#define TOUCH_MUX_COMM2 A7
167+
168+
#endif

0 commit comments

Comments
 (0)