Skip to content

Commit dd9a92d

Browse files
authored
Merge pull request #334 from Pathak94/hackaBLE_v2-variant
add hackaBLE_v2
2 parents a3ac43f + 2ad8006 commit dd9a92d

File tree

6 files changed

+226
-0
lines changed

6 files changed

+226
-0
lines changed

.travis.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ script:
3737
- buildExampleSketch sandeepmistry:nRF5:TinyBLE 01.Basics Blink
3838
- buildExampleSketch sandeepmistry:nRF5:bluey 01.Basics Blink
3939
- buildExampleSketch sandeepmistry:nRF5:hackaBLE 01.Basics Blink
40+
- buildExampleSketch sandeepmistry:nRF5:hackaBLE_v2 01.Basics Blink
4041
- buildExampleSketch sandeepmistry:nRF5:Sinobit 01.Basics BareMinimum
4142
- buildExampleSketch sandeepmistry:nRF5:DWM1001-DEV 01.Basics Blink
4243
- buildExampleSketch sandeepmistry:nRF5:SeeedArchLink 01.Basics Blink

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s
9090
* [RedBear Nano 2](https://github.com/redbear/nRF5x#ble-nano-2)
9191
* [Bluey](https://github.com/electronut/ElectronutLabs-bluey)
9292
* [hackaBLE](https://github.com/electronut/ElectronutLabs-hackaBLE)
93+
* [hackaBLE_v2](https://github.com/electronut/ElectronutLabs-hackaBLE)
9394
* [DWM1001-DEV](https://www.decawave.com/product/dwm1001-development-board/)
9495

9596
### nRF51

boards.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,42 @@ hackaBLE.menu.lfclk.lfsynt=Synthesized
137137
hackaBLE.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
138138

139139

140+
hackaBLE_v2.name=Electronut labs hackaBLE_v2
141+
142+
hackaBLE_v2.upload.tool=sandeepmistry:openocd
143+
hackaBLE_v2.upload.target=nrf52
144+
hackaBLE_v2.upload.maximum_size=524288
145+
146+
hackaBLE_v2.bootloader.tool=sandeepmistry:openocd
147+
148+
hackaBLE_v2.build.mcu=cortex-m4
149+
hackaBLE_v2.build.f_cpu=16000000
150+
hackaBLE_v2.build.board=ELECTRONUT_hackaBLE_v2
151+
hackaBLE_v2.build.core=nRF5
152+
hackaBLE_v2.build.variant=hackaBLE_v2
153+
hackaBLE_v2.build.variant_system_lib=
154+
hackaBLE_v2.build.extra_flags=-DNRF52
155+
hackaBLE_v2.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
156+
hackaBLE_v2.build.ldscript=nrf52_xxaa.ld
157+
158+
hackaBLE_v2.menu.softdevice.none=None
159+
hackaBLE_v2.menu.softdevice.none.softdevice=none
160+
hackaBLE_v2.menu.softdevice.none.softdeviceversion=
161+
162+
hackaBLE_v2.menu.softdevice.s132=S132
163+
hackaBLE_v2.menu.softdevice.s132.softdevice=s132
164+
hackaBLE_v2.menu.softdevice.s132.softdeviceversion=2.0.1
165+
hackaBLE_v2.menu.softdevice.s132.upload.maximum_size=409600
166+
hackaBLE_v2.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
167+
hackaBLE_v2.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
168+
169+
hackaBLE_v2.menu.lfclk.lfxo=Crystal Oscillator
170+
hackaBLE_v2.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO
171+
hackaBLE_v2.menu.lfclk.lfrc=RC Oscillator
172+
hackaBLE_v2.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
173+
hackaBLE_v2.menu.lfclk.lfsynt=Synthesized
174+
hackaBLE_v2.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
175+
140176
Blend2.name=RedBear Blend 2
141177

142178
Blend2.vid.0=0x0204

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

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
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+
const uint32_t g_ADigitalPinMap[] = {
24+
0,
25+
1,
26+
2,
27+
3,
28+
4,
29+
5,
30+
6,
31+
7,
32+
8,
33+
9,
34+
10,
35+
11,
36+
12,
37+
13,
38+
14,
39+
15,
40+
16,
41+
17,
42+
18,
43+
19,
44+
20,
45+
21,
46+
22,
47+
23,
48+
24,
49+
25,
50+
26,
51+
27,
52+
28,
53+
29,
54+
30,
55+
31
56+
};

variants/hackaBLE_v2/variant.h

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
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_HACKABLE_V2_
18+
#define _VARIANT_ELECTRONUT_HACKABLE_V2_
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 (32u)
36+
#define NUM_DIGITAL_PINS (32u)
37+
#define NUM_ANALOG_INPUTS (8u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define PIN_LEDR (19)
42+
#define PIN_LEDG (20)
43+
#define PIN_LEDB (17)
44+
#define LED_BUILTIN PIN_LEDB
45+
46+
/*
47+
* Analog pins
48+
*/
49+
#define PIN_A0 (2)
50+
#define PIN_A1 (3)
51+
#define PIN_A2 (4)
52+
#define PIN_A3 (5)
53+
#define PIN_A4 (28)
54+
#define PIN_A5 (29)
55+
#define PIN_A6 (30)
56+
#define PIN_A7 (31)
57+
58+
static const uint8_t A0 = PIN_A0 ; // AIN0 / AREF / P0.02
59+
static const uint8_t A1 = PIN_A1 ; // AIN1
60+
static const uint8_t A2 = PIN_A2 ; // AIN2
61+
static const uint8_t A3 = PIN_A3 ; // AIN3
62+
static const uint8_t A4 = PIN_A4 ; // AIN4
63+
static const uint8_t A5 = PIN_A5 ; // AIN5
64+
static const uint8_t A6 = PIN_A6 ; // AIN6
65+
static const uint8_t A7 = PIN_A7 ; // AIN7
66+
#define ADC_RESOLUTION 10
67+
68+
// Other pins
69+
#define PIN_AREF (PIN_A0)
70+
static const uint8_t AREF = PIN_AREF;
71+
72+
/*
73+
* Serial interfaces
74+
*/
75+
// Serial
76+
#define PIN_SERIAL_RX (7)
77+
#define PIN_SERIAL_TX (8)
78+
79+
/*
80+
* SPI Interfaces
81+
*/
82+
#define SPI_INTERFACES_COUNT 1
83+
84+
#define PIN_SPI_MISO (11)
85+
#define PIN_SPI_MOSI (12)
86+
#define PIN_SPI_SCK (13)
87+
#define PIN_SPI_SS (14)
88+
89+
static const uint8_t SS = PIN_SPI_SS ;
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 (2)
100+
#define PIN_WIRE_SCL (3)
101+
102+
/*
103+
* Reset Button at P0.21
104+
*/
105+
#define RESET_PIN 21
106+
107+
#ifdef __cplusplus
108+
}
109+
#endif
110+
111+
/*----------------------------------------------------------------------------
112+
* Arduino objects - C++ only
113+
*----------------------------------------------------------------------------*/
114+
115+
#endif

0 commit comments

Comments
 (0)