Skip to content

Commit 5103552

Browse files
urishsandeepmistry
authored andcommitted
Add initial ng-beacon variant (sandeepmistry#85)
1 parent c5bb63f commit 5103552

File tree

5 files changed

+177
-0
lines changed

5 files changed

+177
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ Does not require a custom bootloader on the device.
2626
* [RedBearLab BLE Nano](http://redbearlab.com/blenano/)
2727
* [RedBearLab nRF51822](http://redbearlab.com/redbearlab-nrf51822/)
2828
* [Waveshare BLE400](http://www.waveshare.com/wiki/BLE400)
29+
* [ng-beacon](https://github.com/urish/ng-beacon)
2930

3031
## Installing
3132

boards.txt

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,3 +524,39 @@ Waveshare_BLE400.menu.softdevice.s130.softdeviceversion=2.0.1
524524
Waveshare_BLE400.menu.softdevice.s130.upload.maximum_size=151552
525525
Waveshare_BLE400.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
526526
Waveshare_BLE400.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
527+
528+
ng_beacon.name=ng-beacon
529+
530+
ng_beacon.upload.tool=sandeepmistry:openocd
531+
ng_beacon.upload.target=nrf51
532+
ng_beacon.upload.maximum_size=262144
533+
534+
ng_beacon.bootloader.tool=sandeepmistry:openocd
535+
536+
ng_beacon.build.mcu=cortex-m0
537+
ng_beacon.build.f_cpu=16000000
538+
ng_beacon.build.board=NG_BEACON
539+
ng_beacon.build.core=nRF5
540+
ng_beacon.build.variant=ng-beacon
541+
ng_beacon.build.variant_system_lib=
542+
ng_beacon.build.extra_flags=-DNRF51
543+
ng_beacon.build.float_flags=
544+
ng_beacon.build.ldscript=nrf51_xxaa.ld
545+
ng_beacon.build.lfclk_flags=-DUSE_LFRC
546+
547+
ng_beacon.menu.softdevice.none=None
548+
ng_beacon.menu.softdevice.none.softdevice=none
549+
550+
ng_beacon.menu.softdevice.s110=S110
551+
ng_beacon.menu.softdevice.s110.softdevice=s110
552+
ng_beacon.menu.softdevice.s110.softdeviceversion=8.0.0
553+
ng_beacon.menu.softdevice.s110.upload.maximum_size=151552
554+
ng_beacon.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
555+
ng_beacon.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_xxaa.ld
556+
557+
ng_beacon.menu.softdevice.s130=S130
558+
ng_beacon.menu.softdevice.s130.softdevice=s130
559+
ng_beacon.menu.softdevice.s130.softdeviceversion=2.0.1
560+
ng_beacon.menu.softdevice.s130.upload.maximum_size=151552
561+
ng_beacon.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
562+
ng_beacon.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxaa.ld

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
const uint32_t g_ADigitalPinMap[] = {
23+
// D0 - D7
24+
8,
25+
9,
26+
12,
27+
17,
28+
19,
29+
25,
30+
28,
31+
29,
32+
33+
// A0 - A1
34+
26,
35+
27,
36+
};

variants/ng-beacon/variant.h

Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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_NG_BEACON_
18+
#define _VARIANT_NG_BEACON_
19+
20+
/** Master clock frequency */
21+
#define VARIANT_MCK (16000000ul)
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 (10u)
36+
#define NUM_DIGITAL_PINS (10u)
37+
#define NUM_ANALOG_INPUTS (2u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define PIN_LED (2)
42+
#define LED_BUILTIN PIN_LED
43+
44+
/*
45+
* Analog pins
46+
*/
47+
#define PIN_A0 (8)
48+
#define PIN_A1 (9)
49+
50+
static const uint8_t A0 = PIN_A0 ;
51+
static const uint8_t A1 = PIN_A1 ;
52+
#define ADC_RESOLUTION 10
53+
54+
/*
55+
* Serial interfaces
56+
*/
57+
// Serial
58+
#define PIN_SERIAL_RX (0)
59+
#define PIN_SERIAL_TX (1)
60+
61+
/*
62+
* SPI Interfaces
63+
*/
64+
#define SPI_INTERFACES_COUNT 1
65+
66+
#define PIN_SPI_MISO (5)
67+
#define PIN_SPI_MOSI (8)
68+
#define PIN_SPI_SCK (9)
69+
70+
static const uint8_t SS = 3 ;
71+
static const uint8_t MOSI = PIN_SPI_MOSI ;
72+
static const uint8_t MISO = PIN_SPI_MISO ;
73+
static const uint8_t SCK = PIN_SPI_SCK ;
74+
75+
/*
76+
* Wire Interfaces
77+
*/
78+
#define WIRE_INTERFACES_COUNT 1
79+
80+
#define PIN_WIRE_SDA (6u)
81+
#define PIN_WIRE_SCL (7u)
82+
83+
#ifdef __cplusplus
84+
}
85+
#endif
86+
87+
#endif

0 commit comments

Comments
 (0)