Skip to content

Commit eecc5be

Browse files
committed
Add missing variants
Platformio supports more boards than plain arduino framework
1 parent 47a2815 commit eecc5be

File tree

44 files changed

+12396
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+12396
-0
lines changed

variants/Controllino_maxi/pins_arduino.h

Lines changed: 458 additions & 0 deletions
Large diffs are not rendered by default.

variants/Controllino_maxi_automation/pins_arduino.h

Lines changed: 460 additions & 0 deletions
Large diffs are not rendered by default.

variants/Controllino_mega/pins_arduino.h

Lines changed: 459 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/*
2+
pins_arduino.h - Pin definition functions for Arduino
3+
Part of Arduino - http://www.arduino.cc/
4+
5+
Copyright (c) 2007 David A. Mellis
6+
7+
This library is free software; you can redistribute it and/or
8+
modify it under the terms of the GNU Lesser General Public
9+
License as published by the Free Software Foundation; either
10+
version 2.1 of the License, or (at your option) any later version.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General
18+
Public License along with this library; if not, write to the
19+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20+
Boston, MA 02111-1307 USA
21+
22+
$Id: wiring.h 249 2007-02-03 16:52:51Z mellis $
23+
*/
24+
25+
#include "../standard/pins_arduino.h"
26+
#undef NUM_ANALOG_INPUTS
27+
#define NUM_ANALOG_INPUTS 8
28+
#define CONTROLLINO_MINI

variants/MightyHat/pins_arduino.h

