pca10031: add support for PCA10031 nrf51 wireless dongle

Signed-off-by: Ron Evans <ron@hybridgroup.com>
Этот коммит содержится в:
Ron Evans 2018-11-20 13:24:43 +01:00 коммит произвёл Ayke van Laethem
родитель bf4a43ef04
коммит ce0ad1daa2
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: E97FF5335DFDFDED
4 изменённых файлов: 52 добавлений и 9 удалений

Просмотреть файл

@ -24,6 +24,6 @@ script:
- tinygo build -o test.nrf.elf -target=pca10040 examples/test
- tinygo build -o blinky1.nrf51.elf -target=microbit examples/echo
- tinygo build -o test.nrf.elf -target=nrf52840-mdk examples/blinky1
- tinygo build -o blinky1.nrf51d.elf -target=pca10031 examples/blinky1
- tinygo build -o blinky1.stm32.elf -target=bluepill examples/blinky1
- tinygo build -o blinky1.o -target=arduino examples/blinky1 # TODO: avr-as/avr-gcc doesn't work
- tinygo build -o blinky1.o -target=digispark examples/blinky1
- tinygo build -o blinky1.avr.o -target=arduino examples/blinky1 # TODO: avr-as/avr-gcc doesn't work

Просмотреть файл

@ -28,6 +28,10 @@ technology (LLVM) as the proprietary ARM compiler for code generation.
* `BBC micro:bit <https://microbit.org/>`_ (`nRF51822
<https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822>`_)
* `Nordic PCA10031
<https://www.nordicsemi.com/eng/Products/nRF51-Dongle>`_
(`nRF51422
<https://www.nordicsemi.com/eng/Products/ANT/nRF51422>`_)
* `Nordic PCA10040
<https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF52-DK>`_
(`nRF52832

32
src/machine/board_pca10031.go Обычный файл
Просмотреть файл

@ -0,0 +1,32 @@
// +build nrf51,pca10031
// pca10031 is a nrf51 based dongle, intended for use in wireless applications.
//
// https://infocenter.nordicsemi.com/pdf/nRF51_Dongle_UG_v1.0.pdf
package machine
// The pca10031 has a 32kHz crystal on board.
const HasLowFrequencyCrystal = true
// LED on the pca10031
const (
LED = LED_RED
LED1 = LED_RED
LED2 = LED_GREEN
LED3 = LED_BLUE
LED_RED = 21
LED_GREEN = 22
LED_BLUE = 23
)
// UART pins
const (
UART_TX_PIN = 9
UART_RX_PIN = 11
)
// I2C pins (disabled)
const (
SDA_PIN = 0xff
SCL_PIN = 0xff
)

7
targets/pca10031.json Обычный файл
Просмотреть файл

@ -0,0 +1,7 @@
{
"inherits": ["nrf51"],
"build-tags": ["pca10031"],
"flash": "nrfjprog -f nrf51 --sectorerase --program {hex} --reset",
"ocd-daemon": ["openocd", "-f", "interface/cmsis-dap.cfg", "-f", "target/nrf51.cfg"],
"gdb-initial-cmds": ["target remote :3333", "monitor halt", "load", "monitor reset", "c"]
}