Skip to content

Commit ad6adfd

Browse files
bgoulddeadprogram
authored andcommitted
Added board definition for Feather nRF52840 Express
1 parent 9815628 commit ad6adfd

File tree

3 files changed

+117
-1
lines changed

3 files changed

+117
-1
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ See the [getting started instructions](https://tinygo.org/getting-started/) for
4343

4444
You can compile TinyGo programs for microcontrollers, WebAssembly and Linux.
4545

46-
The following 37 microcontroller boards are currently supported:
46+
The following 38 microcontroller boards are currently supported:
4747

4848
* [Adafruit Circuit Playground Bluefruit](https://www.adafruit.com/product/4333)
4949
* [Adafruit Circuit Playground Express](https://www.adafruit.com/product/3333)
5050
* [Adafruit CLUE Alpha](https://www.adafruit.com/product/4500)
5151
* [Adafruit Feather M0](https://www.adafruit.com/product/2772)
5252
* [Adafruit Feather M4](https://www.adafruit.com/product/3857)
53+
* [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
5354
* [Adafruit ItsyBitsy M0](https://www.adafruit.com/product/3727)
5455
* [Adafruit ItsyBitsy M4](https://www.adafruit.com/product/3800)
5556
* [Adafruit Metro M4 Express Airlift](https://www.adafruit.com/product/4000)
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
// +build feather_nrf52840
2+
3+
package machine
4+
5+
const HasLowFrequencyCrystal = true
6+
7+
// GPIO Pins
8+
const (
9+
D0 = P0_25 // UART TX
10+
D1 = P0_24 // UART RX
11+
D2 = P0_10 // NFC2
12+
D3 = P1_15 // LED1
13+
D4 = P1_10 // LED2
14+
D5 = P1_08
15+
D6 = P0_07
16+
D7 = P1_02 // Button
17+
D8 = P0_16 // NeoPixel
18+
D9 = P0_26
19+
D10 = P0_27
20+
D11 = P0_06
21+
D12 = P0_08
22+
D13 = P1_09
23+
D14 = P0_04 // A0
24+
D15 = P0_05 // A1
25+
D16 = P0_30 // A2
26+
D17 = P0_28 // A3
27+
D18 = P0_02 // A4
28+
D19 = P0_03 // A5
29+
D20 = P0_29 // Battery
30+
D21 = P0_31 // AREF
31+
D22 = P0_12 // I2C SDA
32+
D23 = P0_11 // I2C SCL
33+
D24 = P0_15 // SPI MISO
34+
D25 = P0_13 // SPI MOSI
35+
D26 = P0_14 // SPI SCK
36+
D27 = P0_19 // QSPI CLK
37+
D28 = P0_20 // QSPI CS
38+
D29 = P0_17 // QSPI Data 0
39+
D30 = P0_22 // QSPI Data 1
40+
D31 = P0_23 // QSPI Data 2
41+
D32 = P0_21 // QSPI Data 3
42+
D33 = P0_09 // NFC1 (test point on bottom of board)
43+
)
44+
45+
// Analog Pins
46+
const (
47+
A0 = D14
48+
A1 = D15
49+
A2 = D16
50+
A3 = D17
51+
A4 = D18
52+
A5 = D19
53+
A6 = D20 // Battery
54+
A7 = D21 // ARef
55+
)
56+
57+
const (
58+
LED = D3
59+
LED1 = LED
60+
LED2 = D4
61+
NEOPIXEL = D8
62+
BUTTON = D7
63+
64+
QSPI_SCK = D27
65+
QSPI_CS = D28
66+
QSPI_DATA0 = D29
67+
QSPI_DATA1 = D30
68+
QSPI_DATA2 = D31
69+
QSPI_DATA3 = D32
70+
)
71+
72+
// UART0 pins (logical UART1)
73+
const (
74+
UART_RX_PIN = D0
75+
UART_TX_PIN = D1
76+
)
77+
78+
// UART0 is the USB device
79+
var (
80+
UART0 = USB
81+
)
82+
83+
// I2C pins
84+
const (
85+
SDA_PIN = D22 // I2C0 external
86+
SCL_PIN = D23 // I2C0 external
87+
)
88+
89+
// SPI pins
90+
const (
91+
SPI0_SCK_PIN = D26 // SCK
92+
SPI0_MOSI_PIN = D25 // MOSI
93+
SPI0_MISO_PIN = D24 // MISO
94+
)
95+
96+
// USB CDC identifiers
97+
const (
98+
usb_STRING_PRODUCT = "Adafruit Feather nRF52840 Express"
99+
usb_STRING_MANUFACTURER = "Adafruit"
100+
)
101+
102+
var (
103+
usb_VID uint16 = 0x239A
104+
usb_PID uint16 = 0x0029
105+
)

targets/feather-nrf52840.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"inherits": ["nrf52840"],
3+
"build-tags": ["feather_nrf52840","nrf52840_reset_uf2"],
4+
"flash-1200-bps-reset": "true",
5+
"flash-method": "msd",
6+
"msd-volume-name": "FTHR840BOOT",
7+
"msd-firmware-name": "firmware.uf2",
8+
"uf2-family-id": "0xADA52840",
9+
"linkerscript": "targets/circuitplay-bluefruit.ld"
10+
}

0 commit comments

Comments
 (0)