Skip to content

Commit 2e63058

Browse files
committed
Add Stella target
1 parent ec7cc4e commit 2e63058

File tree

3 files changed

+304
-0
lines changed

3 files changed

+304
-0
lines changed
Lines changed: 246 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,246 @@
1+
/*
2+
* Copyright (c) 2019 Arduino SA
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
/* MBED TARGET LIST: ARDUINO_NANO33BLE */
18+
19+
#ifndef MBED_PINNAMES_H
20+
#define MBED_PINNAMES_H
21+
22+
#include "cmsis.h"
23+
#include "nrf_gpio.h"
24+
25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
29+
typedef enum {
30+
PIN_INPUT,
31+
PIN_OUTPUT
32+
} PinDirection;
33+
34+
///> define macro producing for example Px_y = NRF_GPIO_PIN_MAP(x, y)
35+
#define PinDef(port_num, pin_num) P##port_num##_##pin_num = NRF_GPIO_PIN_MAP(port_num, pin_num)
36+
37+
38+
typedef enum {
39+
PinDef(0 , 0), // P0_0 = 0...
40+
PinDef(0 , 1),
41+
PinDef(0 , 2),
42+
PinDef(0 , 3),
43+
PinDef(0 , 4),
44+
PinDef(0 , 5),
45+
PinDef(0 , 6),
46+
PinDef(0 , 7),
47+
PinDef(0 , 8),
48+
PinDef(0 , 9),
49+
PinDef(0 , 10),
50+
PinDef(0 , 11),
51+
PinDef(0 , 12),
52+
PinDef(0 , 13),
53+
PinDef(0 , 14),
54+
PinDef(0 , 15),
55+
PinDef(0 , 16),
56+
PinDef(0 , 17),
57+
PinDef(0 , 18),
58+
PinDef(0 , 19),
59+
PinDef(0 , 20),
60+
PinDef(0 , 21),
61+
PinDef(0 , 22),
62+
PinDef(0 , 23),
63+
PinDef(0 , 24),
64+
PinDef(0 , 25),
65+
PinDef(0 , 26),
66+
PinDef(0 , 27),
67+
PinDef(0 , 28),
68+
PinDef(0 , 29),
69+
PinDef(0 , 30),
70+
PinDef(0 , 31),
71+
72+
PinDef(1 , 0), //P1_1 = 32...
73+
PinDef(1 , 1),
74+
PinDef(1 , 2),
75+
PinDef(1 , 3),
76+
PinDef(1 , 4),
77+
PinDef(1 , 5),
78+
PinDef(1 , 6),
79+
PinDef(1 , 7),
80+
PinDef(1 , 8),
81+
PinDef(1 , 9),
82+
PinDef(1 , 10),
83+
PinDef(1 , 11),
84+
PinDef(1 , 12),
85+
PinDef(1 , 13),
86+
PinDef(1 , 14),
87+
PinDef(1 , 15),
88+
89+
// Port0
90+
p0 = P0_0,
91+
p1 = P0_1,
92+
p2 = P0_2,
93+
p3 = P0_3,
94+
p4 = P0_4,
95+
p5 = P0_5,
96+
p6 = P0_6,
97+
p7 = P0_7,
98+
p8 = P0_8,
99+
p9 = P0_9,
100+
p10 = P0_10,
101+
p11 = P0_11,
102+
p12 = P0_12,
103+
p13 = P0_13,
104+
p14 = P0_14,
105+
p15 = P0_15,
106+
p16 = P0_16,
107+
p17 = P0_17,
108+
p18 = P0_18,
109+
p19 = P0_19,
110+
p20 = P0_20,
111+
p21 = P0_21,
112+
p22 = P0_22,
113+
p23 = P0_23,
114+
p24 = P0_24,
115+
p25 = P0_25,
116+
p26 = P0_26,
117+
p27 = P0_27,
118+
p28 = P0_28,
119+
p29 = P0_29,
120+
p30 = P0_30,
121+
p31 = P0_31,
122+
123+
// Port1
124+
p32 = P1_0,
125+
p33 = P1_1,
126+
p34 = P1_2,
127+
p35 = P1_3,
128+
p36 = P1_4,
129+
p37 = P1_5,
130+
p38 = P1_6,
131+
p39 = P1_7,
132+
p40 = P1_8,
133+
p41 = P1_9,
134+
p42 = P1_10,
135+
p43 = P1_11,
136+
p44 = P1_12,
137+
p45 = P1_13,
138+
p46 = P1_14,
139+
p47 = P1_15,
140+
141+
RX_PIN_NUMBER = P1_10,
142+
TX_PIN_NUMBER = P1_3,
143+
144+
LED_BUILTIN = P0_13,
145+
LED_POWER = P1_9,
146+
147+
LED_RED = p24,
148+
LED_GREEN = p16,
149+
LED_BLUE = p6,
150+
151+
LED1 = LED_BUILTIN,
152+
LED2 = LED_RED,
153+
LED3 = LED_GREEN,
154+
LED4 = LED_BLUE,
155+
156+
// mBed interface Pins
157+
CONSOLE_TX = TX_PIN_NUMBER,
158+
CONSOLE_RX = RX_PIN_NUMBER,
159+
#if defined(MBED_CONF_TARGET_STDIO_UART_TX)
160+
STDIO_UART_TX = MBED_CONF_TARGET_STDIO_UART_TX,
161+
#else
162+
STDIO_UART_TX = CONSOLE_TX,
163+
#endif
164+
#if defined(MBED_CONF_TARGET_STDIO_UART_RX)
165+
STDIO_UART_RX = MBED_CONF_TARGET_STDIO_UART_RX,
166+
#else
167+
STDIO_UART_RX = CONSOLE_RX,
168+
#endif
169+
170+
SPI_PSELMOSI0 = P1_1,
171+
SPI_PSELMISO0 = P1_8,
172+
SPI_PSELSS0 = P1_2,
173+
SPI_PSELSCK0 = P0_13,
174+
175+
SPIS_PSELMOSI = P1_1,
176+
SPIS_PSELMISO = P1_8,
177+
SPIS_PSELSS = P1_2,
178+
SPIS_PSELSCK = P0_13,
179+
180+
I2C_SDA0 = p31,
181+
I2C_SCL0 = p2,
182+
183+
#ifndef ARDUINO_ARCH_MBED
184+
// Digital Pins
185+
D2 = P1_11,
186+
D3 = P1_12,
187+
D4 = P1_15,
188+
D5 = P1_13,
189+
D6 = P1_14,
190+
D7 = P0_23,
191+
D8 = P0_21,
192+
D9 = P0_27,
193+
D10 = P1_2,
194+
D11 = P1_1,
195+
D12 = P1_8,
196+
D13 = P0_13,
197+
198+
// Analog Pins
199+
A0 = p4,
200+
A1 = p5,
201+
A2 = p30,
202+
A3 = p29,
203+
A4 = p31,
204+
A5 = p2,
205+
A6 = p28,
206+
A7 = p3,
207+
#endif
208+
209+
AIN0 = p4,
210+
AIN1 = p5,
211+
AIN2 = p30,
212+
AIN3 = p29,
213+
AIN6 = p28,
214+
AIN7 = p3,
215+
216+
// Arduino Nano 33 BLE Sense Pins
217+
VDD_ENV = p22,
218+
INT_APDS = p19,
219+
220+
I2C_SDA1 = p14,
221+
I2C_SCL1 = p15,
222+
223+
MIC_PWR = p17,
224+
PDM_CLK = p26,
225+
PDM_DIN = p25,
226+
227+
// Not connected
228+
NC = (int)0xFFFFFFFF,
229+
230+
STDIO_UART_RTS = NC,
231+
STDIO_UART_CTS = NC,
232+
233+
} PinName;
234+
235+
typedef enum {
236+
PullNone = 0,
237+
PullDown = 1,
238+
PullUp = 3,
239+
PullDefault = PullUp
240+
} PinMode;
241+
242+
#ifdef __cplusplus
243+
}
244+
#endif
245+
246+
#endif
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
// The 'features' section in 'target.json' is now used to create the device's hardware preprocessor switches.
2+
// Check the 'features' section of the target description in 'targets.json' for more details.
3+
/* mbed Microcontroller Library
4+
* Copyright (c) 2006-2013 ARM Limited
5+
* SPDX-License-Identifier: Apache-2.0
6+
*
7+
* Licensed under the Apache License, Version 2.0 (the "License");
8+
* you may not use this file except in compliance with the License.
9+
* You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing, software
14+
* distributed under the License is distributed on an "AS IS" BASIS,
15+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16+
* See the License for the specific language governing permissions and
17+
* limitations under the License.
18+
*/
19+
#ifndef MBED_DEVICE_H
20+
#define MBED_DEVICE_H
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
37+
#include "objects.h"
38+
39+
#endif

targets/targets.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7332,6 +7332,25 @@
73327332
"CONFIG_GPIO_AS_PINRESET"
73337333
]
73347334
},
7335+
"STELLA": {
7336+
"inherits": [
7337+
"MCU_NRF52840"
7338+
],
7339+
"features_add": [
7340+
"STORAGE"
7341+
],
7342+
"components_remove": [
7343+
"QSPIF"
7344+
],
7345+
"device_has_add": ["WATCHDOG"],
7346+
"device_has_remove": [
7347+
"QSPI",
7348+
"ITM"
7349+
],
7350+
"macros_add": [
7351+
"CONFIG_GPIO_AS_PINRESET"
7352+
]
7353+
},
73357354
"EDGE_CONTROL": {
73367355
"inherits": ["MCU_NRF52840"],
73377356
"features_add": ["STORAGE"],

0 commit comments

Comments
 (0)