Skip to content

Commit c721cae

Browse files
authored
machine: add Adafruit CLUE Alpha
1 parent 2138fd7 commit c721cae

File tree

4 files changed

+130
-1
lines changed

4 files changed

+130
-1
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ smoketest:
242242
@$(MD5SUM) test.hex
243243
$(TINYGO) build -size short -o test.hex -target=circuitplay-express examples/i2s
244244
@$(MD5SUM) test.hex
245+
$(TINYGO) build -size short -o test.hex -target=clue_alpha examples/blinky1
246+
@$(MD5SUM) test.hex
245247
$(TINYGO) build -size short -o test.gba -target=gameboy-advance examples/gba-display
246248
@$(MD5SUM) test.gba
247249
$(TINYGO) build -size short -o test.hex -target=itsybitsy-m4 examples/blinky1

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,11 @@ 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 27 microcontroller boards are currently supported:
46+
The following 28 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)
50+
* [Adafruit CLUE Alpha](https://www.adafruit.com/product/4500)
5051
* [Adafruit Feather M0](https://www.adafruit.com/product/2772)
5152
* [Adafruit Feather M4](https://www.adafruit.com/product/3857)
5253
* [Adafruit ItsyBitsy M0](https://www.adafruit.com/product/3727)

src/machine/board_clue_alpha.go

Lines changed: 117 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,117 @@
1+
// +build clue_alpha
2+
3+
package machine
4+
5+
const HasLowFrequencyCrystal = true
6+
7+
// GPIO Pins
8+
const (
9+
D0 = P0_04
10+
D1 = P0_05
11+
D2 = P0_03
12+
D3 = P0_28
13+
D4 = P0_02
14+
D5 = P1_02
15+
D6 = P1_09
16+
D7 = P0_07
17+
D8 = P1_07
18+
D9 = P0_27
19+
D10 = P0_30
20+
D11 = P1_10
21+
D12 = P0_31
22+
D13 = P0_08
23+
D14 = P0_06
24+
D15 = P0_26
25+
D16 = P0_29
26+
D17 = P1_01
27+
D18 = P0_16
28+
D19 = P0_25
29+
D20 = P0_24
30+
D21 = A0
31+
D22 = A1
32+
D23 = A2
33+
D24 = A3
34+
D25 = A4
35+
D26 = A5
36+
D27 = A6
37+
D28 = A7
38+
D29 = P0_14
39+
D30 = P0_15
40+
D31 = P0_12
41+
D32 = P0_13
42+
D33 = P1_03
43+
D34 = P1_05
44+
D35 = P0_00
45+
D36 = P0_01
46+
D37 = P0_19
47+
D38 = P0_20
48+
D39 = P0_17
49+
D40 = P0_22
50+
D41 = P0_23
51+
D42 = P0_21
52+
D43 = P0_10
53+
D44 = P0_09
54+
D45 = P1_06
55+
D46 = P1_00
56+
)
57+
58+
// Analog Pins
59+
const (
60+
A0 = D12
61+
A1 = D16
62+
A2 = D0
63+
A3 = D1
64+
A4 = D2
65+
A5 = D3
66+
A6 = D4
67+
A7 = D10
68+
)
69+
70+
const (
71+
LED = D17
72+
LED1 = LED
73+
LED2 = D43
74+
NEOPIXEL = D18
75+
76+
BUTTON_LEFT = D5
77+
BUTTON_RIGHT = D11
78+
79+
// 240x240 ST7789 display is connected to these pins (use RowOffset = 80)
80+
TFT_SCK = D29
81+
TFT_MOSI = D30
82+
TFT_CS = D31
83+
TFT_DC = D32
84+
TFT_RESET = D33
85+
TFT_LITE = D34
86+
87+
PDM_DAT = D35
88+
PDM_CLK = D36
89+
90+
QSPI_SCK = D37
91+
QSPI_CS = D38
92+
QSPI_DATA0 = D39
93+
QSPI_DATA1 = D40
94+
QSPI_DATA2 = D41
95+
QSPI_DATA3 = D42
96+
97+
SPEAKER = D46
98+
)
99+
100+
// UART0 pins (logical UART1)
101+
const (
102+
UART_RX_PIN = D0
103+
UART_TX_PIN = D1
104+
)
105+
106+
// I2C pins
107+
const (
108+
SDA_PIN = D20 // I2C0 external
109+
SCL_PIN = D19 // I2C0 external
110+
)
111+
112+
// SPI pins
113+
const (
114+
SPI0_SCK_PIN = D13 // SCK
115+
SPI0_MOSI_PIN = D15 // MOSI
116+
SPI0_MISO_PIN = D14 // MISO
117+
)

targets/clue_alpha.json

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

0 commit comments

Comments
 (0)