Unverified Commit 32ebbe0b authored by dlabun's avatar dlabun Committed by GitHub

Merge pull request #211 from ntavish/hackaBLE

add support for Electronut labs hackaBLE module
parents 0e28d67f c10b4d40
...@@ -34,3 +34,4 @@ script: ...@@ -34,3 +34,4 @@ script:
- buildExampleSketch sandeepmistry:nRF5:BLENano2 01.Basics Blink - buildExampleSketch sandeepmistry:nRF5:BLENano2 01.Basics Blink
- buildExampleSketch sandeepmistry:nRF5:TinyBLE 01.Basics Blink - buildExampleSketch sandeepmistry:nRF5:TinyBLE 01.Basics Blink
- buildExampleSketch sandeepmistry:nRF5:bluey 01.Basics Blink - buildExampleSketch sandeepmistry:nRF5:bluey 01.Basics Blink
- buildExampleSketch sandeepmistry:nRF5:hackaBLE 01.Basics Blink
...@@ -16,6 +16,7 @@ Does not require a custom bootloader on the device. ...@@ -16,6 +16,7 @@ Does not require a custom bootloader on the device.
* [RedBear Blend 2](https://github.com/redbear/nRF5x#blend-2) * [RedBear Blend 2](https://github.com/redbear/nRF5x#blend-2)
* [RedBear Nano 2](https://github.com/redbear/nRF5x#ble-nano-2) * [RedBear Nano 2](https://github.com/redbear/nRF5x#ble-nano-2)
* [Bluey](https://github.com/electronut/ElectronutLabs-bluey) * [Bluey](https://github.com/electronut/ElectronutLabs-bluey)
* [hackaBLE](https://github.com/electronut/ElectronutLabs-hackaBLE)
### nRF51 ### nRF51
* [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822) * [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822)
......
...@@ -100,6 +100,43 @@ bluey.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT ...@@ -100,6 +100,43 @@ bluey.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
hackaBLE.name=Electronut labs hackaBLE
hackaBLE.upload.tool=sandeepmistry:openocd
hackaBLE.upload.target=nrf52
hackaBLE.upload.maximum_size=524288
hackaBLE.bootloader.tool=sandeepmistry:openocd
hackaBLE.build.mcu=cortex-m4
hackaBLE.build.f_cpu=16000000
hackaBLE.build.board=ELECTRONUT_HACKABLE
hackaBLE.build.core=nRF5
hackaBLE.build.variant=hackaBLE
hackaBLE.build.variant_system_lib=
hackaBLE.build.extra_flags=-DNRF52
hackaBLE.build.float_flags=-mfloat-abi=hard -mfpu=fpv4-sp-d16
hackaBLE.build.ldscript=nrf52_xxaa.ld
hackaBLE.menu.softdevice.none=None
hackaBLE.menu.softdevice.none.softdevice=none
hackaBLE.menu.softdevice.none.softdeviceversion=
hackaBLE.menu.softdevice.s132=S132
hackaBLE.menu.softdevice.s132.softdevice=s132
hackaBLE.menu.softdevice.s132.softdeviceversion=2.0.1
hackaBLE.menu.softdevice.s132.upload.maximum_size=409600
hackaBLE.menu.softdevice.s132.build.extra_flags=-DNRF52 -DS132 -DNRF51_S132
hackaBLE.menu.softdevice.s132.build.ldscript=armgcc_s132_nrf52832_xxaa.ld
hackaBLE.menu.lfclk.lfxo=Crystal Oscillator
hackaBLE.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO
hackaBLE.menu.lfclk.lfrc=RC Oscillator
hackaBLE.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
hackaBLE.menu.lfclk.lfsynt=Synthesized
hackaBLE.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
Blend2.name=RedBear Blend 2 Blend2.name=RedBear Blend 2
Blend2.vid.0=0x0204 Blend2.vid.0=0x0204
......
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
// API compatibility
#include "variant.h"
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "variant.h"
/*
Top view
RX - D0 | P0.14 P0.27 | D7 - SDA
Tx - D1 | P0.13 P0.26 | D8 - SCL
D2 | P0.12 P0.25 | D9
SS - D3 | P0.11 AIN3/P0.05 | D10 - A3
MISO - D4 | P0.08 AIN2/P0.04 | D11 - A2
MOSI - D5 | P0.07 AIN1/P0.03 | D12 - A1
SCK - D6 | P0.06 AIN0/P0.02 | D13 - A0
| NFC2/P0.10 Vin |
| NFC1/P0.09 Gnd |
Bottom view (smt pads)
D19 | P0.24 P0.23 | D14
A4 - D20 | P0.28/AIN4 P0.22 | D15
A5 - D21 | P0.29/AIN5 P0.18 | D16
A6 - D22 | P0.30/AIN6 P0.16 | D17
A7 - D23 | P0.31/AIN7 P0.15 | D18
LEDs
Red - P0.19 | D24
Green - P0.19 | D25
Blue - P0.19 | D26 - LED_BUILTIN
*/
const uint32_t g_ADigitalPinMap[] = {
14,
13,
12,
11,
8,
7,
6,
27,
26,
25,
5,
4,
3,
2,
23,
22,
18,
16,
15,
24,
28,
29,
30,
31,
19,
20,
17,
};
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _VARIANT_ELECTRONUT_HACKABLE_
#define _VARIANT_ELECTRONUT_HACKABLE_
/** Master clock frequency */
#define VARIANT_MCK (64000000ul)
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "WVariant.h"
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
// Number of pins defined in PinDescription array
#define PINS_COUNT (27u)
#define NUM_DIGITAL_PINS (27u)
#define NUM_ANALOG_INPUTS (8u)
#define NUM_ANALOG_OUTPUTS (0u)
// LEDs
#define PIN_LEDR (24)
#define PIN_LEDG (25)
#define PIN_LEDB (26)
#define LED_BUILTIN PIN_LEDB
/*
* Analog pins
*/
#define PIN_A0 (13)
#define PIN_A1 (12)
#define PIN_A2 (11)
#define PIN_A3 (10)
#define PIN_A4 (20)
#define PIN_A5 (21)
#define PIN_A6 (22)
#define PIN_A7 (23)
static const uint8_t A0 = PIN_A0 ; // AIN0 / AREF / P0.02
static const uint8_t A1 = PIN_A1 ; // AIN1
static const uint8_t A2 = PIN_A2 ; // AIN2
static const uint8_t A3 = PIN_A3 ; // AIN3
static const uint8_t A4 = PIN_A4 ; // AIN4
static const uint8_t A5 = PIN_A5 ; // AIN5
static const uint8_t A6 = PIN_A6 ; // AIN6
static const uint8_t A7 = PIN_A7 ; // AIN7
#define ADC_RESOLUTION 10
// Other pins
#define PIN_AREF (PIN_A0)
static const uint8_t AREF = PIN_AREF;
/*
* Serial interfaces
*/
// Serial
#define PIN_SERIAL_RX (0)
#define PIN_SERIAL_TX (1)
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (4)
#define PIN_SPI_MOSI (3)
#define PIN_SPI_SCK (5)
#define PIN_SPI_SS (3)
static const uint8_t SS = PIN_SPI_SS ;
static const uint8_t MOSI = PIN_SPI_MOSI ;
static const uint8_t MISO = PIN_SPI_MISO ;
static const uint8_t SCK = PIN_SPI_SCK ;
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 1
#define PIN_WIRE_SDA (7)
#define PIN_WIRE_SCL (8)
#ifdef __cplusplus
}
#endif
/*----------------------------------------------------------------------------
* Arduino objects - C++ only
*----------------------------------------------------------------------------*/
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment