Skip to content

Commit b08e1b3

Browse files
authored
Merge pull request #5837 from ashok-rao/br-ublox-NINA
Adding MTB ublox NINA-B1 as a new target
2 parents 78b65d0 + e1d9012 commit b08e1b3

File tree

3 files changed

+198
-0
lines changed

3 files changed

+198
-0
lines changed
Lines changed: 155 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,155 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2016 ARM Limited
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+
22+
#ifdef __cplusplus
23+
extern "C" {
24+
#endif
25+
26+
typedef enum {
27+
PIN_INPUT,
28+
PIN_OUTPUT
29+
} PinDirection;
30+
31+
#define PORT_SHIFT 3
32+
33+
typedef enum {
34+
// nRF52 pin names
35+
p0 = 0,
36+
p1 = 1,
37+
p2 = 2,
38+
p3 = 3,
39+
p4 = 4,
40+
p5 = 5,
41+
p6 = 6,
42+
p7 = 7,
43+
p8 = 8,
44+
p9 = 9,
45+
p10 = 10,
46+
p11 = 11,
47+
p12 = 12,
48+
p13 = 13,
49+
p14 = 14,
50+
p15 = 15,
51+
p16 = 16,
52+
p17 = 17,
53+
p18 = 18,
54+
p19 = 19,
55+
p20 = 20,
56+
p21 = 21,
57+
p22 = 22,
58+
p23 = 23,
59+
p24 = 24,
60+
p25 = 25,
61+
p26 = 26,
62+
p27 = 27,
63+
p28 = 28,
64+
p29 = 29,
65+
p30 = 30,
66+
p31 = 31,
67+
NC = (int)0xFFFFFFFF, // Not connected
68+
69+
//NINA-B112 module pin names
70+
P_1 = p8,
71+
P_2 = p11,
72+
P_3 = p12,
73+
P_4 = p13,
74+
P_5 = p14,
75+
P_6 = NC,
76+
P_7 = p16,
77+
P_8 = p18,
78+
P_9 = NC,
79+
P_10 = NC,
80+
P_11 = NC,
81+
P_12 = NC,
82+
P_13 = NC,
83+
P_14 = NC,
84+
P_15 = NC,
85+
P_16 = p28,
86+
P_17 = p29,
87+
P_18 = p30,
88+
P_19 = p21,
89+
P_20 = p31,
90+
P_21 = p7,
91+
P_22 = p6,
92+
P_23 = p5,
93+
P_24 = p2,
94+
P_25 = p3,
95+
P_26 = NC,
96+
P_27 = p4,
97+
P_28 = p9,
98+
P_29 = p10,
99+
P_30 = NC,
100+
101+
// MTB aliases
102+
GPIO18 = p30,
103+
104+
LED1 = p4, // Red LED
105+
LED2 = p10, // Green LED
106+
GPIO27 = LED1,
107+
// GPIO29 = LED2,
108+
109+
GPIO7 = p16, //A0 for LCD
110+
GPIO16 = p28, //RESET for LCD
111+
112+
SW1 = p29,
113+
GPIO17 = SW1,
114+
//Standardized button names
115+
BUTTON1 = SW1,
116+
117+
// Nordic SDK pin names
118+
RX_PIN_NUMBER = p5,
119+
TX_PIN_NUMBER = p6,
120+
CTS_PIN_NUMBER = p7,
121+
RTS_PIN_NUMBER = p31,
122+
123+
I2C_SDA = p2,
124+
I2C_SCL = p3,
125+
126+
SPI0_MOSI = p13,
127+
SPI0_MISO = p12,
128+
SPI0_SCK = p14,
129+
SPI0_CS = p11,
130+
SPI1_CS = p8,
131+
132+
SPI_MOSI = SPI0_MOSI,
133+
SPI_MISO = SPI0_MISO,
134+
SPI_SCK = SPI0_SCK,
135+
SPI_CS = SPI0_CS,
136+
137+
// DAPLink
138+
USBRX = RX_PIN_NUMBER,
139+
USBTX = TX_PIN_NUMBER,
140+
NTRST = p21,
141+
SWO = p18,
142+
143+
} PinName;
144+
145+
typedef enum {
146+
PullNone = 0,
147+
PullDown = 1,
148+
PullUp = 3,
149+
PullDefault = PullUp
150+
} PinMode;
151+
152+
#ifdef __cplusplus
153+
}
154+
#endif
155+
#endif
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2013 ARM Limited
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+
#ifndef MBED_DEVICE_H
17+
#define MBED_DEVICE_H
18+
19+
#include "objects.h"
20+
21+
#endif

targets/targets.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3374,6 +3374,28 @@
33743374
"release_versions": ["2", "5"],
33753375
"device_name": "nRF52832_xxAA"
33763376
},
3377+
"MTB_UBLOX_NINA_B1": {
3378+
"inherits": ["MCU_NRF52"],
3379+
"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"],
3380+
"device_has_add": ["ANALOGIN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
3381+
"extra_labels_add": ["MTB_UBLOX_NINA_B1"],
3382+
"release_versions": ["5"],
3383+
"device_name": "nRF52832_xxAA",
3384+
"bootloader_supported": true,
3385+
"overrides": {
3386+
"uart_hwfc": 0
3387+
},
3388+
"config": {
3389+
"usb_tx": {
3390+
"help": "Value p6",
3391+
"value": "p6"
3392+
},
3393+
"usb_rx": {
3394+
"help": "Value p5",
3395+
"value": "p5"
3396+
}
3397+
}
3398+
},
33773399
"DELTA_DFBM_NQ620": {
33783400
"supported_form_factors": ["ARDUINO"],
33793401
"inherits": ["MCU_NRF52"],

0 commit comments

Comments
 (0)