Skip to content

Commit bd09884

Browse files
committed
[TARGET] Add Arduino NANO33BLE
1 parent 417a9fe commit bd09884

File tree

4 files changed

+239
-0
lines changed

4 files changed

+239
-0
lines changed
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
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+
#ifndef MBED_PINNAMES_H
18+
#define MBED_PINNAMES_H
19+
20+
#include "cmsis.h"
21+
#include "nrf_gpio.h"
22+
23+
#ifdef __cplusplus
24+
extern "C" {
25+
#endif
26+
27+
typedef enum {
28+
PIN_INPUT,
29+
PIN_OUTPUT
30+
} PinDirection;
31+
32+
///> define macro producing for example Px_y = NRF_GPIO_PIN_MAP(x, y)
33+
#define PinDef(port_num, pin_num) P##port_num##_##pin_num = NRF_GPIO_PIN_MAP(port_num, pin_num)
34+
35+
36+
typedef enum {
37+
PinDef(0 , 0), // P0_0 = 0...
38+
PinDef(0 , 1),
39+
PinDef(0 , 2),
40+
PinDef(0 , 3),
41+
PinDef(0 , 4),
42+
PinDef(0 , 5),
43+
PinDef(0 , 6),
44+
PinDef(0 , 7),
45+
PinDef(0 , 8),
46+
PinDef(0 , 9),
47+
PinDef(0 , 10),
48+
PinDef(0 , 11),
49+
PinDef(0 , 12),
50+
PinDef(0 , 13),
51+
PinDef(0 , 14),
52+
PinDef(0 , 15),
53+
PinDef(0 , 16),
54+
PinDef(0 , 17),
55+
PinDef(0 , 18),
56+
PinDef(0 , 19),
57+
PinDef(0 , 20),
58+
PinDef(0 , 21),
59+
PinDef(0 , 22),
60+
PinDef(0 , 23),
61+
PinDef(0 , 24),
62+
PinDef(0 , 25),
63+
PinDef(0 , 26),
64+
PinDef(0 , 27),
65+
PinDef(0 , 28),
66+
PinDef(0 , 29),
67+
PinDef(0 , 30),
68+
PinDef(0 , 31),
69+
70+
PinDef(1 , 0), //P1_1 = 32...
71+
PinDef(1 , 1),
72+
PinDef(1 , 2),
73+
PinDef(1 , 3),
74+
PinDef(1 , 4),
75+
PinDef(1 , 5),
76+
PinDef(1 , 6),
77+
PinDef(1 , 7),
78+
PinDef(1 , 8),
79+
PinDef(1 , 9),
80+
PinDef(1 , 10),
81+
PinDef(1 , 11),
82+
PinDef(1 , 12),
83+
PinDef(1 , 13),
84+
PinDef(1 , 14),
85+
PinDef(1 , 15),
86+
87+
// Port0
88+
p0 = P0_0,
89+
p1 = P0_1,
90+
p2 = P0_2,
91+
p3 = P0_3,
92+
p4 = P0_4,
93+
p5 = P0_5,
94+
p6 = P0_6,
95+
p7 = P0_7,
96+
p8 = P0_8,
97+
p9 = P0_9,
98+
p10 = P0_10,
99+
p11 = P0_11,
100+
p12 = P0_12,
101+
p13 = P0_13,
102+
p14 = P0_14,
103+
p15 = P0_15,
104+
p16 = P0_16,
105+
p17 = P0_17,
106+
p18 = P0_18,
107+
p19 = P0_19,
108+
p20 = P0_20,
109+
p21 = P0_21,
110+
p22 = P0_22,
111+
p23 = P0_23,
112+
p24 = P0_24,
113+
p25 = P0_25,
114+
p26 = P0_26,
115+
p27 = P0_27,
116+
p28 = P0_28,
117+
p29 = P0_29,
118+
p30 = P0_30,
119+
p31 = P0_31,
120+
121+
// Port1
122+
p32 = P1_0,
123+
p33 = P1_1,
124+
p34 = P1_2,
125+
p35 = P1_3,
126+
p36 = P1_4,
127+
p37 = P1_5,
128+
p38 = P1_6,
129+
p39 = P1_7,
130+
p40 = P1_8,
131+
p41 = P1_9,
132+
p42 = P1_10,
133+
p43 = P1_11,
134+
p44 = P1_12,
135+
p45 = P1_13,
136+
p46 = P1_14,
137+
p47 = P1_15,
138+
139+
RX_PIN_NUMBER = p42,
140+
TX_PIN_NUMBER = p35,
141+
142+
LED1 = p13,
143+
144+
// mBed interface Pins
145+
USBTX = TX_PIN_NUMBER,
146+
USBRX = RX_PIN_NUMBER,
147+
STDIO_UART_TX = TX_PIN_NUMBER,
148+
STDIO_UART_RX = RX_PIN_NUMBER,
149+
150+
SPI_PSELMOSI0 = P1_1,
151+
SPI_PSELMISO0 = P1_8,
152+
SPI_PSELSCK0 = P0_13,
153+
154+
SPIS_PSELMOSI = P1_1,
155+
SPIS_PSELMISO = P1_8,
156+
SPIS_PSELSCK = P0_13,
157+
158+
I2C_SDA0 = p26,
159+
I2C_SCL0 = p27,
160+
161+
// Not connected
162+
NC = (int)0xFFFFFFFF,
163+
164+
STDIO_UART_RTS = NC,
165+
STDIO_UART_CTS = NC,
166+
SPI_PSELSS0 = NC,
167+
SPIS_PSELSS = NC,
168+
169+
LED2 = NC,
170+
LED3 = NC,
171+
LED4 = NC,
172+
} PinName;
173+
174+
typedef enum {
175+
PullNone = 0,
176+
PullDown = 1,
177+
PullUp = 3,
178+
PullDefault = PullUp
179+
} PinMode;
180+
181+
#ifdef __cplusplus
182+
}
183+
#endif
184+
185+
#endif
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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+
*
6+
* Licensed under the Apache License, Version 2.0 (the "License");
7+
* you may not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing, software
13+
* distributed under the License is distributed on an "AS IS" BASIS,
14+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15+
* See the License for the specific language governing permissions and
16+
* limitations under the License.
17+
*/
18+
#ifndef MBED_DEVICE_H
19+
#define MBED_DEVICE_H
20+
21+
22+
23+
24+
25+
26+
27+
28+
29+
30+
31+
32+
33+
34+
35+
36+
#include "objects.h"
37+
38+
#endif

