Skip to content

Commit 5318852

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

File tree

4 files changed

+257
-0
lines changed

4 files changed

+257
-0
lines changed
Lines changed: 203 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
/*
2+
* Copyright (c) 2016 Nordic Semiconductor ASA
3+
* All rights reserved.
4+
*
5+
* Redistribution and use in source and binary forms, with or without modification,
6+
* are permitted provided that the following conditions are met:
7+
*
8+
* 1. Redistributions of source code must retain the above copyright notice, this list
9+
* of conditions and the following disclaimer.
10+
*
11+
* 2. Redistributions in binary form, except as embedded into a Nordic Semiconductor ASA
12+
* integrated circuit in a product or a software update for such product, must reproduce
13+
* the above copyright notice, this list of conditions and the following disclaimer in
14+
* the documentation and/or other materials provided with the distribution.
15+
*
16+
* 3. Neither the name of Nordic Semiconductor ASA nor the names of its contributors may be
17+
* used to endorse or promote products derived from this software without specific prior
18+
* written permission.
19+
*
20+
* 4. This software, with or without modification, must only be used with a
21+
* Nordic Semiconductor ASA integrated circuit.
22+
*
23+
* 5. Any software provided in binary or object form under this license must not be reverse
24+
* engineered, decompiled, modified and/or disassembled.
25+
*
26+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
27+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
30+
* ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31+
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32+
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
33+
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35+
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36+
*
37+
*/
38+
39+
#ifndef MBED_PINNAMES_H
40+
#define MBED_PINNAMES_H
41+
42+
#include "cmsis.h"
43+
#include "nrf_gpio.h"
44+
45+
#ifdef __cplusplus
46+
extern "C" {
47+
#endif
48+
49+
typedef enum {
50+
PIN_INPUT,
51+
PIN_OUTPUT
52+
} PinDirection;
53+
54+
///> define macro producing for example Px_y = NRF_GPIO_PIN_MAP(x, y)
55+
#define PinDef(port_num, pin_num) P##port_num##_##pin_num = NRF_GPIO_PIN_MAP(port_num, pin_num)
56+
57+
58+
typedef enum {
59+
PinDef(0 , 0), // P0_0 = 0...
60+
PinDef(0 , 1),
61+
PinDef(0 , 2),
62+
PinDef(0 , 3),
63+
PinDef(0 , 4),
64+
PinDef(0 , 5),
65+
PinDef(0 , 6),
66+
PinDef(0 , 7),
67+
PinDef(0 , 8),
68+
PinDef(0 , 9),
69+
PinDef(0 , 10),
70+
PinDef(0 , 11),
71+
PinDef(0 , 12),
72+
PinDef(0 , 13),
73+
PinDef(0 , 14),
74+
PinDef(0 , 15),
75+
PinDef(0 , 16),
76+
PinDef(0 , 17),
77+
PinDef(0 , 18),
78+
PinDef(0 , 19),
79+
PinDef(0 , 20),
80+
PinDef(0 , 21),
81+
PinDef(0 , 22),
82+
PinDef(0 , 23),
83+
PinDef(0 , 24),
84+
PinDef(0 , 25),
85+
PinDef(0 , 26),
86+
PinDef(0 , 27),
87+
PinDef(0 , 28),
88+
PinDef(0 , 29),
89+
PinDef(0 , 30),
90+
PinDef(0 , 31),
91+
92+
PinDef(1 , 0), //P1_1 = 32...
93+
PinDef(1 , 1),
94+
PinDef(1 , 2),
95+
PinDef(1 , 3),
96+
PinDef(1 , 4),
97+
PinDef(1 , 5),
98+
PinDef(1 , 6),
99+
PinDef(1 , 7),
100+
PinDef(1 , 8),
101+
PinDef(1 , 9),
102+
PinDef(1 , 10),
103+
PinDef(1 , 11),
104+
PinDef(1 , 12),
105+
PinDef(1 , 13),
106+
PinDef(1 , 14),
107+
PinDef(1 , 15),
108+
109+
// Port0
110+
p0 = P0_0,
111+
p1 = P0_1,
112+
p2 = P0_2,
113+
p3 = P0_3,
114+
p4 = P0_4,
115+
p5 = P0_5,
116+
p6 = P0_6,
117+
p7 = P0_7,
118+
p8 = P0_8,
119+
p9 = P0_9,
120+
p10 = P0_10,
121+
p11 = P0_11,
122+
p12 = P0_12,
123+
p13 = P0_13,
124+
p14 = P0_14,
125+
p15 = P0_15,
126+
p16 = P0_16,
127+
p17 = P0_17,
128+
p18 = P0_18,
129+
p19 = P0_19,
130+
p20 = P0_20,
131+
p21 = P0_21,
132+
p22 = P0_22,
133+
p23 = P0_23,
134+
p24 = P0_24,
135+
p25 = P0_25,
136+
p26 = P0_26,
137+
p27 = P0_27,
138+
p28 = P0_28,
139+
p29 = P0_29,
140+
p30 = P0_30,
141+
p31 = P0_31,
142+
143+
// Port1
144+
p32 = P1_0,
145+
p33 = P1_1,
146+
p34 = P1_2,
147+
p35 = P1_3,
148+
p36 = P1_4,
149+
p37 = P1_5,
150+
p38 = P1_6,
151+
p39 = P1_7,
152+
p40 = P1_8,
153+
p41 = P1_9,
154+
p42 = P1_10,
155+
p43 = P1_11,
156+
p44 = P1_12,
157+
p45 = P1_13,
158+
p46 = P1_14,
159+
p47 = P1_15,
160+
161+
RX_PIN_NUMBER = p42,
162+
TX_PIN_NUMBER = p35,
163+
164+
LED1 = p13,
165+
166+
// mBed interface Pins
167+
USBTX = TX_PIN_NUMBER,
168+
USBRX = RX_PIN_NUMBER,
169+
STDIO_UART_TX = TX_PIN_NUMBER,
170+
STDIO_UART_RX = RX_PIN_NUMBER,
171+
172+
SPI_PSELMOSI0 = P1_1,
173+
SPI_PSELMISO0 = P1_8,
174+
SPI_PSELSCK0 = P0_13,
175+
176+
SPIS_PSELMOSI = P1_1,
177+
SPIS_PSELMISO = P1_8,
178+
SPIS_PSELSCK = P0_13,
179+
180+
I2C_SDA0 = p26,
181+
I2C_SCL0 = p27,
182+
183+
// Not connected
184+
NC = (int)0xFFFFFFFF,
185+
186+
STDIO_UART_RTS = NC,
187+
STDIO_UART_CTS = NC,
188+
SPI_PSELSS0 = NC,
189+
SPIS_PSELSS = NC
190+
} PinName;
191+
192+
typedef enum {
193+
PullNone = 0,
194+
PullDown = 1,
195+
PullUp = 3,
196+
PullDefault = PullUp
197+
} PinMode;
198+
199+
#ifdef __cplusplus
200+
}
201+
#endif
202+
203+
#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)