Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add support for Adafruit BLE UART Friend #507

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ Become a sponsor and get your logo on our README on Github with a link to your s

### nRF51
* [Plain nRF51 MCU](https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822)
* [Adafruit BLE UART Friend](https://www.adafruit.com/product/2479)
* [BBC micro:bit](https://microbit.org)
* [Calliope mini](https://calliope.cc/en)
* [Bluz DK](http://bluz.io)
Expand Down
46 changes: 46 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,52 @@ Generic_nRF51822.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
Generic_nRF51822.menu.lfclk.lfsynt=Synthesized
Generic_nRF51822.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT


AdafruitBleUartFriend.name=Adafruit BLE UART Friend

AdafruitBleUartFriend.upload.tool=sandeepmistry:openocd
AdafruitBleUartFriend.upload.target=nrf51
AdafruitBleUartFriend.upload.maximum_size=262144

AdafruitBleUartFriend.bootloader.tool=sandeepmistry:openocd

AdafruitBleUartFriend.build.mcu=cortex-m0
AdafruitBleUartFriend.build.f_cpu=16000000
AdafruitBleUartFriend.build.board=ADAFRUIT_BLE_UART_FRIEND
AdafruitBleUartFriend.build.core=nRF5
AdafruitBleUartFriend.build.variant=AdafruitBleUartFriend
AdafruitBleUartFriend.build.variant_system_lib=
AdafruitBleUartFriend.build.extra_flags=-DNRF51
AdafruitBleUartFriend.build.float_flags=
AdafruitBleUartFriend.build.chip=xxac
AdafruitBleUartFriend.build.ldscript=nrf51_{build.chip}.ld

AdafruitBleUartFriend.menu.softdevice.none=None
AdafruitBleUartFriend.menu.softdevice.none.softdevice=none
AdafruitBleUartFriend.menu.softdevice.none.softdeviceversion=

AdafruitBleUartFriend.menu.softdevice.s110=S110
AdafruitBleUartFriend.menu.softdevice.s110.softdevice=s110
AdafruitBleUartFriend.menu.softdevice.s110.softdeviceversion=8.0.0
AdafruitBleUartFriend.menu.softdevice.s110.upload.maximum_size=151552
AdafruitBleUartFriend.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
AdafruitBleUartFriend.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_{build.chip}.ld

AdafruitBleUartFriend.menu.softdevice.s130=S130
AdafruitBleUartFriend.menu.softdevice.s130.softdevice=s130
AdafruitBleUartFriend.menu.softdevice.s130.softdeviceversion=2.0.1
AdafruitBleUartFriend.menu.softdevice.s130.upload.maximum_size=151552
AdafruitBleUartFriend.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
AdafruitBleUartFriend.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld

AdafruitBleUartFriend.menu.lfclk.lfxo=Crystal Oscillator
AdafruitBleUartFriend.menu.lfclk.lfxo.build.lfclk_flags=-DUSE_LFXO
AdafruitBleUartFriend.menu.lfclk.lfrc=RC Oscillator
AdafruitBleUartFriend.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
AdafruitBleUartFriend.menu.lfclk.lfsynt=Synthesized
AdafruitBleUartFriend.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT


BBCmicrobit.name=BBC micro:bit

BBCmicrobit.vid.0=0x0d28
Expand Down
17 changes: 17 additions & 0 deletions variants/AdafruitBleUartFriend/pins_arduino.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/*
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"
56 changes: 56 additions & 0 deletions variants/AdafruitBleUartFriend/variant.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2016 Frank Holtz. 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,
};
62 changes: 62 additions & 0 deletions variants/AdafruitBleUartFriend/variant.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
/*
Copyright (c) 2014-2015 Arduino LLC. All right reserved.
Copyright (c) 2016 Sandeep Mistry All right reserved.
Copyright (c) 2016 Frank Holtz. 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_ADAFRUIT_BLE_UART_FRIEND_
#define _VARIANT_ADAFRUIT_BLE_UART_FRIEND_

/** Master clock frequency */
#define VARIANT_MCK (16000000ul)

/*----------------------------------------------------------------------------
* Headers
*----------------------------------------------------------------------------*/

#include "WVariant.h"

#ifdef __cplusplus
extern "C"
{
#endif // __cplusplus

#define PINS_COUNT (32u)
#define NUM_DIGITAL_PINS (8u)
#define NUM_ANALOG_INPUTS (0u)
#define NUM_ANALOG_OUTPUTS (0u)

// LEDs
#define PIN_LED_CONNECTED (19)
#define PIN_LED_MODE (18)
#define LED_BUILTIN PIN_LED_MODE

// Other digital pins
#define PIN_DFU (7)
#define PIN_MODE (1)

/*
* Serial interfaces
*/
#define PIN_SERIAL_RX (11)
#define PIN_SERIAL_CTS (10)
#define PIN_SERIAL_TX (9)
#define PIN_SERIAL_RTS (8)

#ifdef __cplusplus
}
#endif

#endif