Commit 01339a12 authored by Jacob Rosenthal's avatar Jacob Rosenthal Committed by Sandeep Mistry

Add TinyBLE variant (#112)

* first pass at tinyble variant

* TinyBLE: fix name

* TinyBLE: board fixes

* TinyBLE: fix crystal

* TinyBLE: board fixes

* TinyBLE: fix pins

* TinyBLE: add to tests

* TinyBLE: fix default programmer

* TinyBLE: fix default programmer

* fix NUM_DIGITAL_PINS based on current understand of rules

* Add SDA and SCL pin constants to variant definitions
parent f124e5eb
......@@ -32,3 +32,4 @@ script:
- buildExampleSketch sandeepmistry:nRF5:nRF51Dongle:version=1_1_0 01.Basics Blink
- buildExampleSketch sandeepmistry:nRF5:Blend2 01.Basics Blink
- buildExampleSketch sandeepmistry:nRF5:BLENano2 01.Basics Blink
- buildExampleSketch sandeepmistry:nRF5:TinyBLE 01.Basics Blink
......@@ -29,6 +29,7 @@ Does not require a custom bootloader on the device.
* [RedBearLab nRF51822](http://redbearlab.com/redbearlab-nrf51822/)
* [Waveshare BLE400](http://www.waveshare.com/wiki/BLE400)
* [ng-beacon](https://github.com/urish/ng-beacon)
* [TinyBLE](https://www.seeedstudio.com/Seeed-Tiny-BLE-BLE-%2B-6DOF-Mbed-Platform-p-2268.html)
## Installing
......
......@@ -442,6 +442,47 @@ nRF51Dongle.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
nRF51Dongle.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
TinyBLE.name= TinyBLE
TinyBLE.upload.tool=sandeepmistry:openocd
TinyBLE.upload.protocol=cmsis-dap
TinyBLE.upload.target=nrf51
TinyBLE.upload.maximum_size=262144
TinyBLE.upload.setup_command=transport select swd;
TinyBLE.bootloader.tool=sandeepmistry:openocd
TinyBLE.build.mcu=cortex-m0
TinyBLE.build.f_cpu=16000000
TinyBLE.build.board=TINYBLE
TinyBLE.build.core=nRF5
TinyBLE.build.variant=TinyBLE
TinyBLE.build.variant_system_lib=
TinyBLE.build.extra_flags=-DNRF51
TinyBLE.build.float_flags=
TinyBLE.build.ldscript=nrf51_xxaa.ld
TinyBLE.build.lfclk_flags=-DUSE_LFXO
TinyBLE.menu.softdevice.none=None
TinyBLE.menu.softdevice.none.softdevice=none
TinyBLE.menu.softdevice.s110=S110
TinyBLE.menu.softdevice.s110.softdevice=s110
TinyBLE.menu.softdevice.s110.softdeviceversion=8.0.0
TinyBLE.menu.softdevice.s110.upload.maximum_size=151552
TinyBLE.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
TinyBLE.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_xxaa.ld
TinyBLE.menu.softdevice.s130=S130
TinyBLE.menu.softdevice.s130.softdevice=s130
TinyBLE.menu.softdevice.s130.softdeviceversion=2.0.1
TinyBLE.menu.softdevice.s130.upload.maximum_size=151552
TinyBLE.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
TinyBLE.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxaa.ld
OSHChip.name=OSHChip
OSHChip.upload.tool=sandeepmistry:openocd
......
/*
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"
const uint32_t g_ADigitalPinMap[] = {
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31
};
/*
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_TINYBLE_
#define _VARIANT_TINYBLE_
/** Master clock frequency */
#define VARIANT_MCK (16000000ul)
/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/
#include "WVariant.h"
#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus
// Number of pins defined in PinDescription array
#define PINS_COUNT (32u)
//3 LEDS, 1 Button, 4 exposed pins
#define NUM_DIGITAL_PINS (8u)
#define NUM_ANALOG_INPUTS (4u)
#define NUM_ANALOG_OUTPUTS (0u)
// LEDs
#define PIN_LED1 (21)
#define PIN_LED2 (22)
#define PIN_LED3 (23)
#define LED_BUILTIN PIN_LED1
// Buttons
#define PIN_BUTTON (17)
/*
* Analog pins
*/
#define PIN_A0 (3)
#define PIN_A1 (4)
#define PIN_A2 (5)
#define PIN_A3 (6)
static const uint8_t A0 = PIN_A0 ;
static const uint8_t A1 = PIN_A1 ;
static const uint8_t A2 = PIN_A2 ;
static const uint8_t A3 = PIN_A3 ;
#define ADC_RESOLUTION 10
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 1
#define PIN_SPI_MISO (3)
#define PIN_SPI_MOSI (4)
#define PIN_SPI_SCK (5)
static const uint8_t SS = 6 ;
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
//MPU6050_INT_PIN (20)
#define PIN_WIRE_SDA (12)
#define PIN_WIRE_SCL (13)
static const uint8_t SDA = PIN_WIRE_SDA;
static const uint8_t SCL = PIN_WIRE_SCL;
/*
* Serial interfaces
*/
// Serial
#define PIN_SERIAL_RX (11)
#define PIN_SERIAL_TX (9)
#ifdef __cplusplus
}
#endif
#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