Commit 20cee83e authored by Sandeep Mistry's avatar Sandeep Mistry

Add initial OSHChip variant

Needs more testing
parent edc3e314
......@@ -9,7 +9,8 @@ Program [Nordic Semiconductor](https://www.nordicsemi.com) nR5 based boards with
* [Bluz DK](http://bluz.io)
* [RedBearLab BLE Nano](http://redbearlab.com/blenano/)
* [RedBearLab nRF51822](http://redbearlab.com/redbearlab-nrf51822/)
* [BBC micro:bit](https://www.microbit.co.uk)
* [BBC micro:bit](https://www.microbit.co.uk/)
* [OSHChip](http://www.oshchip.org/)
## Installing
......
......@@ -270,6 +270,7 @@ 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
Waveshare_BLE400.name=Waveshare BLE400
Waveshare_BLE400.upload.tool=sandeepmistry:openocd
......@@ -311,3 +312,39 @@ Waveshare_BLE400.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S
Waveshare_BLE400.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_{build.chip}.ld
OSHChip.name=OSHChip
OSHChip.upload.tool=sandeepmistry:openocd
OSHChip.upload.target=nrf51
OSHChip.upload.maximum_size=262144
OSHChip.bootloader.tool=sandeepmistry:openocd
OSHChip.build.mcu=cortex-m0
OSHChip.build.f_cpu=16000000
OSHChip.build.board=BLUZ_DK
OSHChip.build.core=nRF5
OSHChip.build.variant=OSHChip
OSHChip.build.variant_system_lib=
OSHChip.build.extra_flags=-DNRF51
OSHChip.build.float_flags=
OSHChip.build.ldscript=nrf51_xxac.ld
OSHChip.build.lfclk_flags=-DUSE_LFRC
OSHChip.menu.softdevice.none=None
OSHChip.menu.softdevice.none.softdevice=none
OSHChip.menu.softdevice.s110=S110
OSHChip.menu.softdevice.s110.softdevice=s110
OSHChip.menu.softdevice.s110.softdeviceversion=8.0.0
OSHChip.menu.softdevice.s110.upload.maximum_size=151552
OSHChip.menu.softdevice.s110.build.extra_flags=-DNRF51 -DS110 -DNRF51_S110
OSHChip.menu.softdevice.s110.build.ldscript=armgcc_s110_nrf51822_xxac.ld
OSHChip.menu.softdevice.s130=S130
OSHChip.menu.softdevice.s130.softdevice=s130
OSHChip.menu.softdevice.s130.softdeviceversion=2.0.0
OSHChip.menu.softdevice.s130.upload.maximum_size=151552
OSHChip.menu.softdevice.s130.build.extra_flags=-DNRF51 -DS130 -DNRF51_S130
OSHChip.menu.softdevice.s130.build.ldscript=armgcc_s130_nrf51822_xxac.ld
/*
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[] = {
20, // TX/D0
18, // RX/D1
16, // D2
15, // D3
12, // D4
11, // D5
9, // D6
24, // D7
21, // D8
0, // D9/AREF
26, // A0
27, // A1
2, // A2
1, // A3
8, // R
5, // G
3 // B
};
/*
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_OSHCHIP_
#define _VARIANT_OSHCHIP_
/** 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 (17u)
#define NUM_DIGITAL_PINS (14u)
#define NUM_ANALOG_INPUTS (6u)
#define NUM_ANALOG_OUTPUTS (0u)
// LEDs
#define PIN_LED (PIN_LEDR)
#define PIN_LEDR (14)
#define PIN_LEDG (15)
#define PIN_LEDB (16)
#define LED_BUILTIN PIN_LED
/*
* Analog pins
*/
#define PIN_A0 (10)
#define PIN_A1 (11)
#define PIN_A2 (12)
#define PIN_A3 (13)
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
/*
* Serial interfaces
*/
// Serial
#define PIN_SERIAL_RX (1)
#define PIN_SERIAL_TX (0)
/*
* SPI Interfaces
*/
#define SPI_INTERFACES_COUNT 0
/*
* Wire Interfaces
*/
#define WIRE_INTERFACES_COUNT 0
#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