Skip to content

Commit c4cfc01

Browse files
committed
targets: add support for Pimoroni Tiny2350 board
Signed-off-by: deadprogram <[email protected]>
1 parent f64e70e commit c4cfc01

File tree

3 files changed

+91
-0
lines changed

3 files changed

+91
-0
lines changed

GNUmakefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -743,6 +743,8 @@ endif
743743
@$(MD5SUM) test.hex
744744
$(TINYGO) build -size short -o test.hex -target=pico2 examples/blinky1
745745
@$(MD5SUM) test.hex
746+
$(TINYGO) build -size short -o test.hex -target=tiny2350 examples/blinky1
747+
@$(MD5SUM) test.hex
746748
# test pwm
747749
$(TINYGO) build -size short -o test.hex -target=itsybitsy-m0 examples/pwm
748750
@$(MD5SUM) test.hex

src/machine/board_tiny2350.go

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
//go:build tiny2350
2+
3+
package machine
4+
5+
// GPIO pins
6+
const (
7+
GP0 Pin = GPIO0
8+
GP1 Pin = GPIO1
9+
GP2 Pin = GPIO2
10+
GP3 Pin = GPIO3
11+
GP4 Pin = GPIO4
12+
GP5 Pin = GPIO5
13+
GP6 Pin = GPIO6
14+
GP7 Pin = GPIO7
15+
GP12 Pin = GPIO12
16+
GP13 Pin = GPIO13
17+
GP18 Pin = GPIO18
18+
GP19 Pin = GPIO19
19+
GP20 Pin = GPIO20
20+
GP26 Pin = GPIO26
21+
GP27 Pin = GPIO27
22+
GP28 Pin = GPIO28
23+
GP29 Pin = GPIO29
24+
25+
// Onboard LED
26+
LED_RED Pin = GPIO18
27+
LED_GREEN Pin = GPIO19
28+
LED_BLUE Pin = GPIO20
29+
LED = LED_RED
30+
31+
// Onboard crystal oscillator frequency, in MHz.
32+
xoscFreq = 12 // MHz
33+
)
34+
35+
// I2C Default pins on Tiny2350.
36+
const (
37+
I2C0_SDA_PIN = GP12
38+
I2C0_SCL_PIN = GP13
39+
40+
I2C1_SDA_PIN = GP2
41+
I2C1_SCL_PIN = GP3
42+
)
43+
44+
// SPI default pins
45+
const (
46+
// Default Serial Clock Bus 0 for SPI communications
47+
SPI0_SCK_PIN = GPIO6
48+
// Default Serial Out Bus 0 for SPI communications
49+
SPI0_SDO_PIN = GPIO7 // Tx
50+
// Default Serial In Bus 0 for SPI communications
51+
SPI0_SDI_PIN = GPIO4 // Rx
52+
53+
// Default Serial Clock Bus 1 for SPI communications
54+
SPI1_SCK_PIN = GPIO26
55+
// Default Serial Out Bus 1 for SPI communications
56+
SPI1_SDO_PIN = GPIO27 // Tx
57+
// Default Serial In Bus 1 for SPI communications
58+
SPI1_SDI_PIN = GPIO28 // Rx
59+
)
60+
61+
// UART pins
62+
const (
63+
UART0_TX_PIN = GPIO0
64+
UART0_RX_PIN = GPIO1
65+
UART1_TX_PIN = GPIO4
66+
UART1_RX_PIN = GPIO5
67+
UART_TX_PIN = UART0_TX_PIN
68+
UART_RX_PIN = UART0_RX_PIN
69+
)
70+
71+
var DefaultUART = UART0
72+
73+
// USB identifiers
74+
const (
75+
usb_STRING_PRODUCT = "Tiny2350"
76+
usb_STRING_MANUFACTURER = "Pimoroni"
77+
)
78+
79+
var (
80+
usb_VID uint16 = 0x2E8A
81+
usb_PID uint16 = 0x000F
82+
)

targets/tiny2350.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"inherits": [
3+
"rp2350"
4+
],
5+
"build-tags": ["tiny2350"],
6+
"serial-port": ["2e8a:000f"]
7+
}

0 commit comments

Comments
 (0)