Skip to content

Commit 58c6d4d

Browse files
committed
Add RedBear BLE Nano 2 variant
1 parent 1bfe8ff commit 58c6d4d

File tree

6 files changed

+198
-0
lines changed

6 files changed

+198
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,3 +31,4 @@ script:
3131
- buildExampleSketch sandeepmistry:nRF5:PCA1000X:board_variant=nrf6310 01.Basics Blink
3232
- buildExampleSketch sandeepmistry:nRF5:nRF51Dongle:version=1_1_0 01.Basics Blink
3333
- buildExampleSketch sandeepmistry:nRF5:Blend2 01.Basics Blink
34+
- buildExampleSketch sandeepmistry:nRF5:BLENano2 01.Basics Blink

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Does not require a custom bootloader on the device.
1414
* For boards prior to ```2016.9``` (see sticker), the lastest JLink bootloader is required to upload sketches. To upgrade, press the boot/reset button while powering on the board and copy over the latest [bootloader](https://www.nordicsemi.com/eng/nordic/Products/nRF52-DK/nRF5x-OB-JLink-IF/52275).
1515
* [Shenzhen Taida Century Technology nRF52 low cost development board](https://www.aliexpress.com/item/NRF52832-high-cost-development-board-gold-core-board/32725601299.html)
1616
* [RedBear Blend 2](https://github.com/redbear/nRF5x#blend-2)
17+
* [RedBear Nano 2](https://github.com/redbear/nRF5x#ble-nano-2)
1718

1819
### nRF51
1920
* [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822)

boards.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,43 @@ Generic_nRF52832.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
5959
Generic_nRF52832.menu.lfclk.lfsynt=Synthesized
6060
Generic_nRF52832.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
6161

62+
BLENano2.name=RedBear BLE Nano 2
63+
64+
BLENano2.vid.0=0x0204
65+
BLENano2.pid.0=0x0d28
66+
67+
BLENano2.upload.tool=sandeepmistry:openocd
68+
BLENano2.upload.protocol=
69+
BLENano2.upload.interface=cmsis-dap
70+
BLENano2.upload.target=nrf52
71+
BLENano2.upload.maximum_size=524288
72+
BLENano2.upload.setup_command=transport select swd;
73+
BLENano2.upload.use_1200bps_touch=false
74+
BLENano2.upload.wait_for_upload_port=false
75+
BLENano2.upload.native_usb=false
76+
77+
BLENano2.bootloader.tool=sandeepmistry:openocd
78+
79+
BLENano2.build.mcu=cortex-m4
80+
BLENano2.build.f_cpu=16000000
81+
BLENano2.build.board=RB_BLE_NANO_2
82+
BLENano2.build.core=nRF5
83+
BLENano2.build.variant=RedBear_BLENano2
84+
BLENano2.build.variant_system_lib=
85+
BLENano2.build.extra_flags=-DNRF52
86+
BLENano2.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
87+
BLENano2.build.ldscript=nrf52_xxaa.ld
88+
89+
BLENano2.menu.softdevice.none=None
90+
BLENano2.menu.softdevice.none.softdevice=none
91+
92+
BLENano2.menu.softdevice.s132=S132
93+
BLENano2.menu.softdevice.s132.softdevice=s132
94+
BLENano2.menu.softdevice.s132.softdeviceversion=2.0.1
95+
BLENano2.menu.softdevice.s132.upload.maximum_size=409600
96+
BLENano2.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
97+
BLENano2.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
98+
6299

63100
nRF52DK.name=Nordic Semiconductor nRF52 DK
64101

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
This library is free software; you can redistribute it and/or
4+
modify it under the terms of the GNU Lesser General Public
5+
License as published by the Free Software Foundation; either
6+
version 2.1 of the License, or (at your option) any later version.
7+
This library is distributed in the hope that it will be useful,
8+
but WITHOUT ANY WARRANTY; without even the implied warranty of
9+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10+
See the GNU Lesser General Public License for more details.
11+
You should have received a copy of the GNU Lesser General Public
12+
License along with this library; if not, write to the Free Software
13+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
14+
*/
15+
16+
// API compatibility
17+
#include "variant.h"

variants/RedBear_BLENano2/variant.cpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
5+
This library is free software; you can redistribute it and/or
6+
modify it under the terms of the GNU Lesser General Public
7+
License as published by the Free Software Foundation; either
8+
version 2.1 of the License, or (at your option) any later version.
9+
10+
This library is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13+
See the GNU Lesser General Public License for more details.
14+
15+
You should have received a copy of the GNU Lesser General Public
16+
License along with this library; if not, write to the Free Software
17+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18+
*/
19+
20+
#include "variant.h"
21+
22+
const uint32_t g_ADigitalPinMap[] = {
23+
// A0/D0 - A5/D5
24+
30,
25+
29,
26+
28,
27+
2,
28+
5,
29+
4,
30+
31+
// D6 - D10
32+
3,
33+
6,
34+
7,
35+
8,
36+
21,
37+
38+
// D11 - D12
39+
(uint32_t)-1,
40+
(uint32_t)-1,
41+
42+
// D13
43+
11
44+
};

variants/RedBear_BLENano2/variant.h

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
/*
2+
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
3+
Copyright (c) 2016 Sandeep Mistry All right reserved.
4+
This library is free software; you can redistribute it and/or
5+
modify it under the terms of the GNU Lesser General Public
6+
License as published by the Free Software Foundation; either
7+
version 2.1 of the License, or (at your option) any later version.
8+
This library is distributed in the hope that it will be useful,
9+
but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
See the GNU Lesser General Public License for more details.
12+
You should have received a copy of the GNU Lesser General Public
13+
License along with this library; if not, write to the Free Software
14+
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
15+
*/
16+
17+
#ifndef _VARIANT_REDBEAR_BLE_NANO2_
18+
#define _VARIANT_REDBEAR_BLE_NANO2_
19+
20+
/** Master clock frequency */
21+
#define VARIANT_MCK (64000000ul)
22+
23+
/*----------------------------------------------------------------------------
24+
* Headers
25+
*----------------------------------------------------------------------------*/
26+
27+
#include "WVariant.h"
28+
29+
#ifdef __cplusplus
30+
extern "C"
31+
{
32+
#endif // __cplusplus
33+
34+
// Number of pins defined in PinDescription array
35+
#define PINS_COUNT (14u)
36+
#define NUM_DIGITAL_PINS (14u)
37+
#define NUM_ANALOG_INPUTS (6u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define LED_BUILTIN 13
42+
43+
/*
44+
* Analog pins
45+
*/
46+
#define PIN_A0 (0)
47+
#define PIN_A1 (1)
48+
#define PIN_A2 (2)
49+
#define PIN_A3 (3)
50+
#define PIN_A4 (4)
51+
#define PIN_A5 (5)
52+
53+
static const uint8_t A0 = PIN_A0 ;
54+
static const uint8_t A1 = PIN_A1 ;
55+
static const uint8_t A2 = PIN_A2 ;
56+
static const uint8_t A3 = PIN_A3 ;
57+
static const uint8_t A4 = PIN_A4 ;
58+
static const uint8_t A5 = PIN_A5 ;
59+
#define ADC_RESOLUTION 14
60+
61+
/*
62+
* Serial interfaces
63+
*/
64+
// Serial
65+
#define PIN_SERIAL_RX (0)
66+
#define PIN_SERIAL_TX (1)
67+
68+
/*
69+
* SPI Interfaces
70+
*/
71+
#define SPI_INTERFACES_COUNT 1
72+
73+
#define PIN_SPI_MISO (8)
74+
#define PIN_SPI_MOSI (7)
75+
#define PIN_SPI_SCK (9)
76+
77+
static const uint8_t SS = 6 ;
78+
static const uint8_t MOSI = PIN_SPI_MOSI ;
79+
static const uint8_t MISO = PIN_SPI_MISO ;
80+
static const uint8_t SCK = PIN_SPI_SCK ;
81+
82+
/*
83+
* Wire Interfaces
84+
*/
85+
#define WIRE_INTERFACES_COUNT 1
86+
87+
#define PIN_WIRE_SDA (2u)
88+
#define PIN_WIRE_SCL (3u)
89+
90+
#ifdef __cplusplus
91+
}
92+
#endif
93+
94+
/*----------------------------------------------------------------------------
95+
* Arduino objects - C++ only
96+
*----------------------------------------------------------------------------*/
97+
98+
#endif

0 commit comments

Comments
 (0)