initial support for pca10059
Using the official USB Vendor name even for other boards.
Этот коммит содержится в:
родитель
2aa2e750b9
коммит
f23ba3b023
6 изменённых файлов: 87 добавлений и 2 удалений
5
Makefile
5
Makefile
|
@ -267,6 +267,10 @@ smoketest:
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=pca10056 examples/blinky2
|
$(TINYGO) build -size short -o test.hex -target=pca10056 examples/blinky2
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
|
$(TINYGO) build -size short -o test.hex -target=pca10059 examples/blinky1
|
||||||
|
@$(MD5SUM) test.hex
|
||||||
|
$(TINYGO) build -size short -o test.hex -target=pca10059 examples/blinky2
|
||||||
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=itsybitsy-m0 examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=itsybitsy-m0 examples/blinky1
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
$(TINYGO) build -size short -o test.hex -target=feather-m0 examples/blinky1
|
$(TINYGO) build -size short -o test.hex -target=feather-m0 examples/blinky1
|
||||||
|
@ -396,6 +400,7 @@ endif
|
||||||
$(TINYGO) build -size short -o test.hex -target=pca10040 -opt=0 ./testdata/stdlib.go
|
$(TINYGO) build -size short -o test.hex -target=pca10040 -opt=0 ./testdata/stdlib.go
|
||||||
@$(MD5SUM) test.hex
|
@$(MD5SUM) test.hex
|
||||||
|
|
||||||
|
|
||||||
wasmtest:
|
wasmtest:
|
||||||
$(GO) test ./tests/wasm
|
$(GO) test ./tests/wasm
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ const (
|
||||||
// USB CDC identifiers
|
// USB CDC identifiers
|
||||||
const (
|
const (
|
||||||
usb_STRING_PRODUCT = "Makerdiary nRF52840 MDK USB Dongle"
|
usb_STRING_PRODUCT = "Makerdiary nRF52840 MDK USB Dongle"
|
||||||
usb_STRING_MANUFACTURER = "Makerdiary"
|
usb_STRING_MANUFACTURER = "Nordic Semiconductor ASA"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -39,7 +39,7 @@ const (
|
||||||
// USB CDC identifiers
|
// USB CDC identifiers
|
||||||
const (
|
const (
|
||||||
usb_STRING_PRODUCT = "Makerdiary nRF52840 MDK"
|
usb_STRING_PRODUCT = "Makerdiary nRF52840 MDK"
|
||||||
usb_STRING_MANUFACTURER = "Makerdiary"
|
usb_STRING_MANUFACTURER = "Nordic Semiconductor ASA"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
64
src/machine/board_pca10059.go
Обычный файл
64
src/machine/board_pca10059.go
Обычный файл
|
@ -0,0 +1,64 @@
|
||||||
|
// +build pca10059
|
||||||
|
|
||||||
|
package machine
|
||||||
|
|
||||||
|
// The PCA10040 has a low-frequency (32kHz) crystal oscillator on board.
|
||||||
|
const HasLowFrequencyCrystal = true
|
||||||
|
|
||||||
|
// LEDs on the PCA10059 (nRF52840 dongle)
|
||||||
|
const (
|
||||||
|
LED Pin = LED1
|
||||||
|
LED1 Pin = 6
|
||||||
|
LED2 Pin = 8
|
||||||
|
LED3 Pin = (1 << 5) | 9
|
||||||
|
LED4 Pin = 12
|
||||||
|
)
|
||||||
|
|
||||||
|
// Buttons on the PCA10059 (nRF52840 dongle)
|
||||||
|
const (
|
||||||
|
BUTTON Pin = BUTTON1
|
||||||
|
BUTTON1 Pin = (1 << 5) | 6
|
||||||
|
)
|
||||||
|
|
||||||
|
// ADC pins
|
||||||
|
const (
|
||||||
|
ADC1 Pin = 2
|
||||||
|
ADC2 Pin = 4
|
||||||
|
ADC3 Pin = 29
|
||||||
|
ADC4 Pin = 31
|
||||||
|
)
|
||||||
|
|
||||||
|
// UART pins
|
||||||
|
const (
|
||||||
|
UART_TX_PIN Pin = NoPin
|
||||||
|
UART_RX_PIN Pin = NoPin
|
||||||
|
)
|
||||||
|
|
||||||
|
// UART0 is the USB device
|
||||||
|
var (
|
||||||
|
UART0 = USB
|
||||||
|
)
|
||||||
|
|
||||||
|
// I2C pins (unused)
|
||||||
|
const (
|
||||||
|
SDA_PIN = NoPin
|
||||||
|
SCL_PIN = NoPin
|
||||||
|
)
|
||||||
|
|
||||||
|
// SPI pins (unused)
|
||||||
|
const (
|
||||||
|
SPI0_SCK_PIN = NoPin
|
||||||
|
SPI0_SDO_PIN = NoPin
|
||||||
|
SPI0_SDI_PIN = NoPin
|
||||||
|
)
|
||||||
|
|
||||||
|
// USB CDC identifiers
|
||||||
|
const (
|
||||||
|
usb_STRING_PRODUCT = "nRF52840 Dongle"
|
||||||
|
usb_STRING_MANUFACTURER = "Nordic Semiconductor ASA"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
usb_VID uint16 = 0x1915
|
||||||
|
usb_PID uint16 = 0xCAFE
|
||||||
|
)
|
6
targets/pca10059.json
Обычный файл
6
targets/pca10059.json
Обычный файл
|
@ -0,0 +1,6 @@
|
||||||
|
{
|
||||||
|
"inherits": ["nrf52840"],
|
||||||
|
"build-tags": ["pca10059"],
|
||||||
|
"linkerscript": "targets/pca10059.ld",
|
||||||
|
"flash-command": "nrfutil pkg generate --hw-version 52 --sd-req 0x0 --application {hex} --application-version 1 /tmp/tinygo_$$.zip && nrfutil dfu usb-serial -pkg /tmp/tinygo_$$.zip -p {port} -b 115200 && rm -f /tmp/tinygo_$$.zip"
|
||||||
|
}
|
10
targets/pca10059.ld
Обычный файл
10
targets/pca10059.ld
Обычный файл
|
@ -0,0 +1,10 @@
|
||||||
|
|
||||||
|
MEMORY
|
||||||
|
{
|
||||||
|
FLASH_TEXT (rw) : ORIGIN = 0x00001000, LENGTH = 0xDF000
|
||||||
|
RAM (xrw) : ORIGIN = 0x20000008, LENGTH = 0x3FFF8
|
||||||
|
}
|
||||||
|
|
||||||
|
_stack_size = 2K;
|
||||||
|
|
||||||
|
INCLUDE "targets/arm.ld"
|
Загрузка…
Создание таблицы
Сослаться в новой задаче