Skip to content

Commit bf534ec

Browse files
joaopedrovbssandeepmistry
authored andcommitted
Add NFR51 Smart Beacon Kit variant (sandeepmistry#115)
* Add NFR51 Smart Beacon Kit to Boards * Remove PCA20006 flag from Generic * Fix Flags and Board Variant * Fiz typos on Boards.txt * Fix Wire (I2C) Lib * Revert "Fiz typos on Boards.txt" This reverts commit 7320c2a. * Revert "Fix Wire (I2C) Lib" This reverts commit 911d76d. * Update Boards, Remove I2C changes made at this branch * Change Variant Pin Mapping and Menu Placement
1 parent 921f1f7 commit bf534ec

File tree

5 files changed

+217
-1
lines changed

5 files changed

+217
-1
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Does not require a custom bootloader on the device.
2323
* Nordic Semiconductor [nRF51822 Development Kit](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822-Development-Kit) + [nRF51422 Development Kit](https://www.nordicsemi.com/eng/Products/ANT/nRF51422-Development-Kit)
2424
* PCA10000
2525
* PCA10001, PCA10002, PCA10003, PCA10004 via nRF6310(nRFgo)
26+
* [Nordic Semiconductor NRF51 Smart Beacon Kit](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822-Bluetooth-Smart-Beacon-Kit)
2627
* [Nordic Semiconductor NRF51 Dongle](http://www.nordicsemi.com/eng/Products/nRF51-Dongle)
2728
* [OSHChip](http://www.oshchip.org/)
2829
* [RedBearLab BLE Nano](http://redbearlab.com/blenano/)

boards.txt

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,6 @@ Generic_nRF51822.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
258258
Generic_nRF51822.menu.lfclk.lfsynt=Synthesized
259259
Generic_nRF51822.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
260260

261-
262261
BBCmicrobit.name=BBC micro:bit
263262

264263
BBCmicrobit.vid.0=0x0d28
@@ -441,6 +440,42 @@ nRF51Dongle.menu.softdevice.s130.upload.maximum_size=151552
441440
nRF51Dongle.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
442441
nRF51Dongle.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
443442

443+
Beacon_PCA20006.name=Nordic Beacon Kit (PCA20006)
444+
445+
Beacon_PCA20006.upload.tool=sandeepmistry:openocd
446+
Beacon_PCA20006.upload.target=nrf51
447+
Beacon_PCA20006.upload.maximum_size=262144
448+
449+
Beacon_PCA20006.bootloader.tool=sandeepmistry:openocd
450+
451+
Beacon_PCA20006.build.mcu=cortex-m0
452+
Beacon_PCA20006.build.f_cpu=16000000
453+
Beacon_PCA20006.build.board=BOARD_PCA20006
454+
Beacon_PCA20006.build.core=nRF5
455+
Beacon_PCA20006.build.variant=PCA20006
456+
Beacon_PCA20006.build.variant_system_lib=
457+
Beacon_PCA20006.build.extra_flags=-DNRF51
458+
Beacon_PCA20006.build.float_flags=
459+
Beacon_PCA20006.build.ldscript=nrf51_xxaa.ld
460+
461+
Beacon_PCA20006.build.lfclk_flags=-DUSE_LFXO
462+
463+
Beacon_PCA20006.menu.softdevice.none=None
464+
Beacon_PCA20006.menu.softdevice.none.softdevice=none
465+
466+
Beacon_PCA20006.menu.softdevice.s110=S110
467+
Beacon_PCA20006.menu.softdevice.s110.softdevice=s110
468+
Beacon_PCA20006.menu.softdevice.s110.softdeviceversion=8.0.0
469+
Beacon_PCA20006.menu.softdevice.s110.upload.maximum_size=151552
470+
Beacon_PCA20006.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
471+
Beacon_PCA20006.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_xxaa.ld
472+
473+
Beacon_PCA20006.menu.softdevice.s130=S130
474+
Beacon_PCA20006.menu.softdevice.s130.softdevice=s130
475+
Beacon_PCA20006.menu.softdevice.s130.softdeviceversion=2.0.1
476+
Beacon_PCA20006.menu.softdevice.s130.upload.maximum_size=151552
477+
Beacon_PCA20006.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
478+
Beacon_PCA20006.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxaa.ld
444479

445480
TinyBLE.name= TinyBLE
446481

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
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+
0,
24+
1,
25+
2,
26+
3,
27+
(uint32_t)-1,
28+
5,
29+
(uint32_t)-1,
30+
(uint32_t)-1,
31+
8,
32+
9,
33+
(uint32_t)-1,
34+
11,
35+
12,
36+
(uint32_t)-1,
37+
(uint32_t)-1,
38+
15,
39+
16,
40+
(uint32_t)-1,
41+
18,
42+
(uint32_t)-1,
43+
20,
44+
21,
45+
(uint32_t)-1,
46+
(uint32_t)-1,
47+
24,
48+
(uint32_t)-1,
49+
(uint32_t)-1,
50+
(uint32_t)-1,
51+
(uint32_t)-1,
52+
(uint32_t)-1,
53+
(uint32_t)-1,
54+
(uint32_t)-1
55+
};

variants/PCA20006/variant.h

Lines changed: 108 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,108 @@
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_BOARD_PCA20006_
18+
#define _VARIANT_BOARD_PCA20006_
19+
20+
/** Master clock frequency */
21+
#define VARIANT_MCK (16000000ul)
22+
23+
24+
/*----------------------------------------------------------------------------
25+
* Headers
26+
*----------------------------------------------------------------------------*/
27+
28+
#include "WVariant.h"
29+
30+
#ifdef __cplusplus
31+
extern "C"
32+
{
33+
#endif // __cplusplus
34+
35+
// Number of pins defined in PinDescription array
36+
#define PINS_COUNT (32u)
37+
#define NUM_DIGITAL_PINS (32u)
38+
#define NUM_ANALOG_INPUTS (6u)
39+
#define NUM_ANALOG_OUTPUTS (0u)
40+
41+
// LEDs
42+
#define PIN_LED (15)
43+
#define PIN_LEDR (16)
44+
#define PIN_LEDG (12)
45+
#define PIN_LEDB (15)
46+
#define LED_BUILTIN PIN_LED
47+
48+
// Buttons
49+
#define PIN_BUTTON (08)
50+
#define PIN_SW1 (08)
51+
#define PIN_SW2 (18)
52+
53+
/*
54+
* Analog pins
55+
*/
56+
#define PIN_A0 (1)
57+
#define PIN_A1 (2)
58+
#define PIN_A2 (3)
59+
#define PIN_A3 (4)
60+
#define PIN_A4 (5)
61+
#define PIN_A5 (6)
62+
63+
static const uint8_t A0 = PIN_A0 ;
64+
static const uint8_t A1 = PIN_A1 ;
65+
static const uint8_t A2 = PIN_A2 ;
66+
static const uint8_t A3 = PIN_A3 ;
67+
static const uint8_t A4 = PIN_A4 ;
68+
static const uint8_t A5 = PIN_A5 ;
69+
70+
#define ADC_RESOLUTION 10
71+
72+
/*
73+
* Serial interfaces
74+
*/
75+
// Serial
76+
#define PIN_SERIAL_RX (11)
77+
#define PIN_SERIAL_TX (9)
78+
79+
/*
80+
* SPI Interfaces
81+
*/
82+
#define SPI_INTERFACES_COUNT 1
83+
84+
#define PIN_SPI_MISO (0)
85+
#define PIN_SPI_MOSI (1)
86+
#define PIN_SPI_SCK (2)
87+
88+
static const uint8_t SS = 3 ;
89+
static const uint8_t MOSI = PIN_SPI_MOSI ;
90+
static const uint8_t MISO = PIN_SPI_MISO ;
91+
static const uint8_t SCK = PIN_SPI_SCK ;
92+
93+
/*
94+
* Wire Interfaces
95+
*/
96+
#define WIRE_INTERFACES_COUNT 1
97+
98+
#define PIN_WIRE_SDA (21u)
99+
#define PIN_WIRE_SCL (24u)
100+
101+
static const uint8_t SDA = PIN_WIRE_SDA;
102+
static const uint8_t SCL = PIN_WIRE_SCL;
103+
104+
#ifdef __cplusplus
105+
}
106+
#endif
107+
108+
#endif

0 commit comments

Comments
 (0)