Skip to content

Commit e5453eb

Browse files
sago35deadprogram
authored andcommitted
machine/feather-nrf52840-sense: add board definition for Adafruit Feather nRF52840 Sense
1 parent 0e267dd commit e5453eb

File tree

4 files changed

+116
-1
lines changed

4 files changed

+116
-1
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,8 @@ smoketest:
336336
@$(MD5SUM) test.hex
337337
$(TINYGO) build -size short -o test.hex -target=feather-nrf52840 examples/blinky1
338338
@$(MD5SUM) test.hex
339+
$(TINYGO) build -size short -o test.hex -target=feather-nrf52840-sense examples/blinky1
340+
@$(MD5SUM) test.hex
339341
$(TINYGO) build -size short -o test.hex -target=itsybitsy-nrf52840 examples/blinky1
340342
@$(MD5SUM) test.hex
341343
$(TINYGO) build -size short -o test.hex -target=qtpy examples/serial

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ 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 67 microcontroller boards are currently supported:
46+
The following 68 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)
@@ -52,6 +52,7 @@ The following 67 microcontroller boards are currently supported:
5252
* [Adafruit Feather M4](https://www.adafruit.com/product/3857)
5353
* [Adafruit Feather M4 CAN](https://www.adafruit.com/product/4759)
5454
* [Adafruit Feather nRF52840 Express](https://www.adafruit.com/product/4062)
55+
* [Adafruit Feather nRF52840 Sense](https://www.adafruit.com/product/4516)
5556
* [Adafruit Feather RP2040](https://www.adafruit.com/product/4884)
5657
* [Adafruit Feather STM32F405 Express](https://www.adafruit.com/product/4382)
5758
* [Adafruit Grand Central M4](https://www.adafruit.com/product/4064)
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
// +build feather_nrf52840_sense
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_11
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 // LED1
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 = D13
59+
LED1 = LED
60+
LED2 = D4
61+
NEOPIXEL = D8
62+
WS2812 = D8
63+
BUTTON = D7
64+
65+
QSPI_SCK = D27
66+
QSPI_CS = D28
67+
QSPI_DATA0 = D29
68+
QSPI_DATA1 = D30
69+
QSPI_DATA2 = D31
70+
QSPI_DATA3 = D32
71+
)
72+
73+
// UART0 pins (logical UART1)
74+
const (
75+
UART_RX_PIN = D0
76+
UART_TX_PIN = D1
77+
)
78+
79+
// I2C pins
80+
const (
81+
SDA_PIN = D22 // I2C0 external
82+
SCL_PIN = D23 // I2C0 external
83+
)
84+
85+
// SPI pins
86+
const (
87+
SPI0_SCK_PIN = D26 // SCK
88+
SPI0_SDO_PIN = D25 // SDO
89+
SPI0_SDI_PIN = D24 // SDI
90+
)
91+
92+
// USB CDC identifiers
93+
const (
94+
usb_STRING_PRODUCT = "Feather nRF52840 Express"
95+
usb_STRING_MANUFACTURER = "Adafruit Industries LLC"
96+
)
97+
98+
var (
99+
usb_VID uint16 = 0x239A
100+
usb_PID uint16 = 0x8088
101+
)
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"inherits": ["nrf52840"],
3+
"build-tags": ["feather_nrf52840_sense","nrf52840_reset_uf2", "softdevice", "s140v6"],
4+
"serial": "usb",
5+
"flash-1200-bps-reset": "true",
6+
"flash-method": "msd",
7+
"msd-volume-name": "FTHR840BOOT",
8+
"msd-firmware-name": "firmware.uf2",
9+
"uf2-family-id": "0xADA52840",
10+
"linkerscript": "targets/circuitplay-bluefruit.ld"
11+
}

0 commit comments

Comments
 (0)