Skip to content

Commit 13caf85

Browse files
authored
Add files via upload
1 parent 333c259 commit 13caf85

File tree

2 files changed

+323
-0
lines changed

2 files changed

+323
-0
lines changed
Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
Copyright (c) 2018, Adafruit Industries (adafruit.com)
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
11+
This library is distributed in the hope that it will be useful,
12+
but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
14+
See the GNU Lesser General Public License for more details.
15+
16+
You should have received a copy of the GNU Lesser General Public
17+
License along with this library; if not, write to the Free Software
18+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19+
*/
20+
21+
#include "variant.h"
22+
#include "wiring_constants.h"
23+
#include "wiring_digital.h"
24+
#include "nrf.h"
25+
26+
const uint32_t g_ADigitalPinMap[] =
27+
{
28+
// D0 .. D13
29+
25, // D0 is P0.25 (Feather UART TX, mikroBUS MISO)
30+
24, // D1 is P0.24 (Feather UART RX, mikroBUS SCK)
31+
41, // D2 is P1.09 (Feather D2, mikroBUS MOSI) /// 10, // D2 is P0.10 (NFC2)
32+
42, // D3 is P1.10 (LED1)
33+
47, // D4 is P1.15 (LED2)
34+
40, // D5 is P1.08 (Feather D5, mikroBUS TX)
35+
7, // D6 is P0.07 (Feather D6, mikroBUS RX)
36+
34, // D7 is P1.02 (BTN1) /// 34, // D7 is P1.02 (Button)
37+
16, // D8 is P0.16 (NeoPixel)
38+
26, // D9 is P0.26 (Feather D9, mikroBUS INT)
39+
27, // D10 is P0.27 (Feather D10, mikroBUS PWM)
40+
46, // D11 is P1.14 (Feather D11) /// 6, // D11 is P0.06
41+
45, // D12 is P1.13 (Feather D12) /// 8, // D12 is P0.08
42+
44, // D13 is P1.12 (Feather D13) /// 41, // D13 is P1.09
43+
44+
// D14 .. D21 (aka A0 .. A7)
45+
4, // D14 is P0.04 (Feather A0, PMOD4)
46+
5, // D15 is P0.05 (Feather A1, PMOD3)
47+
30, // D16 is P0.30 (Feather A2, PMOD2)
48+
28, // D17 is P0.28 (Feather A3, PMOD1)
49+
2, // D18 is P0.02 (Feather A4)
50+
3, // D19 is P0.03 (Feather A5)
51+
29, // D20 is P0.29 (A6, Battery Voltage Monitoring)
52+
31, // D21 is P0.31 (A7, mikroBUS AN) /// ARef
53+
54+
// D22 .. D23 (aka I2C pins)
55+
12, // D22 is P0.12 (Feather SDA, mikroBUS SDA)
56+
11, // D23 is P0.11 (Feather SCL, mikroBUS SCL)
57+
58+
// D24 .. D26 (aka SPI pins)
59+
15, // D24 is P0.15 (Feather MISO, mikroBUS CS)
60+
13, // D25 is P0.13 (Feather MOSI, mikroBUS RST)
61+
14, // D26 is P0.14 (Feather SCK)
62+
63+
// QSPI pins (not exposed via any header / test point)
64+
19, // D27 is P0.19 (QSPI CLK)
65+
20, // D28 is P0.20 (QSPI CS)
66+
17, // D29 is P0.17 (QSPI Data 0)
67+
22, // D30 is P0.22 (QSPI Data 1)
68+
23, // D31 is P0.23 (QSPI Data 2)
69+
21, // D32 is P0.21 (QSPI Data 3)
70+
71+
// NFC pins
72+
9, // D33 is P0.09 (NFC1)
73+
10, // D34 is P0.10 (NFC2)
74+
75+
// Qwiic/Stemma QT
76+
6, // D35 is P0.06 (Qwiic SCL)
77+
8, // D36 is P0.08 (Qwiic SDA)
78+
79+
39, // D37 is P1.07 (BTN2)
80+
81+
36, // D38 is P1.04 (VOUTEN)
82+
83+
// PMOD pin5 to 8
84+
43, // D39 is P1.11 (PMOD5)
85+
33, // D40 is P1.01 (PMOD6)
86+
35, // D41 is P1.03 (PMOD7)
87+
37, // D42 is P1.05 (PMOD8)
88+
89+
38, // D43 is P1.06 is not connected
90+
91+
92+
// Thus, there are 44 defined pins
93+
94+
95+
// The following pins were never listed as they were considered unusable
96+
// 0, // P0.00 is XL1 (attached to 32.768kHz crystal)
97+
// 1, // is P0.01 is XL2 (attached to 32.768kHz crystal)
98+
// 18, // is P0.18 is RESET (attached to switch)
99+
// 32, // is P1.00 is SWO (attached to debug header)
100+
//
101+
102+
};
103+
104+
void initVariant()
105+
{
106+
// LED1 & LED2
107+
pinMode(PIN_LED1, OUTPUT);
108+
ledOff(PIN_LED1);
109+
110+
pinMode(PIN_LED2, OUTPUT);
111+
ledOff(PIN_LED2);
112+
}
113+

