Skip to content

Adding ublox evk nina b1 target #3328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
#ifndef MBED_PINNAMES_H
#define MBED_PINNAMES_H

#include "cmsis.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
PIN_INPUT,
PIN_OUTPUT
} PinDirection;

#define PORT_SHIFT 3

typedef enum {
// nRF52 pin names
p0 = 0,
p1 = 1,
p2 = 2,
p3 = 3,
p4 = 4,
p5 = 5,
p6 = 6,
p7 = 7,
p8 = 8,
p9 = 9,
p10 = 10,
p11 = 11,
p12 = 12,
p13 = 13,
p14 = 14,
p15 = 15,
p16 = 16,
p17 = 17,
p18 = 18,
p19 = 19,
p20 = 20,
p21 = 21,
p22 = 22,
p23 = 23,
p24 = 24,
p25 = 25,
p26 = 26,
p27 = 27,
p28 = 28,
p29 = 29,
p30 = 30,
p31 = 31,
NC = (int)0xFFFFFFFF, // Not connected

//NINA-B1 module pin names
NINA_B1_GPIO_1 = p8,
NINA_B1_GPIO_2 = p11,
NINA_B1_GPIO_3 = p12,
NINA_B1_GPIO_4 = p13,
NINA_B1_GPIO_5 = p14,
NINA_B1_GPIO_7 = p16,
NINA_B1_GPIO_8 = p18,

NINA_B1_GPIO_16 = p28,
NINA_B1_GPIO_17 = p29,
NINA_B1_GPIO_18 = p30,

NINA_B1_GPIO_20 = p31,
NINA_B1_GPIO_21 = p7,
NINA_B1_GPIO_22 = p6,
NINA_B1_GPIO_23 = p5,
NINA_B1_GPIO_24 = p2,
NINA_B1_GPIO_25 = p3,
NINA_B1_GPIO_27 = p4,
NINA_B1_GPIO_28 = p9,
NINA_B1_GPIO_29 = p10,

// EVK-NINA-B1 board
LED1 = NINA_B1_GPIO_1, // Red
LED2 = NINA_B1_GPIO_7, // Green/SW1
LED3 = NINA_B1_GPIO_8, // Blue
LED4 = NC,
SW1 = NINA_B1_GPIO_7,
SW2 = NINA_B1_GPIO_18,
D0 = NINA_B1_GPIO_23,
D1 = NINA_B1_GPIO_22,
D2 = NINA_B1_GPIO_21,
D3 = NINA_B1_GPIO_20,
D4 = NINA_B1_GPIO_8,
D5 = NC, // SWDIO
D6 = NINA_B1_GPIO_28,
D7 = NINA_B1_GPIO_29,
D8 = NC, // SWDCLK
D9 = NINA_B1_GPIO_1,
D10 = NINA_B1_GPIO_2,
D11 = NINA_B1_GPIO_4,
D12 = NINA_B1_GPIO_3,
D13 = NINA_B1_GPIO_5,
D14 = NINA_B1_GPIO_24,
D15 = NINA_B1_GPIO_25,
A0 = NINA_B1_GPIO_25,
A1 = NINA_B1_GPIO_24,
A2 = NINA_B1_GPIO_27,
A3 = NINA_B1_GPIO_18,
A4 = NINA_B1_GPIO_17,
A5 = NINA_B1_GPIO_16,
// Nordic SDK pin names
RX_PIN_NUMBER = p5,
TX_PIN_NUMBER = p6,
CTS_PIN_NUMBER = p7,
RTS_PIN_NUMBER = p31,
I2C_SDA0 = p2,
I2C_SCL0 = p3,
// mBed interface pins
USBTX = TX_PIN_NUMBER,
USBRX = RX_PIN_NUMBER
} PinName;

typedef enum {
PullNone = 0,
PullDown = 1,
PullUp = 3,
PullDefault = PullUp
} PinMode;

#ifdef __cplusplus
}
#endif
#endif
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#include "objects.h"

#endif
8 changes: 8 additions & 0 deletions targets/targets.json
Original file line number Diff line number Diff line change
Expand Up @@ -2340,6 +2340,14 @@
"release_versions": ["2", "5"],
"device_name": "nRF52832_xxAA"
},
"UBLOX_EVK_NINA_B1": {
"supported_form_factors": ["ARDUINO"],
"inherits": ["MCU_NRF52"],
"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"],
"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"],
"release_versions": ["2", "5"],
"device_name": "nRF52832_xxAA"
},
"BLUEPILL_F103C8": {
"core": "Cortex-M3",
"default_toolchain": "GCC_ARM",
Expand Down