Skip to content

Commit 4943545

Browse files
committed
Add RedBearLab nRF51822 variant
1 parent ac708f9 commit 4943545

File tree

4 files changed

+215
-0
lines changed

4 files changed

+215
-0
lines changed

boards.txt

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,48 @@ BLENano.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
135135
BLENano.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
136136

137137

138+
RedBearLab_nRF51822.name=RedBearLab nRF51822
139+
140+
RedBearLab_nRF51822.upload.tool=sandeepmistry:openocd
141+
RedBearLab_nRF51822.upload.interface=cmsisdap
142+
RedBearLab_nRF51822.upload.target=nrf51
143+
RedBearLab_nRF51822.upload.maximum_size=262144
144+
145+
RedBearLab_nRF51822.bootloader.tool=sandeepmistry:openocd
146+
147+
RedBearLab_nRF51822.build.mcu=cortex-m0
148+
RedBearLab_nRF51822.build.f_cpu=16000000
149+
RedBearLab_nRF51822.build.board=REDBEARLAB_NRF51822
150+
RedBearLab_nRF51822.build.core=nRF5
151+
RedBearLab_nRF51822.build.variant=RedBearLab_nRF51822
152+
RedBearLab_nRF51822.build.variant_system_lib=
153+
RedBearLab_nRF51822.build.extra_flags=-DNRF51
154+
RedBearLab_nRF51822.build.float_flags=
155+
RedBearLab_nRF51822.build.ldscript=nrf51_{build.chip}.ld
156+
157+
RedBearLab_nRF51822.menu.version.1_0=1.0
158+
RedBearLab_nRF51822.menu.version.1_0.build.chip=xxaa
159+
RedBearLab_nRF51822.menu.version.1_5=1.5
160+
RedBearLab_nRF51822.menu.version.1_5.build.chip=xxac
161+
162+
RedBearLab_nRF51822.menu.softdevice.none=None
163+
RedBearLab_nRF51822.menu.softdevice.none.softdevice=none
164+
165+
RedBearLab_nRF51822.menu.softdevice.s110=S110
166+
RedBearLab_nRF51822.menu.softdevice.s110.softdevice=s110
167+
RedBearLab_nRF51822.menu.softdevice.s110.softdeviceversion=8.0.0
168+
RedBearLab_nRF51822.menu.softdevice.s110.upload.maximum_size=151552
169+
RedBearLab_nRF51822.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
170+
RedBearLab_nRF51822.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_{build.chip}.ld
171+
172+
RedBearLab_nRF51822.menu.softdevice.s130=S130
173+
RedBearLab_nRF51822.menu.softdevice.s130.softdevice=s130
174+
RedBearLab_nRF51822.menu.softdevice.s130.softdeviceversion=2.0.0
175+
RedBearLab_nRF51822.menu.softdevice.s130.upload.maximum_size=151552
176+
RedBearLab_nRF51822.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
177+
RedBearLab_nRF51822.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
178+
179+
138180
Generic_nRF51822.name=Generic nRF51822
139181

140182
Generic_nRF51822.upload.tool=sandeepmistry:openocd
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"
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
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+
// D0 - D7
24+
11,
25+
9,
26+
10,
27+
8,
28+
21,
29+
23,
30+
16,
31+
17,
32+
33+
// D8 - D13
34+
19,
35+
18,
36+
14,
37+
12,
38+
13,
39+
15,
40+
41+
// A0 - A5
42+
1,
43+
2,
44+
3,
45+
4,
46+
5,
47+
6,
48+
49+
// SDA, SCL
50+
29,
51+
28,
52+
53+
// MISO, SCK, MOSI
54+
22,
55+
25,
56+
30,
57+
58+
59+
// AREF
60+
0
61+
};
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
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 _REDBEARLAB_NRF51822_
18+
#define _REDBEARLAB_NRF51822_
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 (26u)
36+
#define NUM_DIGITAL_PINS (20u)
37+
#define NUM_ANALOG_INPUTS (6u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define PIN_LED (13)
42+
#define LED_BUILTIN PIN_LED
43+
44+
/*
45+
* Analog pins
46+
*/
47+
#define PIN_A0 (14)
48+
#define PIN_A1 (15)
49+
#define PIN_A2 (16)
50+
#define PIN_A3 (17)
51+
#define PIN_A4 (18)
52+
#define PIN_A5 (19)
53+
54+
static const uint8_t A0 = PIN_A0 ;
55+
static const uint8_t A1 = PIN_A1 ;
56+
static const uint8_t A2 = PIN_A2 ;
57+
static const uint8_t A3 = PIN_A3 ;
58+
static const uint8_t A4 = PIN_A4 ;
59+
static const uint8_t A5 = PIN_A5 ;
60+
#define ADC_RESOLUTION 10
61+
62+
/*
63+
* Serial interfaces
64+
*/
65+
// Serial
66+
#define PIN_SERIAL_RX (0)
67+
#define PIN_SERIAL_TX (1)
68+
69+
/*
70+
* SPI Interfaces
71+
*/
72+
#define SPI_INTERFACES_COUNT 1
73+
74+
#define PIN_SPI_MISO (22)
75+
#define PIN_SPI_MOSI (24)
76+
#define PIN_SPI_SCK (23)
77+
78+
static const uint8_t SS = 10 ;
79+
static const uint8_t MOSI = PIN_SPI_MOSI ;
80+
static const uint8_t MISO = PIN_SPI_MISO ;
81+
static const uint8_t SCK = PIN_SPI_SCK ;
82+
83+
/*
84+
* Wire Interfaces
85+
*/
86+
#define WIRE_INTERFACES_COUNT 1
87+
88+
#define PIN_WIRE_SDA (20u)
89+
#define PIN_WIRE_SCL (21u)
90+
91+
#ifdef __cplusplus
92+
}
93+
#endif
94+
95+
#endif

0 commit comments

Comments
 (0)