variants/omnimo_nrf52840/variant.h

Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
Copyright (c) 2018, Adafruit Industries (adafruit.com)
5+
6+
This library is free software; you can redistribute it and/or
7+
modify it under the terms of the GNU Lesser General Public
8+
License as published by the Free Software Foundation; either
9+
version 2.1 of the License, or (at your option) any later version.
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
See the GNU Lesser General Public License for more details.
14+
You should have received a copy of the GNU Lesser General Public
15+
License along with this library; if not, write to the Free Software
16+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
17+
*/
18+
19+
#ifndef _VARIANT_OMNIMO_NRF52840_
20+
#define _VARIANT_OMNIMO_NRF52840_
21+
22+
/** Master clock frequency */
23+
#define VARIANT_MCK (64000000ul)
24+
25+
#define USE_LFXO // Board uses 32khz crystal for LF
26+
// define USE_LFRC // Board uses RC for LF
27+
28+
/*----------------------------------------------------------------------------
29+
* Headers
30+
*----------------------------------------------------------------------------*/
31+
32+
#include "WVariant.h"
33+
34+
#ifdef __cplusplus
35+
extern "C"
36+
{
37+
#endif // __cplusplus
38+
39+
// Number of pins defined in PinDescription array
40+
#define PINS_COUNT (44)
41+
#define NUM_DIGITAL_PINS (44)
42+
#define NUM_ANALOG_INPUTS (8) // A6 is used for battery voltage monitoring
43+
#define NUM_ANALOG_OUTPUTS (0)
44+
45+
// LEDs /////////////////////
46+
#define PIN_LED1 (3)
47+
#define PIN_LED2 (4)
48+
#define PIN_NEOPIXEL (8)
49+
#define NEOPIXEL_NUM 1
50+
// Redefine
51+
#define LED1 PIN_LED1
52+
#define LED2 PIN_LED2
53+
54+
#define LED_BUILTIN PIN_LED1
55+
#define LED_CONN PIN_LED2
56+
57+
#define LED_GREEN PIN_LED1
58+
#define LED_RED PIN_LED1 // for compatibility with Feather nRF52840 Express
59+
#define LED_BLUE PIN_LED2
60+
61+
#define LED_STATE_ON 1 // State when LED is litted
62+
63+
// Buttons //////////////////
64+
#define PIN_BUTTON1 (7)
65+
#define PIN_BTN1 (7)
66+
#define PIN_BUTTON2 (37)
67+
#define PIN_BTN2 (37)
68+
// Redefine
69+
#define BTN1 PIN_BTN1
70+
#define BTN2 PIN_BTN2
71+
72+
// Analog Pins //////////////
73+
#define PIN_A0 (14)
74+
#define PIN_A1 (15)
75+
#define PIN_A2 (16)
76+
#define PIN_A3 (17)
77+
#define PIN_A4 (18)
78+
#define PIN_A5 (19)
79+
#define PIN_A6 (20)
80+
#define PIN_A7 (21) // mikroBUS AN
81+
82+
static const uint8_t A0 = PIN_A0 ;
83+
static const uint8_t A1 = PIN_A1 ;
84+
static const uint8_t A2 = PIN_A2 ;
85+
static const uint8_t A3 = PIN_A3 ;
86+
static const uint8_t A4 = PIN_A4 ;
87+
static const uint8_t A5 = PIN_A5 ;
88+
static const uint8_t A6 = PIN_A6 ;
89+
static const uint8_t A7 = PIN_A7 ;
90+
91+
#define PIN_VBAT PIN_A6
92+
93+
#define ADC_RESOLUTION 14
94+
95+
// NFC Pins /////////////////
96+
#define PIN_NFC1 (33)
97+
#define PIN_NFC2 (34)
98+
// Redefine
99+
#define NFC1 PIN_NFC1
100+
#define NFC2 PIN_NFC2
101+
102+
// Feather UART Pins ////////
103+
#define PIN_SERIAL1_RX (1)
104+
#define PIN_SERIAL1_TX (0)
105+
// Redefine
106+
#define PIN_FEATHER_RX PIN_SERIAL1_RX
107+
#define PIN_FEATHER_TX PIN_SERIAL1_TX
108+
109+
// Feather SPI Interface ////
110+
#define SPI_INTERFACES_COUNT 1
111+
112+
#define PIN_SPI_MISO (24)
113+
#define PIN_SPI_MOSI (25)
114+
#define PIN_SPI_SCK (26)
115+
// Redefine
116+
#define PIN_FEATHER_MISO PIN_SPI_MISO
117+
#define PIN_FEATHER_MOSI PIN_SPI_MOSI
118+
#define PIN_FEATHER_SCK PIN_SPI_SCK
119+
120+
static const uint8_t SS = (5);
121+
static const uint8_t MOSI = PIN_SPI_MOSI ;
122+
static const uint8_t MISO = PIN_SPI_MISO ;
123+
static const uint8_t SCK = PIN_SPI_SCK ;
124+
125+
// Feather I2C Interface ////
126+
#define WIRE_INTERFACES_COUNT 2
127+
128+
#define PIN_WIRE_SDA (22)
129+
#define PIN_WIRE_SCL (23)
130+
// Redefine
131+
#define PIN_FEATHER_SDA PIN_WIRE_SDA
132+
#define PIN_FEATHER_SCL PIN_WIRE_SCL
133+
134+
// mikroBUS Pins ////////////
135+
#define PIN_mikroBUS_PWM (10)
136+
#define PIN_mikroBUS_INT (9)
137+
#define PIN_mikroBUS_RX (6)
138+
#define PIN_mikroBUS_TX (5)
139+
#define PIN_mikroBUS_SCL (23)
140+
#define PIN_mikroBUS_SDA (22)
141+
142+
#define PIN_mikroBUS_AN (21)
143+
#define PIN_mikroBUS_RST (25)
144+
#define PIN_mikroBUS_CS (24)
145+
#define PIN_mikroBUS_SCK (1)
146+
#define PIN_mikroBUS_MISO (0)
147+
#define PIN_mikroBUS_MOSI (2)
148+
149+
// Redefine
150+
#define mikroBUS_PWM PIN_mikroBUS_PWM
151+
#define mikroBUS_INT PIN_mikroBUS_INT
152+
#define mikroBUS_RX PIN_mikroBUS_RX
153+
#define mikroBUS_TX PIN_mikroBUS_TX
154+
#define mikroBUS_SCL PIN_mikroBUS_SCL
155+
#define mikroBUS_SDA PIN_mikroBUS_SDA
156+
157+
#define mikroBUS_AN PIN_mikroBUS_AN
158+
#define mikroBUS_RST PIN_mikroBUS_RST
159+
#define mikroBUS_CS PIN_mikroBUS_CS
160+
#define mikroBUS_SCK PIN_mikroBUS_SCK
161+
#define mikroBUS_MISO PIN_mikroBUS_MISO
162+
#define mikroBUS_MOSI PIN_mikroBUS_MOSI
163+
164+
// PMOD Pins ////////////////
165+
#define PIN_PMOD1 (17)
166+
#define PIN_PMOD2 (16)
167+
#define PIN_PMOD3 (15)
168+
#define PIN_PMOD4 (14)
169+
#define PIN_PMOD5 (39)
170+
#define PIN_PMOD6 (40)
171+
#define PIN_PMOD7 (41)
172+
#define PIN_PMOD8 (42)
173+
// Redefine
174+
#define PMOD1 PIN_PMOD1
175+
#define PMOD2 PIN_PMOD2
176+
#define PMOD3 PIN_PMOD3
177+
#define PMOD4 PIN_PMOD4
178+
#define PMOD5 PIN_PMOD5
179+
#define PMOD6 PIN_PMOD6
180+
#define PMOD7 PIN_PMOD7
181+
#define PMOD8 PIN_PMOD8
182+
183+
// Qwiic Pins ///////////////
184+
#define PIN_QWIIC_SCL (35)
185+
#define PIN_QWIIC_SDA (36)
186+
// Redefine
187+
#define QWIIC_SCL PIN_QWIIC_SCL
188+
#define QWIIC_SDA PIN_QWIIC_SDA
189+
190+
// QSPI Pins ////////////////
191+
#define PIN_QSPI_SCK 27
192+
#define PIN_QSPI_CS 28
193+
#define PIN_QSPI_IO0 29
194+
#define PIN_QSPI_IO1 30
195+
#define PIN_QSPI_IO2 31
196+
#define PIN_QSPI_IO3 32
197+
198+
// On-board QSPI Flash //////
199+
#define EXTERNAL_FLASH_DEVICES GD25Q16C
200+
#define EXTERNAL_FLASH_USE_QSPI
201+
202+
#ifdef __cplusplus
203+
}
204+
#endif
205+
206+
/*----------------------------------------------------------------------------
207+
* Arduino objects - C++ only
208+
*----------------------------------------------------------------------------*/
209+
210+
#endif

0 commit comments

Comments
 (0)