diff --git a/README.md b/README.md index 9ca86253..1a94facc 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/boards.txt b/boards.txt index a050d27e..30d65d9e 100644 --- a/boards.txt +++ b/boards.txt @@ -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 diff --git a/variants/AdafruitBleUartFriend/pins_arduino.h b/variants/AdafruitBleUartFriend/pins_arduino.h new file mode 100644 index 00000000..3ef4d4a9 --- /dev/null +++ b/variants/AdafruitBleUartFriend/pins_arduino.h @@ -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" diff --git a/variants/AdafruitBleUartFriend/variant.cpp b/variants/AdafruitBleUartFriend/variant.cpp new file mode 100644 index 00000000..49b54ba3 --- /dev/null +++ b/variants/AdafruitBleUartFriend/variant.cpp @@ -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, +}; diff --git a/variants/AdafruitBleUartFriend/variant.h b/variants/AdafruitBleUartFriend/variant.h new file mode 100644 index 00000000..1283f92b --- /dev/null +++ b/variants/AdafruitBleUartFriend/variant.h @@ -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