Lines changed: 258 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,258 @@
1+
/*
2+
pins_arduino.h - Pin definition functions for Arduino
3+
Part of Arduino - http://www.arduino.cc/
4+
5+
Copyright (c) 2007 David A. Mellis
6+
7+
This library is free software; you can redistribute it and/or
8+
modify it under the terms of the GNU Lesser General Public
9+
License as published by the Free Software Foundation; either
10+
version 2.1 of the License, or (at your option) any later version.
11+
12+
This library is distributed in the hope that it will be useful,
13+
but WITHOUT ANY WARRANTY; without even the implied warranty of
14+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15+
Lesser General Public License for more details.
16+
17+
You should have received a copy of the GNU Lesser General
18+
Public License along with this library; if not, write to the
19+
Free Software Foundation, Inc., 59 Temple Place, Suite 330,
20+
Boston, MA 02111-1307 USA
21+
*/
22+
23+
#ifndef Pins_Arduino_h
24+
#define Pins_Arduino_h
25+
26+
#define MIGHTY_HAT
27+
28+
#include <avr/pgmspace.h>
29+
30+
#define NUM_DIGITAL_PINS 20
31+
#define NUM_ANALOG_INPUTS 6
32+
#define analogInputToDigitalPin(p) ((p < 6) ? (p) + 14 : -1)
33+
34+
#if defined(__AVR_ATmega8__)
35+
#define digitalPinHasPWM(p) ((p) == 9 || (p) == 10 || (p) == 11)
36+
#else
37+
#define digitalPinHasPWM(p) ((p) == 3 || (p) == 5 || (p) == 6 || (p) == 9 || (p) == 10 || (p) == 11)
38+
#endif
39+
40+
#define PIN_FLASHMEM_SS (8)
41+
#define PIN_SPI_SS (10)
42+
#define PIN_SPI_MOSI (11)
43+
#define PIN_SPI_MISO (12)
44+
#define PIN_SPI_SCK (13)
45+
46+
static const uint8_t SS_FLASHMEM = PIN_FLASHMEM_SS;
47+
static const uint8_t SS = PIN_SPI_SS;
48+
static const uint8_t MOSI = PIN_SPI_MOSI;
49+
static const uint8_t MISO = PIN_SPI_MISO;
50+
static const uint8_t SCK = PIN_SPI_SCK;
51+
52+
#define PIN_WIRE_SDA (18)
53+
#define PIN_WIRE_SCL (19)
54+
55+
static const uint8_t SDA = PIN_WIRE_SDA;
56+
static const uint8_t SCL = PIN_WIRE_SCL;
57+
58+
#define LED_BUILTIN 9
59+
60+
#define PIN_A0 (14)
61+
#define PIN_A1 (15)
62+
#define PIN_A2 (16)
63+
#define PIN_A3 (17)
64+
#define PIN_A4 (18)
65+
#define PIN_A5 (19)
66+
#define PIN_A6 (20)
67+
#define PIN_A7 (21)
68+
69+
static const uint8_t A0 = PIN_A0;
70+
static const uint8_t A1 = PIN_A1;
71+
static const uint8_t A2 = PIN_A2;
72+
static const uint8_t A3 = PIN_A3;
73+
static const uint8_t A4 = PIN_A4;
74+
static const uint8_t A5 = PIN_A5;
75+
static const uint8_t A6 = PIN_A6;
76+
static const uint8_t A7 = PIN_A7;
77+
78+
#define digitalPinToPCICR(p) (((p) >= 0 && (p) <= 21) ? (&PCICR) : ((uint8_t *)0))
79+
#define digitalPinToPCICRbit(p) (((p) <= 7) ? 2 : (((p) <= 13) ? 0 : 1))
80+
#define digitalPinToPCMSK(p) (((p) <= 7) ? (&PCMSK2) : (((p) <= 13) ? (&PCMSK0) : (((p) <= 21) ? (&PCMSK1) : ((uint8_t *)0))))
81+
#define digitalPinToPCMSKbit(p) (((p) <= 7) ? (p) : (((p) <= 13) ? ((p) - 8) : ((p) - 14)))
82+
83+
#define digitalPinToInterrupt(p) ((p) == 2 ? 0 : ((p) == 3 ? 1 : NOT_AN_INTERRUPT))
84+
85+
#ifdef ARDUINO_MAIN
86+
87+
// On the Arduino board, digital pins are also used
88+
// for the analog output (software PWM). Analog input
89+
// pins are a separate set.
90+
91+
// ATMEL ATMEGA8 & 168 / ARDUINO
92+
//
93+
// +-\/-+
94+
// PC6 1| |28 PC5 (AI 5)
95+
// (D 0) PD0 2| |27 PC4 (AI 4)
96+
// (D 1) PD1 3| |26 PC3 (AI 3)
97+
// (D 2) PD2 4| |25 PC2 (AI 2)
98+
// PWM+ (D 3) PD3 5| |24 PC1 (AI 1)
99+
// (D 4) PD4 6| |23 PC0 (AI 0)
100+
// VCC 7| |22 GND
101+
// GND 8| |21 AREF
102+
// PB6 9| |20 AVCC
103+
// PB7 10| |19 PB5 (D 13)
104+
// PWM+ (D 5) PD5 11| |18 PB4 (D 12)
105+
// PWM+ (D 6) PD6 12| |17 PB3 (D 11) PWM
106+
// (D 7) PD7 13| |16 PB2 (D 10) PWM
107+
// (D 8) PB0 14| |15 PB1 (D 9) PWM
108+
// +----+
109+
//
110+
// (PWM+ indicates the additional PWM pins on the ATmega168.)
111+
112+
// ATMEL ATMEGA1280 / ARDUINO
113+
//
114+
// 0-7 PE0-PE7 works
115+
// 8-13 PB0-PB5 works
116+
// 14-21 PA0-PA7 works
117+
// 22-29 PH0-PH7 works
118+
// 30-35 PG5-PG0 works
119+
// 36-43 PC7-PC0 works
120+
// 44-51 PJ7-PJ0 works
121+
// 52-59 PL7-PL0 works
122+
// 60-67 PD7-PD0 works
123+
// A0-A7 PF0-PF7
124+
// A8-A15 PK0-PK7
125+
126+
127+
// these arrays map port names (e.g. port B) to the
128+
// appropriate addresses for various functions (e.g. reading
129+
// and writing)
130+
const uint16_t PROGMEM port_to_mode_PGM[] = {
131+
NOT_A_PORT,
132+
NOT_A_PORT,
133+
(uint16_t) &DDRB,
134+
(uint16_t) &DDRC,
135+
(uint16_t) &DDRD,
136+
};
137+
138+
const uint16_t PROGMEM port_to_output_PGM[] = {
139+
NOT_A_PORT,
140+
NOT_A_PORT,
141+
(uint16_t) &PORTB,
142+
(uint16_t) &PORTC,
143+
(uint16_t) &PORTD,
144+
};
145+
146+
const uint16_t PROGMEM port_to_input_PGM[] = {
147+
NOT_A_PORT,
148+
NOT_A_PORT,
149+
(uint16_t) &PINB,
150+
(uint16_t) &PINC,
151+
(uint16_t) &PIND,
152+
};
153+
154+
const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
155+
PD, /* 0 */
156+
PD,
157+
PD,
158+
PD,
159+
PD,
160+
PD,
161+
PD,
162+
PD,
163+
PB, /* 8 */
164+
PB,
165+
PB,
166+
PB,
167+
PB,
168+
PB,
169+
PC, /* 14 */
170+
PC,
171+
PC,
172+
PC,
173+
PC,
174+
PC,
175+
};
176+
177+
const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
178+
_BV(0), /* 0, port D */
179+
_BV(1),
180+
_BV(2),
181+
_BV(3),
182+
_BV(4),
183+
_BV(5),
184+
_BV(6),
185+
_BV(7),
186+
_BV(0), /* 8, port B */
187+
_BV(1),
188+
_BV(2),
189+
_BV(3),
190+
_BV(4),
191+
_BV(5),
192+
_BV(0), /* 14, port C */
193+
_BV(1),
194+
_BV(2),
195+
_BV(3),
196+
_BV(4),
197+
_BV(5),
198+
};
199+
200+
const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
201+
NOT_ON_TIMER, /* 0 - port D */
202+
NOT_ON_TIMER,
203+
NOT_ON_TIMER,
204+
// on the ATmega168, digital pin 3 has hardware pwm
205+
#if defined(__AVR_ATmega8__)
206+
NOT_ON_TIMER,
207+
#else
208+
TIMER2B,
209+
#endif
210+
NOT_ON_TIMER,
211+
// on the ATmega168, digital pins 5 and 6 have hardware pwm
212+
#if defined(__AVR_ATmega8__)
213+
NOT_ON_TIMER,
214+
NOT_ON_TIMER,
215+
#else
216+
TIMER0B,
217+
TIMER0A,
218+
#endif
219+
NOT_ON_TIMER,
220+
NOT_ON_TIMER, /* 8 - port B */
221+
TIMER1A,
222+
TIMER1B,
223+
#if defined(__AVR_ATmega8__)
224+
TIMER2,
225+
#else
226+
TIMER2A,
227+
#endif
228+
NOT_ON_TIMER,
229+
NOT_ON_TIMER,
230+
NOT_ON_TIMER,
231+
NOT_ON_TIMER, /* 14 - port C */
232+
NOT_ON_TIMER,
233+
NOT_ON_TIMER,
234+
NOT_ON_TIMER,
235+
NOT_ON_TIMER,
236+
};
237+
238+
#endif
239+
240+
// These serial port names are intended to allow libraries and architecture-neutral
241+
// sketches to automatically default to the correct port name for a particular type
242+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
243+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
244+
//
245+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
246+
//
247+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
248+
//
249+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
250+
//
251+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
252+
//
253+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
254+
// pins are NOT connected to anything by default.
255+
#define SERIAL_PORT_MONITOR Serial
256+
#define SERIAL_PORT_HARDWARE Serial
257+
258+
#endif

0 commit comments

Comments
 (0)