aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/board_macropad-rp2040.go
blob: 356641eba87ef2f4e7ad3c055a9301fd7531c015 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//go:build macropad_rp2040
// +build macropad_rp2040

package machine

const (
	NeopixelCount = 12

	// Onboard crystal oscillator frequency, in MHz.
	xoscFreq = 12 // MHz
)

const (
	SWITCH = GPIO0

	KEY1  = GPIO1
	KEY2  = GPIO2
	KEY3  = GPIO3
	KEY4  = GPIO4
	KEY5  = GPIO5
	KEY6  = GPIO6
	KEY7  = GPIO7
	KEY8  = GPIO8
	KEY9  = GPIO9
	KEY10 = GPIO10
	KEY11 = GPIO11
	KEY12 = GPIO12

	LED = GPIO13

	SPEAKER_ENABLE = GPIO14
	SPEAKER        = GPIO16

	ROT_A = GPIO18
	ROT_B = GPIO17

	OLED_CS  = GPIO22
	OLED_RST = GPIO23
	OLED_DC  = GPIO24

	NEOPIXEL = GPIO19
	WS2812   = NEOPIXEL
)

// I2C Default pins on Raspberry Pico.
const (
	I2C0_SDA_PIN = GPIO20
	I2C0_SCL_PIN = GPIO21

	I2C1_SDA_PIN = 31 // not pinned out
	I2C1_SCL_PIN = 31 // not pinned out
)

// SPI default pins
const (
	// Default Serial Clock Bus 1 for SPI communications
	SPI1_SCK_PIN = GPIO26
	// Default Serial Out Bus 1 for SPI communications
	SPI1_SDO_PIN = GPIO27 // Tx
	// Default Serial In Bus 1 for SPI communications
	SPI1_SDI_PIN = GPIO28 // Rx

	SPI0_SCK_PIN = 31 // not pinned out
	SPI0_SDO_PIN = 31 // not pinned out
	SPI0_SDI_PIN = 31 // not pinned out
)