File tree Expand file tree Collapse file tree 3 files changed +136
-0
lines changed Expand file tree Collapse file tree 3 files changed +136
-0
lines changed Original file line number Diff line number Diff line change @@ -745,6 +745,8 @@ endif
745745 @$(MD5SUM) test.hex
746746 $(TINYGO) build -size short -o test.hex -target=tiny2350 examples/blinky1
747747 @$(MD5SUM) test.hex
748+ $(TINYGO) build -size short -o test.hex -target=waveshare-rp2040-tiny examples/echo
749+ @$(MD5SUM) test.hex
748750 # test pwm
749751 $(TINYGO) build -size short -o test.hex -target=itsybitsy-m0 examples/pwm
750752 @$(MD5SUM) test.hex
Original file line number Diff line number Diff line change 1+ //go:build waveshare_rp2040_tiny
2+
3+ // This file contains the pin mappings for the Waveshare RP2040-Tiny boards.
4+ //
5+ // Waveshare RP2040-Tiny is a microcontroller using the Raspberry Pi RP2040 chip.
6+ //
7+ // - https://www.waveshare.com/wiki/RP2040-Tiny
8+ package machine
9+
10+ // Digital Pins
11+ const (
12+ GP0 Pin = GPIO0
13+ GP1 Pin = GPIO1
14+ GP2 Pin = GPIO2
15+ GP3 Pin = GPIO3
16+ GP4 Pin = GPIO4
17+ GP5 Pin = GPIO5
18+ GP6 Pin = GPIO6
19+ GP7 Pin = GPIO7
20+ GP8 Pin = GPIO8
21+ GP9 Pin = GPIO9
22+ GP10 Pin = GPIO10
23+ GP11 Pin = GPIO11
24+ GP12 Pin = GPIO12
25+ GP13 Pin = GPIO13
26+ GP14 Pin = GPIO14
27+ GP15 Pin = GPIO15
28+ GP16 Pin = GPIO16
29+ GP17 Pin = NoPin
30+ GP18 Pin = NoPin
31+ GP19 Pin = NoPin
32+ GP20 Pin = NoPin
33+ GP21 Pin = NoPin
34+ GP22 Pin = NoPin
35+ GP23 Pin = NoPin
36+ GP24 Pin = GPIO24
37+ GP25 Pin = GPIO25
38+ GP26 Pin = GPIO26
39+ GP27 Pin = GPIO27
40+ GP28 Pin = GPIO28
41+ GP29 Pin = GPIO29
42+ )
43+
44+ // Analog pins
45+ const (
46+ A0 Pin = GP26
47+ A1 Pin = GP27
48+ A2 Pin = GP28
49+ A3 Pin = GP29
50+ )
51+
52+ // Onboard LEDs
53+ const (
54+ LED = GP16
55+ WS2812 = GP16
56+ )
57+
58+ // I2C pins
59+ const (
60+ I2C0_SDA_PIN Pin = GP0
61+ I2C0_SCL_PIN Pin = GP1
62+ I2C1_SDA_PIN Pin = GP2
63+ I2C1_SCL_PIN Pin = GP3
64+
65+ // default I2C0
66+ I2C_SDA_PIN Pin = I2C0_SDA_PIN
67+ I2C_SCL_PIN Pin = I2C0_SCL_PIN
68+ )
69+
70+ // SPI pins
71+ const (
72+ SPI0_RX_PIN Pin = GP0
73+ SPI0_CSN_PIN Pin = GP1
74+ SPI0_SCK_PIN Pin = GP2
75+ SPI0_TX_PIN Pin = GP3
76+ SPI0_SDO_PIN Pin = SPI0_TX_PIN
77+ SPI0_SDI_PIN Pin = SPI0_RX_PIN
78+
79+ SPI1_RX_PIN Pin = GP8
80+ SPI1_CSN_PIN Pin = GP9
81+ SPI1_SCK_PIN Pin = GP10
82+ SPI1_TX_PIN Pin = GP11
83+ SPI1_SDO_PIN Pin = SPI1_TX_PIN
84+ SPI1_SDI_PIN Pin = SPI1_RX_PIN
85+
86+ // default SPI0
87+ SPI_RX_PIN Pin = SPI0_RX_PIN
88+ SPI_CSN_PIN Pin = SPI0_CSN_PIN
89+ SPI_SCK_PIN Pin = SPI0_SCK_PIN
90+ SPI_TX_PIN Pin = SPI0_TX_PIN
91+ SPI_SDO_PIN Pin = SPI0_TX_PIN
92+ SPI_SDI_PIN Pin = SPI0_RX_PIN
93+ )
94+
95+ // Onboard crystal oscillator frequency, in MHz.
96+ const (
97+ xoscFreq = 12 // MHz
98+ )
99+
100+ // UART pins
101+ const (
102+ UART0_TX_PIN = GP0
103+ UART0_RX_PIN = GP1
104+ UART1_TX_PIN = GP8
105+ UART1_RX_PIN = GP9
106+
107+ // default UART0
108+ UART_TX_PIN = UART0_TX_PIN
109+ UART_RX_PIN = UART0_RX_PIN
110+ )
111+
112+ // USB CDC identifiers
113+ const (
114+ usb_STRING_PRODUCT = "RP2040-Tiny"
115+ usb_STRING_MANUFACTURER = "Waveshare"
116+ )
117+
118+ var (
119+ usb_VID uint16 = 0x2e8a
120+ usb_PID uint16 = 0x0003
121+ )
Original file line number Diff line number Diff line change 1+ {
2+ "inherits" : [
3+ " rp2040"
4+ ],
5+ "serial-port" : [" 2e8a:0003" ],
6+ "build-tags" : [" waveshare_rp2040_tiny" ],
7+ "ldflags" : [
8+ " --defsym=__flash_size=1020K"
9+ ],
10+ "extra-files" : [
11+ " targets/pico-boot-stage2.S"
12+ ]
13+ }
You can’t perform that action at this time.
0 commit comments