Skip to content

Commit ec719bc

Browse files
Ashok RaoAshok Rao
authored andcommitted
Adding MTB ublox NINA-B1 as a new target
1 parent a5f1426 commit ec719bc

File tree

3 files changed

+182
-0
lines changed

3 files changed

+182
-0
lines changed
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
#ifndef MBED_PINNAMES_H
2+
#define MBED_PINNAMES_H
3+
4+
#include "cmsis.h"
5+
6+
#ifdef __cplusplus
7+
extern "C" {
8+
#endif
9+
10+
typedef enum {
11+
PIN_INPUT,
12+
PIN_OUTPUT
13+
} PinDirection;
14+
15+
#define PORT_SHIFT 3
16+
17+
typedef enum {
18+
// nRF52 pin names
19+
p0 = 0,
20+
p1 = 1,
21+
p2 = 2,
22+
p3 = 3,
23+
p4 = 4,
24+
p5 = 5,
25+
p6 = 6,
26+
p7 = 7,
27+
p8 = 8,
28+
p9 = 9,
29+
p10 = 10,
30+
p11 = 11,
31+
p12 = 12,
32+
p13 = 13,
33+
p14 = 14,
34+
p15 = 15,
35+
p16 = 16,
36+
p17 = 17,
37+
p18 = 18,
38+
p19 = 19,
39+
p20 = 20,
40+
p21 = 21,
41+
p22 = 22,
42+
p23 = 23,
43+
p24 = 24,
44+
p25 = 25,
45+
p26 = 26,
46+
p27 = 27,
47+
p28 = 28,
48+
p29 = 29,
49+
p30 = 30,
50+
p31 = 31,
51+
NC = (int)0xFFFFFFFF, // Not connected
52+
53+
//NINA-B112 module pin names
54+
P_1 = p8,
55+
P_2 = p11,
56+
P_3 = p12,
57+
P_4 = p13,
58+
P_5 = p14,
59+
P_6 = NC,
60+
P_7 = p16,
61+
P_8 = p18,
62+
P_9 = NC,
63+
P_10 = NC,
64+
P_11 = NC,
65+
P_12 = NC,
66+
P_13 = NC,
67+
P_14 = NC,
68+
P_15 = NC,
69+
P_16 = p28,
70+
P_17 = p29,
71+
P_18 = p30,
72+
P_19 = p21,
73+
P_20 = p31,
74+
P_21 = p7,
75+
P_22 = p6,
76+
P_23 = p5,
77+
P_24 = p2,
78+
P_25 = p3,
79+
P_26 = NC,
80+
P_27 = p4,
81+
P_28 = p9,
82+
P_29 = p10,
83+
P_30 = NC,
84+
85+
// MTB aliases
86+
GPIO18 = p30,
87+
88+
LED1 = p4, // Red LED
89+
LED2 = p10, // Green LED
90+
GPIO27 = LED1,
91+
// GPIO29 = LED2,
92+
93+
GPIO7 = p16, //A0 for LCD
94+
GPIO16 = p28, //RESET for LCD
95+
96+
SW1 = p29,
97+
GPIO17 = SW1,
98+
//Standardized button names
99+
BUTTON1 = SW1,
100+
101+
// Nordic SDK pin names
102+
RX_PIN_NUMBER = p5,
103+
TX_PIN_NUMBER = p6,
104+
CTS_PIN_NUMBER = p7,
105+
RTS_PIN_NUMBER = p31,
106+
107+
I2C_SDA = p2,
108+
I2C_SCL = p3,
109+
110+
SPI0_MOSI = p13,
111+
SPI0_MISO = p12,
112+
SPI0_SCK = p14,
113+
SPI0_CS = p11,
114+
SPI1_CS = p8,
115+
116+
SPI_MOSI = SPI0_MOSI,
117+
SPI_MISO = SPI0_MISO,
118+
SPI_SCK = SPI0_SCK,
119+
SPI_CS = SPI0_CS,
120+
121+
// DAPLink
122+
USBRX = RX_PIN_NUMBER,
123+
USBTX = TX_PIN_NUMBER,
124+
NTRST = p21,
125+
SWO = p18,
126+
127+
} PinName;
128+
129+
typedef enum {
130+
PullNone = 0,
131+
PullDown = 1,
132+
PullUp = 3,
133+
PullDefault = PullUp
134+
} PinMode;
135+
136+
#ifdef __cplusplus
137+
}
138+
#endif
139+
#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
@@ -3247,6 +3247,28 @@
32473247
"release_versions": ["2", "5"],
32483248
"device_name": "nRF52832_xxAA"
32493249
},
3250+
"MTB_UBLOX_NINA_B1": {
3251+
"inherits": ["MCU_NRF52"],
3252+
"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"],
3253+
"device_has_add": ["ANALOGIN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
3254+
"extra_labels_add": ["MTB_UBLOX_NINA_B1"],
3255+
"release_versions": ["5"],
3256+
"device_name": "nRF52832_xxAA",
3257+
"bootloader_supported": true,
3258+
"overrides": {
3259+
"uart_hwfc": 0
3260+
},
3261+
"config": {
3262+
"usb_tx": {
3263+
"help": "Value p6",
3264+
"value": "p6"
3265+
},
3266+
"usb_rx": {
3267+
"help": "Value p5",
3268+
"value": "p5"
3269+
}
3270+
}
3271+
},
32503272
"DELTA_DFBM_NQ620": {
32513273
"supported_form_factors": ["ARDUINO"],
32523274
"inherits": ["MCU_NRF52"],

0 commit comments

Comments
 (0)