Skip to content
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

Adding MTB ublox NINA-B1 as a new target #5837

Merged
merged 2 commits into from Jan 30, 2018
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -0,0 +1,139 @@
#ifndef MBED_PINNAMES_H
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add license header file please here on the top?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170 .. Thanks. Done!

#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-B112 module pin names
P_1 = p8,
P_2 = p11,
P_3 = p12,
P_4 = p13,
P_5 = p14,
P_6 = NC,
P_7 = p16,
P_8 = p18,
P_9 = NC,
P_10 = NC,
P_11 = NC,
P_12 = NC,
P_13 = NC,
P_14 = NC,
P_15 = NC,
P_16 = p28,
P_17 = p29,
P_18 = p30,
P_19 = p21,
P_20 = p31,
P_21 = p7,
P_22 = p6,
P_23 = p5,
P_24 = p2,
P_25 = p3,
P_26 = NC,
P_27 = p4,
P_28 = p9,
P_29 = p10,
P_30 = NC,

// MTB aliases
GPIO18 = p30,

LED1 = p4, // Red LED
LED2 = p10, // Green LED
GPIO27 = LED1,
// GPIO29 = LED2,

GPIO7 = p16, //A0 for LCD
GPIO16 = p28, //RESET for LCD

SW1 = p29,
GPIO17 = SW1,
//Standardized button names
BUTTON1 = SW1,

// Nordic SDK pin names
RX_PIN_NUMBER = p5,
TX_PIN_NUMBER = p6,
CTS_PIN_NUMBER = p7,
RTS_PIN_NUMBER = p31,

I2C_SDA = p2,
I2C_SCL = p3,

SPI0_MOSI = p13,
SPI0_MISO = p12,
SPI0_SCK = p14,
SPI0_CS = p11,
SPI1_CS = p8,

SPI_MOSI = SPI0_MOSI,
SPI_MISO = SPI0_MISO,
SPI_SCK = SPI0_SCK,
SPI_CS = SPI0_CS,

// DAPLink
USBRX = RX_PIN_NUMBER,
USBTX = TX_PIN_NUMBER,
NTRST = p21,
SWO = p18,

} PinName;

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

#ifdef __cplusplus
}
#endif
#endif
@@ -0,0 +1,21 @@
/* mbed Microcontroller Library
* Copyright (c) 2006-2013 ARM Limited
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef MBED_DEVICE_H
#define MBED_DEVICE_H

#include "objects.h"

#endif
22 changes: 22 additions & 0 deletions targets/targets.json
Expand Up @@ -3247,6 +3247,28 @@
"release_versions": ["2", "5"],
"device_name": "nRF52832_xxAA"
},
"MTB_UBLOX_NINA_B1": {
"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_add": ["ANALOGIN", "I2C", "I2C_ASYNCH", "INTERRUPTIN", "LOWPOWERTIMER", "PORTIN", "PORTINOUT", "PORTOUT", "PWMOUT", "RTC", "SERIAL", "SERIAL_ASYNCH", "SERIAL_FC", "SLEEP", "SPI", "SPI_ASYNCH", "SPISLAVE"],
"extra_labels_add": ["MTB_UBLOX_NINA_B1"],
"release_versions": ["5"],
"device_name": "nRF52832_xxAA",
"bootloader_supported": true,
"overrides": {
"uart_hwfc": 0
},
"config": {
"usb_tx": {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was refactored, the names are now stdio_serial or similar, please update

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@0xc0170 Thanks for letting me know about this. But, that refactoring in #5938 is only for STM32F4xx based MCU's ? This NINA is based on nRF52.. I don't think this update is required here..?

"help": "Value p6",
"value": "p6"
},
"usb_rx": {
"help": "Value p5",
"value": "p5"
}
}
},
"DELTA_DFBM_NQ620": {
"supported_form_factors": ["ARDUINO"],
"inherits": ["MCU_NRF52"],
Expand Down