targets/TARGET_NORDIC/TARGET_NRF5x/TARGET_NRF52/mbed_lib.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,12 @@
200200
"NRF52_ERRATA_20"
201201
]
202202
},
203+
"ARDUINO_NANO33BLE": {
204+
"target.macros_add": [
205+
"CONFIG_GPIO_AS_PINRESET",
206+
"NRF52_ERRATA_20"
207+
]
208+
},
203209
"MTB_LAIRD_BL654": {
204210
"target.macros_add": [
205211
"CONFIG_GPIO_AS_PINRESET",

targets/targets.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7350,6 +7350,16 @@
73507350
"release_versions": ["5"],
73517351
"device_name": "nRF52840_xxAA"
73527352
},
7353+
"ARDUINO_NANO33BLE": {
7354+
"inherits": ["MCU_NRF52840"],
7355+
"release_versions": ["5"],
7356+
"device_name": "nRF52840_xxAA",
7357+
"features_add": ["BLE", "STORAGE"],
7358+
"components_remove": ["QSPIF"],
7359+
"components_add": ["FLASHIAP"],
7360+
"device_has_remove": ["QSPI"],
7361+
"device_has_add": ["FLASH"]
7362+
},
73537363
"MTB_LAIRD_BL654": {
73547364
"inherits": ["MCU_NRF52840"],
73557365
"release_versions": ["5"],

0 commit comments

Comments
 (0)