Skip to content

Commit 1ec43d4

Browse files
ntavishsandeepmistry
authored andcommitted
Add support for Electronut labs bluey board (sandeepmistry#175)
1 parent 6091ba3 commit 1ec43d4

File tree

6 files changed

+252
-0
lines changed

6 files changed

+252
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ script:
3333
- buildExampleSketch sandeepmistry:nRF5:Blend2 01.Basics Blink
3434
- buildExampleSketch sandeepmistry:nRF5:BLENano2 01.Basics Blink
3535
- buildExampleSketch sandeepmistry:nRF5:TinyBLE 01.Basics Blink
36+
- buildExampleSketch sandeepmistry:nRF5:bluey 01.Basics Blink

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Does not require a custom bootloader on the device.
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)
1717
* [RedBear Nano 2](https://github.com/redbear/nRF5x#ble-nano-2)
18+
* [Bluey](https://github.com/electronut/ElectronutLabs-bluey)
1819

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

boards.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,44 @@ Generic_nRF52832.menu.lfclk.lfsynt=Synthesized
6060
Generic_nRF52832.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
6161

6262

63+
64+
bluey.name=Electronut labs bluey
65+
66+
bluey.upload.tool=sandeepmistry:openocd
67+
bluey.upload.target=nrf52
68+
bluey.upload.maximum_size=524288
69+
70+
bluey.bootloader.tool=sandeepmistry:openocd
71+
72+
bluey.build.mcu=cortex-m4
73+
bluey.build.f_cpu=16000000
74+
bluey.build.board=ELECTRONUT_BLUEY
75+
bluey.build.core=nRF5
76+
bluey.build.variant=bluey
77+
bluey.build.variant_system_lib=
78+
bluey.build.extra_flags=-DNRF52
79+
bluey.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
80+
bluey.build.ldscript=nrf52_xxaa.ld
81+
82+
bluey.menu.softdevice.none=None
83+
bluey.menu.softdevice.none.softdevice=none
84+
85+
bluey.menu.softdevice.s132=S132
86+
bluey.menu.softdevice.s132.softdevice=s132
87+
bluey.menu.softdevice.s132.softdeviceversion=2.0.1
88+
bluey.menu.softdevice.s132.upload.maximum_size=409600
89+
bluey.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
90+
bluey.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
91+
92+
bluey.menu.lfclk.lfxo=Crystal Oscillator
93+
bluey.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO
94+
bluey.menu.lfclk.lfrc=RC Oscillator
95+
bluey.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
96+
bluey.menu.lfclk.lfsynt=Synthesized
97+
bluey.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
98+
99+
100+
63101
Blend2.name=RedBear Blend 2
64102

65103
Blend2.vid.0=0x0204

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

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
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+
/*
23+
24+
A0 P0.02/AIN0 | 1 2 | P0.26 D0
25+
A1 P0.03/AIN1 | 3 4 | P0.27 D1
26+
A2 P0.04/AIN2 | 5 6 | P0.24/AIN4 A3
27+
D2 P0.22 | 7 8 | P0.29/AIN5 A4
28+
D3 P0.23 | 9 10 | P0.30/AIN6 A5
29+
D4 P0.24 | 11 12 | P0.31/AIN7 A6
30+
D5 P0.25 | 13 14 | Ex_vin
31+
GND | 15 16 | 3v3
32+
GND | 17 18 | GND
33+
34+
35+
button D6 - P0.16
36+
R D7 - P0.19
37+
G D8 - P0.18
38+
B D9 - P0.17
39+
40+
D10 SCL - P0.11 DRDYn - P0.12 D11
41+
D12 SDA - P0.13 INT - P0.14 D13
42+
D14 INT1 - P0.15 INT2 - P0.20 D15
43+
44+
RXD - P0.08 TXD - P0.06
45+
RTS - P0.05 CTS - P0.07
46+
47+
SS - P0.22 SCK - P0.25
48+
MISO - P0.24 MOSI - P0.23
49+
*/
50+
51+
52+
const uint32_t g_ADigitalPinMap[] = {
53+
// D0 - D15
54+
26,
55+
27,
56+
22, // SS
57+
23, // MOSI
58+
24, // MISO
59+
25, // SCK
60+
16, // Button
61+
19, // R
62+
18, // G
63+
17, // B
64+
11, // SCL
65+
12, // DRDYn
66+
13, // SDA
67+
14, // INT
68+
15, // INT1
69+
20, // INT2
70+
71+
// A0 - A6
72+
2,
73+
3,
74+
4,
75+
24,
76+
29,
77+
30,
78+
31,
79+
80+
// RX, TX, RTS, CTS
81+
8,
82+
6,
83+
5,
84+
7,
85+
};

variants/bluey/variant.h

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
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_ELECTRONUT_BLUEY_
18+
#define _VARIANT_ELECTRONUT_BLUEY_
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 (27u)
36+
#define NUM_DIGITAL_PINS (27u)
37+
#define NUM_ANALOG_INPUTS (7u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define PIN_LEDR (7)
42+
#define PIN_LEDG (8)
43+
#define PIN_LEDB (9)
44+
#define LED_BUILTIN PIN_LEDR
45+
46+
// Buttons
47+
#define PIN_BUTTON (6)
48+
49+
/*
50+
* Analog pins
51+
*/
52+
#define PIN_A0 (16)
53+
#define PIN_A1 (17)
54+
#define PIN_A2 (18)
55+
#define PIN_A3 (19)
56+
#define PIN_A4 (20)
57+
#define PIN_A5 (21)
58+
#define PIN_A6 (22)
59+
60+
static const uint8_t A0 = PIN_A0 ; // AIN0 / AREF / P0.02
61+
static const uint8_t A1 = PIN_A1 ; // AIN1
62+
static const uint8_t A2 = PIN_A2 ; // AIN2
63+
static const uint8_t A3 = PIN_A3 ; // AIN4
64+
static const uint8_t A4 = PIN_A4 ; // AIN5
65+
static const uint8_t A5 = PIN_A5 ; // AIN6
66+
static const uint8_t A6 = PIN_A6 ; // AIN7
67+
#define ADC_RESOLUTION 10
68+
69+
// Other pins
70+
#define PIN_AREF (16)
71+
static const uint8_t AREF = PIN_AREF;
72+
73+
/*
74+
* Serial interfaces
75+
*/
76+
// Serial
77+
#define PIN_SERIAL_RX (23)
78+
#define PIN_SERIAL_TX (24)
79+
80+
/*
81+
* SPI Interfaces
82+
*/
83+
#define SPI_INTERFACES_COUNT 1
84+
85+
#define PIN_SPI_MISO (4)
86+
#define PIN_SPI_MOSI (3)
87+
#define PIN_SPI_SCK (5)
88+
89+
static const uint8_t SS = 2 ;
90+
static const uint8_t MOSI = PIN_SPI_MOSI ;
91+
static const uint8_t MISO = PIN_SPI_MISO ;
92+
static const uint8_t SCK = PIN_SPI_SCK ;
93+
94+
/*
95+
* Wire Interfaces
96+
*/
97+
#define WIRE_INTERFACES_COUNT 1
98+
99+
#define PIN_WIRE_SDA (12u)
100+
#define PIN_WIRE_SCL (10u)
101+
102+
#ifdef __cplusplus
103+
}
104+
#endif
105+
106+
/*----------------------------------------------------------------------------
107+
* Arduino objects - C++ only
108+
*----------------------------------------------------------------------------*/
109+
110+
#endif

0 commit comments

Comments
 (0)