Skip to content

Commit ee76bd8

Browse files
Merge pull request #5231 from jrobeson/add-rblab-blenano2
Add support for RedBear's BLE Nano 2
2 parents 13d43d7 + a2c78e1 commit ee76bd8

File tree

3 files changed

+226
-0
lines changed

3 files changed

+226
-0
lines changed
Lines changed: 194 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,194 @@
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+
44+
#ifdef __cplusplus
45+
extern "C" {
46+
#endif
47+
48+
typedef enum {
49+
PIN_INPUT,
50+
PIN_OUTPUT
51+
} PinDirection;
52+
53+
#define PORT_SHIFT 3
54+
55+
typedef enum {
56+
p0 = 0,
57+
p1 = 1,
58+
p2 = 2,
59+
p3 = 3,
60+
p4 = 4,
61+
p5 = 5,
62+
p6 = 6,
63+
p7 = 7,
64+
p8 = 8,
65+
p9 = 9,
66+
p10 = 10,
67+
p11 = 11,
68+
p12 = 12,
69+
p13 = 13,
70+
p14 = 14,
71+
p15 = 15,
72+
p16 = 16,
73+
p17 = 17,
74+
p18 = 18,
75+
p19 = 19,
76+
p20 = 20,
77+
p21 = 21,
78+
p22 = 22,
79+
p23 = 23,
80+
p24 = 24,
81+
p25 = 25,
82+
p26 = 26,
83+
p27 = 27,
84+
p28 = 28,
85+
p29 = 29,
86+
p30 = 30,
87+
p31 = 31,
88+
89+
P0_0 = p0,
90+
P0_1 = p1,
91+
P0_2 = p2,
92+
P0_3 = p3,
93+
P0_4 = p4,
94+
P0_5 = p5,
95+
P0_6 = p6,
96+
P0_7 = p7,
97+
98+
P0_8 = p8,
99+
P0_9 = p9,
100+
P0_10 = p10,
101+
P0_11 = p11,
102+
P0_12 = p12,
103+
P0_13 = p13,
104+
P0_14 = p14,
105+
P0_15 = p15,
106+
107+
P0_16 = p16,
108+
P0_17 = p17,
109+
P0_18 = p18,
110+
P0_19 = p19,
111+
P0_20 = p20,
112+
P0_21 = p21,
113+
P0_22 = p22,
114+
P0_23 = p23,
115+
116+
P0_24 = p24,
117+
P0_25 = p25,
118+
P0_26 = p26,
119+
P0_27 = p27,
120+
P0_28 = p28,
121+
P0_29 = p29,
122+
P0_30 = p30,
123+
124+
LED1 = p11,
125+
LED2 = p11,
126+
LED3 = p11,
127+
LED4 = p11,
128+
129+
RX_PIN_NUMBER = p30,
130+
TX_PIN_NUMBER = p29,
131+
CTS_PIN_NUMBER = p28,
132+
RTS_PIN_NUMBER = p2,
133+
134+
// mBed interface Pins
135+
USBTX = TX_PIN_NUMBER,
136+
USBRX = RX_PIN_NUMBER,
137+
138+
SPI_PSELMOSI0 = p6,
139+
SPI_PSELMISO0 = p7,
140+
SPI_PSELSS0 = p3,
141+
SPI_PSELSCK0 = p8,
142+
143+
SPI_PSELMOSI1 = p29,
144+
SPI_PSELMISO1 = p30,
145+
SPI_PSELSS1 = p28,
146+
SPI_PSELSCK1 = p2,
147+
148+
SPIS_PSELMOSI = p29,
149+
SPIS_PSELMISO = p30,
150+
SPIS_PSELSS = p28,
151+
SPIS_PSELSCK = p2,
152+
153+
I2C_SDA0 = p28,
154+
I2C_SCL0 = p2,
155+
156+
D0 = p30,
157+
D1 = p29,
158+
D2 = p28,
159+
D3 = p2,
160+
161+
D4 = p3,
162+
D5 = p6,
163+
D6 = p7,
164+
D7 = p8,
165+
D8 = p21,
166+
167+
D9 = p4,
168+
D10 = p5,
169+
170+
D13 = p11,
171+
172+
A0 = p28,
173+
A1 = p29,
174+
A2 = p30,
175+
A3 = p2,
176+
A4 = p4,
177+
A5 = p5,
178+
179+
// Not connected
180+
NC = (int)0xFFFFFFFF
181+
} PinName;
182+
183+
typedef enum {
184+
PullNone = 0,
185+
PullDown = 1,
186+
PullUp = 3,
187+
PullDefault = PullUp
188+
} PinMode;
189+
190+
#ifdef __cplusplus
191+
}
192+
#endif
193+
194+
#endif
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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+
#include "objects.h"
22+
23+
#endif

targets/targets.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2083,6 +2083,15 @@
20832083
"extra_labels_add": ["RBLAB_BLENANO"],
20842084
"macros_add": ["TARGET_RBLAB_BLENANO"]
20852085
},
2086+
"RBLAB_BLENANO2": {
2087+
"supported_form_factors": ["ARDUINO"],
2088+
"inherits": ["MCU_NRF52"],
2089+
"macros_add": ["BOARD_PCA10040", "NRF52_PAN_12", "NRF52_PAN_15", "NRF52_PAN_58", "NRF52_PAN_55", "NRF52_PAN_54", "NRF52_PAN_31", "NRF52_PAN_30", "NRF52_PAN_51", "NRF52_PAN_36", "NRF52_PAN_53", "S132", "CONFIG_GPIO_AS_PINRESET", "BLE_STACK_SUPPORT_REQD", "SWI_DISABLE0", "NRF52_PAN_20", "NRF52_PAN_64", "NRF52_PAN_62", "NRF52_PAN_63"],
2090+
"device_has": ["ANALOGIN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
2091+
"release_versions": ["2", "5"],
2092+
"overrides": {"uart_hwfc": 0},
2093+
"device_name": "nRF52832_xxAA"
2094+
},
20862095
"NRF51822_Y5_MBUG": {
20872096
"inherits": ["MCU_NRF51_16K"]
20882097
},

0 commit comments

Comments
 (0)