Skip to content

Commit bd49f43

Browse files
committed
Add support for the VBLUno52 board
Fix ERROR_PATTERN in VBLUNO52 config Signed-off-by: iotvietmember <[email protected]>
1 parent 953b925 commit bd49f43

File tree

3 files changed

+284
-0
lines changed

3 files changed

+284
-0
lines changed
Lines changed: 253 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
/*
2+
* Copyright (c) 2017 VNG IoT Lab, Vietnam
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+
/*
40+
* PinNames for the VBLUno52 board
41+
*/
42+
#ifndef MBED_PINNAMES_H
43+
#define MBED_PINNAMES_H
44+
45+
#include "cmsis.h"
46+
47+
#ifdef __cplusplus
48+
extern "C" {
49+
#endif
50+
51+
typedef enum {
52+
PIN_INPUT,
53+
PIN_OUTPUT
54+
} PinDirection;
55+
56+
#define PORT_SHIFT 3
57+
58+
typedef enum {
59+
p0 = 0,
60+
p1 = 1,
61+
p2 = 2,
62+
p3 = 3,
63+
p4 = 4,
64+
p5 = 5,
65+
p6 = 6,
66+
p7 = 7,
67+
p8 = 8,
68+
p9 = 9,
69+
p10 = 10,
70+
p11 = 11,
71+
p12 = 12,
72+
p13 = 13,
73+
p14 = 14,
74+
p15 = 15,
75+
p16 = 16,
76+
p17 = 17,
77+
p18 = 18,
78+
p19 = 19,
79+
p20 = 20,
80+
p21 = 21,
81+
p22 = 22,
82+
p23 = 23,
83+
p24 = 24,
84+
p25 = 25,
85+
p26 = 26,
86+
p27 = 27,
87+
p28 = 28,
88+
p29 = 29,
89+
p30 = 30,
90+
p31 = 31,
91+
92+
P0_0 = p0,
93+
P0_1 = p1,
94+
P0_2 = p2,
95+
P0_3 = p3,
96+
P0_4 = p4,
97+
P0_5 = p5,
98+
P0_6 = p6,
99+
P0_7 = p7,
100+
101+
P0_8 = p8,
102+
P0_9 = p9,
103+
P0_10 = p10,
104+
P0_11 = p11,
105+
P0_12 = p12,
106+
P0_13 = p13,
107+
P0_14 = p14,
108+
P0_15 = p15,
109+
110+
P0_16 = p16,
111+
P0_17 = p17,
112+
P0_18 = p18,
113+
P0_19 = p19,
114+
P0_20 = p20,
115+
P0_21 = p21,
116+
P0_22 = p22,
117+
P0_23 = p23,
118+
119+
P0_24 = p24,
120+
P0_25 = p25,
121+
P0_26 = p26,
122+
P0_27 = p27,
123+
P0_28 = p28,
124+
P0_29 = p29,
125+
P0_30 = p30,
126+
P0_31 = p31,
127+
128+
//only for mbed test suite
129+
LED1 = p12,
130+
LED2 = p18,
131+
LED3 = p19,
132+
LED4 = p20,
133+
134+
//only for mbed test suite
135+
BUTTON1 = p17,
136+
BUTTON2 = p3,
137+
BUTTON3 = p4,
138+
BUTTON4 = p28,
139+
140+
RX_PIN_NUMBER = p8,
141+
TX_PIN_NUMBER = p6,
142+
CTS_PIN_NUMBER = p7, //not on Header
143+
RTS_PIN_NUMBER = p5, //not on Header
144+
145+
// mBed interface Pins
146+
USBTX = TX_PIN_NUMBER,
147+
USBRX = RX_PIN_NUMBER,
148+
149+
SPI_PSELMOSI0 = p13,
150+
SPI_PSELMISO0 = p14,
151+
SPI_PSELSS0 = p11,
152+
SPI_PSELSCK0 = p15,
153+
154+
SPI_PSELMOSI1 = p13,
155+
SPI_PSELMISO1 = p14,
156+
SPI_PSELSS1 = p11,
157+
SPI_PSELSCK1 = p15,
158+
159+
SPIS_PSELMOSI = p13,
160+
SPIS_PSELMISO = p14,
161+
SPIS_PSELSS = p11,
162+
SPIS_PSELSCK = p15,
163+
164+
I2C_SDA = p26,
165+
I2C_SCL = p27,
166+
167+
I2C_SDA0 = p26,
168+
I2C_SCL0 = p27,
169+
170+
I2C_SDA1 = p30,
171+
I2C_SCL1 = p31,
172+
173+
RESET = p21,
174+
175+
NFC1 = p9,
176+
NFC2 = p10,
177+
178+
//Adruino interface pins
179+
D0 = p8,
180+
D1 = p6,
181+
D2 = p24,
182+
D3 = p23,
183+
D4 = p22,
184+
D5 = p18,
185+
D6 = p19,
186+
D7 = p20,
187+
188+
D8 = p9,
189+
D9 = p10,
190+
D10 = p11,
191+
D11 = p13,
192+
D12 = p14,
193+
D13 = p15,
194+
195+
D14 = p3,
196+
D15 = p4,
197+
D16 = p28,
198+
D17 = p29,
199+
D18 = p30,
200+
D19 = p31,
201+
202+
D20 = p26,
203+
D21 = p27,
204+
205+
D22 = p12,
206+
D23 = p17,
207+
208+
D24 = p5,
209+
D25 = p7,
210+
211+
A0 = D14,
212+
A1 = D15,
213+
A2 = D16,
214+
A3 = D17,
215+
A4 = D18,
216+
A5 = D19,
217+
218+
SS = D10,
219+
MOSI = D11,
220+
MISO = D12,
221+
SCK = D13,
222+
223+
SDA0 = D20,
224+
SCL0 = D21,
225+
SDA1 = D18,
226+
SCL1 = D19,
227+
SDA = SDA0,
228+
SCL = SCL0,
229+
230+
RX = D0,
231+
TX = D1,
232+
RTS = D24, //not on Header
233+
CTS = D25, //not on Header
234+
235+
LED = D22, //not on Header
236+
BUT = D23, //not on Header
237+
238+
// Not connected
239+
NC = (int)0xFFFFFFFF
240+
} PinName;
241+
242+
typedef enum {
243+
PullNone = 0,
244+
PullDown = 1,
245+
PullUp = 3,
246+
PullDefault = PullUp
247+
} PinMode;
248+
249+
#ifdef __cplusplus
250+
}
251+
#endif
252+
253+
#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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3006,5 +3006,13 @@
30063006
"device_has": ["ANALOGIN", "ERROR_PATTERN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
30073007
"release_versions": ["2"],
30083008
"device_name": "nRF51822_xxAC"
3009+
},
3010+
"VBLUNO52": {
3011+
"supported_form_factors": ["ARDUINO"],
3012+
"inherits": ["MCU_NRF52"],
3013+
"macros_add": ["BOARD_PCA10040", "BOARD_VBLUNO52", "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"],
3014+
"device_has": ["ANALOGIN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
3015+
"release_versions": ["2"],
3016+
"device_name": "nRF52832_xxAA"
30093017
}
30103018
}

0 commit comments

Comments
 (0)