Skip to content

Commit 1d2bc0f

Browse files
davecheneydeadprogram
authored andcommitted
targets: add support for Pimoroni Tufty 2350 board
Add a tufty2350 target and board file for the Pimoroni Tufty 2350, an RP2350B board with a parallel ST7789 LCD and a CYW43439 wireless chip. The target inherits rp2350b and sets a 16 MB flash size, like the existing pga2350 and pico-plus2 targets. Pin names come from Pimoroni's published pins.csv for the board: https://github.com/pimoroni/tufty2350/blob/main/board/pins.csv
1 parent d88abc2 commit 1d2bc0f

3 files changed

Lines changed: 117 additions & 0 deletions

File tree

make/smoketest.mk

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,8 @@ smoketest-rp2xxx: | build/smoke
319319
@$(MD5SUM) $(SMOKE_OUT).hex
320320
$(TINYGO) build -size short -o $(SMOKE_OUT).hex -target=pico-plus2 examples/blinky1
321321
@$(MD5SUM) $(SMOKE_OUT).hex
322+
$(TINYGO) build -size short -o $(SMOKE_OUT).hex -target=tufty2350 examples/blinky1
323+
@$(MD5SUM) $(SMOKE_OUT).hex
322324
$(TINYGO) build -size short -o $(SMOKE_OUT).hex -target=metro-rp2350 examples/blinky1
323325
@$(MD5SUM) $(SMOKE_OUT).hex
324326
$(TINYGO) build -size short -o $(SMOKE_OUT).hex -target=waveshare-rp2040-tiny examples/echo

src/machine/board_tufty2350.go

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
//go:build tufty2350
2+
3+
// This contains the pin mappings for the Pimoroni Tufty 2350 board.
4+
//
5+
// For more information, see: https://shop.pimoroni.com/products/tufty-2350
6+
// Pinout source: https://github.com/pimoroni/tufty2350/blob/main/board/pins.csv
7+
package machine
8+
9+
// Case LEDs (4-zone mono illumination), named CL0..CL3 in the docs.
10+
const (
11+
CL0 Pin = GPIO0
12+
CL1 Pin = GPIO1
13+
CL2 Pin = GPIO2
14+
CL3 Pin = GPIO3
15+
16+
// Convention: first zone as default LED.
17+
LED = CL0
18+
)
19+
20+
const (
21+
BUTTON_DOWN Pin = GPIO6
22+
BUTTON_A Pin = GPIO7
23+
BUTTON_B Pin = GPIO9
24+
BUTTON_C Pin = GPIO10
25+
BUTTON_UP Pin = GPIO11
26+
BUTTON_HOME Pin = GPIO22
27+
BUTTON_RESET Pin = GPIO14
28+
BUTTON_INT Pin = GPIO15
29+
30+
VBUS_DETECT Pin = GPIO12
31+
RTC_ALARM Pin = GPIO13
32+
33+
LCD_BACKLIGHT Pin = GPIO26
34+
LCD_CS Pin = GPIO27
35+
LCD_DC Pin = GPIO28
36+
LCD_WR Pin = GPIO30
37+
LCD_RD Pin = GPIO31
38+
LCD_DB0 Pin = GPIO32
39+
LCD_DB1 Pin = GPIO33
40+
LCD_DB2 Pin = GPIO34
41+
LCD_DB3 Pin = GPIO35
42+
LCD_DB4 Pin = GPIO36
43+
LCD_DB5 Pin = GPIO37
44+
LCD_DB6 Pin = GPIO38
45+
LCD_DB7 Pin = GPIO39
46+
47+
VBAT_SENSE Pin = GPIO40
48+
POWER_EN Pin = GPIO41
49+
SENSE_1V1 Pin = GPIO42
50+
LIGHT_SENSE Pin = GPIO43
51+
)
52+
53+
// CYW43439 wireless chip control pins.
54+
const (
55+
WL_REG_ON Pin = GPIO23
56+
WL_DATA Pin = GPIO24
57+
WL_CLOCK Pin = GPIO29
58+
WL_CS Pin = GPIO25
59+
)
60+
61+
// I2C pins. I2C0 carries the onboard PCF85063 real time clock.
62+
const (
63+
I2C0_SDA_PIN Pin = GPIO4
64+
I2C0_SCL_PIN Pin = GPIO5
65+
66+
I2C1_SDA_PIN Pin = NoPin
67+
I2C1_SCL_PIN Pin = NoPin
68+
)
69+
70+
// SPI pins. No SPI peripheral is wired to a header on this board.
71+
const (
72+
SPI0_SCK_PIN Pin = NoPin
73+
SPI0_SDO_PIN Pin = NoPin
74+
SPI0_SDI_PIN Pin = NoPin
75+
76+
SPI1_SCK_PIN Pin = NoPin
77+
SPI1_SDO_PIN Pin = NoPin
78+
SPI1_SDI_PIN Pin = NoPin
79+
)
80+
81+
// Onboard crystal oscillator frequency, in MHz.
82+
const (
83+
xoscFreq = 12 // MHz
84+
)
85+
86+
// USB CDC identifiers
87+
const (
88+
usb_STRING_PRODUCT = "Tufty 2350"
89+
usb_STRING_MANUFACTURER = "Pimoroni"
90+
)
91+
92+
var (
93+
usb_VID uint16 = 0x2e8a
94+
usb_PID uint16 = 0x1101
95+
)
96+
97+
// UART pins.
98+
// Note: GPIO0/GPIO1 are also CL0/CL1 (case LEDs).
99+
// Do not use UART0 and the case LEDs at the same time.
100+
const (
101+
UART0_TX_PIN = GPIO0
102+
UART0_RX_PIN = GPIO1
103+
UART_TX_PIN = UART0_TX_PIN
104+
UART_RX_PIN = UART0_RX_PIN
105+
)
106+
107+
var DefaultUART = UART0

targets/tufty2350.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"inherits": ["rp2350b"],
3+
"build-tags": ["tufty2350", "cyw43439"],
4+
"default-stack-size": 8192,
5+
"ldflags": [
6+
"--defsym=__flash_size=16M"
7+
]
8+
}

0 commit comments

Comments
 (0)