Skip to content

Commit 20cee83

Browse files
committed
Add initial OSHChip variant
Needs more testing
1 parent edc3e31 commit 20cee83

File tree

5 files changed

+181
-1
lines changed

5 files changed

+181
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ Program [Nordic Semiconductor](https://www.nordicsemi.com) nR5 based boards with
99
* [Bluz DK](http://bluz.io)
1010
* [RedBearLab BLE Nano](http://redbearlab.com/blenano/)
1111
* [RedBearLab nRF51822](http://redbearlab.com/redbearlab-nrf51822/)
12-
* [BBC micro:bit](https://www.microbit.co.uk)
12+
* [BBC micro:bit](https://www.microbit.co.uk/)
13+
* [OSHChip](http://www.oshchip.org/)
1314

1415
## Installing
1516

boards.txt

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,7 @@ Generic_nRF51822.menu.lfclk.lfrc.build.lfclk_flags=-DUSE_LFRC
270270
Generic_nRF51822.menu.lfclk.lfsynt=Synthesized
271271
Generic_nRF51822.menu.lfclk.lfsynt.build.lfclk_flags=-DUSE_LFSYNT
272272

273+
273274
Waveshare_BLE400.name=Waveshare BLE400
274275

275276
Waveshare_BLE400.upload.tool=sandeepmistry:openocd
@@ -311,3 +312,39 @@ Waveshare_BLE400.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S
311312
Waveshare_BLE400.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
312313

313314

315+
OSHChip.name=OSHChip
316+
317+
OSHChip.upload.tool=sandeepmistry:openocd
318+
OSHChip.upload.target=nrf51
319+
OSHChip.upload.maximum_size=262144
320+
321+
OSHChip.bootloader.tool=sandeepmistry:openocd
322+
323+
OSHChip.build.mcu=cortex-m0
324+
OSHChip.build.f_cpu=16000000
325+
OSHChip.build.board=BLUZ_DK
326+
OSHChip.build.core=nRF5
327+
OSHChip.build.variant=OSHChip
328+
OSHChip.build.variant_system_lib=
329+
OSHChip.build.extra_flags=-DNRF51
330+
OSHChip.build.float_flags=
331+
OSHChip.build.ldscript=nrf51_xxac.ld
332+
333+
OSHChip.build.lfclk_flags=-DUSE_LFRC
334+
335+
OSHChip.menu.softdevice.none=None
336+
OSHChip.menu.softdevice.none.softdevice=none
337+
338+
OSHChip.menu.softdevice.s110=S110
339+
OSHChip.menu.softdevice.s110.softdevice=s110
340+
OSHChip.menu.softdevice.s110.softdeviceversion=8.0.0
341+
OSHChip.menu.softdevice.s110.upload.maximum_size=151552
342+
OSHChip.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
343+
OSHChip.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_xxac.ld
344+
345+
OSHChip.menu.softdevice.s130=S130
346+
OSHChip.menu.softdevice.s130.softdevice=s130
347+
OSHChip.menu.softdevice.s130.softdeviceversion=2.0.0
348+
OSHChip.menu.softdevice.s130.upload.maximum_size=151552
349+
OSHChip.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
350+
OSHChip.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxac.ld

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

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
20, // TX/D0
24+
18, // RX/D1
25+
16, // D2
26+
15, // D3
27+
12, // D4
28+
11, // D5
29+
9, // D6
30+
31+
24, // D7
32+
21, // D8
33+
0, // D9/AREF
34+
35+
26, // A0
36+
27, // A1
37+
2, // A2
38+
1, // A3
39+
40+
8, // R
41+
5, // G
42+
3 // B
43+
};

variants/OSHChip/variant.h

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
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_OSHCHIP_
18+
#define _VARIANT_OSHCHIP_
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 (17u)
36+
#define NUM_DIGITAL_PINS (14u)
37+
#define NUM_ANALOG_INPUTS (6u)
38+
#define NUM_ANALOG_OUTPUTS (0u)
39+
40+
// LEDs
41+
#define PIN_LED (PIN_LEDR)
42+
#define PIN_LEDR (14)
43+
#define PIN_LEDG (15)
44+
#define PIN_LEDB (16)
45+
#define LED_BUILTIN PIN_LED
46+
47+
/*
48+
* Analog pins
49+
*/
50+
#define PIN_A0 (10)
51+
#define PIN_A1 (11)
52+
#define PIN_A2 (12)
53+
#define PIN_A3 (13)
54+
55+
static const uint8_t A0 = PIN_A0 ;
56+
static const uint8_t A1 = PIN_A1 ;
57+
static const uint8_t A2 = PIN_A2 ;
58+
static const uint8_t A3 = PIN_A3 ;
59+
#define ADC_RESOLUTION 10
60+
61+
/*
62+
* Serial interfaces
63+
*/
64+
// Serial
65+
#define PIN_SERIAL_RX (1)
66+
#define PIN_SERIAL_TX (0)
67+
68+
/*
69+
* SPI Interfaces
70+
*/
71+
#define SPI_INTERFACES_COUNT 0
72+
73+
/*
74+
* Wire Interfaces
75+
*/
76+
#define WIRE_INTERFACES_COUNT 0
77+
78+
#ifdef __cplusplus
79+
}
80+
#endif
81+
82+
#endif

0 commit comments

Comments
 (0)