Skip to content

Commit 8915561

Browse files
mdahlstromsandeepmistry
authored andcommitted
Add nRF51 USB Dongle dev board (sandeepmistry#67)
* Added nRF51 Dongle * added travils build for nrf51 dongle * Added the chip configratiopn to the travis task for nrf51dongle * travis task update Adding a reference to which version of the board variant to build. * Reduced the PIN defintion for the NRF51 Dongle * Added S110 softdevice option to nRF51 Dongle * Added nRF51 Dongle link to README
1 parent c98a190 commit 8915561

File tree

6 files changed

+171
-0
lines changed

6 files changed

+171
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,4 @@ script:
3232
- buildExampleSketch sandeepmistry:nRF5:STCT_nRF52_minidev 01.Basics Blink
3333
- buildExampleSketch sandeepmistry:nRF5:PCA1000X:board_variant=pca10000 01.Basics Blink
3434
- buildExampleSketch sandeepmistry:nRF5:PCA1000X:board_variant=nrf6310 01.Basics Blink
35+
- buildExampleSketch sandeepmistry:nRF5:nRF51Dongle:version=1_1_0 01.Basics Blink

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ Does not require a custom bootloader on the device.
2424
* [OSHChip](http://www.oshchip.org/)
2525
* [RedBearLab BLE Nano](http://redbearlab.com/blenano/)
2626
* [RedBearLab nRF51822](http://redbearlab.com/redbearlab-nrf51822/)
27+
* [Nordic NRF51 Dongle](http://www.nordicsemi.com/eng/Products/nRF51-Dongle)
2728

2829
## Installing
2930

boards.txt

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,45 @@ BluzDK.menu.softdevice.s130.upload.maximum_size=151552
137137
BluzDK.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
138138
BluzDK.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxac.ld
139139

140+
nRF51Dongle.name= nRF51 Dongle (PCA10031)
141+
142+
nRF51Dongle.upload.tool=sandeepmistry:openocd
143+
nRF51Dongle.upload.interface=cmsisdap
144+
nRF51Dongle.upload.target=nrf51
145+
nRF51Dongle.upload.maximum_size=262144
146+
147+
nRF51Dongle.bootloader.tool=sandeepmistry:openocd
148+
149+
nRF51Dongle.build.mcu=cortex-m0
150+
nRF51Dongle.build.f_cpu=16000000
151+
nRF51Dongle.build.board=GENERIC
152+
nRF51Dongle.build.core=nRF5
153+
nRF51Dongle.build.variant=nRF51Dongle
154+
nRF51Dongle.build.variant_system_lib=
155+
nRF51Dongle.build.extra_flags=-DNRF51
156+
nRF51Dongle.build.float_flags=
157+
nRF51Dongle.build.ldscript=nrf51_{build.chip}.ld
158+
nRF51Dongle.build.lfclk_flags=-DUSE_LFXO
159+
160+
nRF51Dongle.menu.version.1_1_0=1.1.0
161+
nRF51Dongle.menu.version.1_1_0.build.chip=xxac
162+
163+
nRF51Dongle.menu.softdevice.none=None
164+
nRF51Dongle.menu.softdevice.none.softdevice=none
165+
166+
nRF51Dongle.menu.softdevice.s110=S110
167+
nRF51Dongle.menu.softdevice.s110.softdevice=s110
168+
nRF51Dongle.menu.softdevice.s110.softdeviceversion=8.0.0
169+
nRF51Dongle.menu.softdevice.s110.upload.maximum_size=151552
170+
nRF51Dongle.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
171+
nRF51Dongle.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_{build.chip}.ld
172+
173+
nRF51Dongle.menu.softdevice.s130=S130
174+
nRF51Dongle.menu.softdevice.s130.softdevice=s130
175+
nRF51Dongle.menu.softdevice.s130.softdeviceversion=2.0.1
176+
nRF51Dongle.menu.softdevice.s130.upload.maximum_size=151552
177+
nRF51Dongle.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
178+
nRF51Dongle.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
140179

141180
BLENano.name=RedBearLab BLE Nano
142181

variants/nRF51Dongle/pins_arduino.h

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/nRF51Dongle/variant.cpp

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
//LEDs
24+
21,
25+
22,
26+
23,
27+
//A0-6
28+
15,
29+
16,
30+
17,
31+
18,
32+
19,
33+
20,
34+
//Serial
35+
9,
36+
11
37+
};

variants/nRF51Dongle/variant.h

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
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_NRF51_DONGLE_
18+
#define _VARIANT_NRF51_DONGLE_
19+
20+
/** Master clock frequency */
21+
#define VARIANT_MCK (16000000ul)
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 (11u)
36+
#define NUM_DIGITAL_PINS (11u)
37+
#define NUM_ANALOG_INPUTS (6u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define PIN_LED1 (21)
42+
#define PIN_LED2 (22)
43+
#define PIN_LED3 (23)
44+
45+
#define LED_BUILTIN PIN_LED1
46+
47+
/*
48+
* Analog pins
49+
*/
50+
#define PIN_A0 (15)
51+
#define PIN_A1 (16)
52+
#define PIN_A2 (17)
53+
#define PIN_A3 (18)
54+
#define PIN_A4 (19)
55+
#define PIN_A5 (20)
56+
57+
static const uint8_t A0 = PIN_A0 ;
58+
static const uint8_t A1 = PIN_A1 ;
59+
static const uint8_t A2 = PIN_A2 ;
60+
static const uint8_t A3 = PIN_A3 ;
61+
static const uint8_t A4 = PIN_A4 ;
62+
static const uint8_t A5 = PIN_A5 ;
63+
#define ADC_RESOLUTION 10
64+
65+
/*
66+
* Serial interfaces
67+
*/
68+
// Serial
69+
#define PIN_SERIAL_RX (11)
70+
#define PIN_SERIAL_TX (9)
71+
72+
#ifdef __cplusplus
73+
}
74+
#endif
75+
76+
#endif

0 commit comments

Comments
 (0)