aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/board_challenger_rp2040.go
blob: 9a85aa0aefeed0046e5f25f391ead5beb9baba3e (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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
//go:build challenger_rp2040

package machine

const (
	LED = GPIO24

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

// GPIO Pins
const (
	D5  = GPIO2
	D6  = GPIO3
	D9  = GPIO4
	D10 = GPIO5
	D11 = GPIO6
	D12 = GPIO7
	D13 = GPIO8
)

// Analog pins
const (
	A0 = ADC0
	A1 = ADC1
	A2 = ADC2
	A3 = ADC3
)

// I2C Pins.
const (
	I2C0_SDA_PIN = GPIO24
	I2C0_SCL_PIN = GPIO25

	I2C1_SDA_PIN = GPIO2
	I2C1_SCL_PIN = GPIO3

	SDA_PIN = I2C1_SDA_PIN
	SCL_PIN = I2C1_SCL_PIN
)

// SPI default pins
const (
	// Default Serial Clock Bus 0 for SPI communications
	SPI0_SCK_PIN = GPIO22
	// Default Serial Out Bus 0 for SPI communications
	SPI0_SDO_PIN = GPIO23 // Tx
	// Default Serial In Bus 0 for SPI communications
	SPI0_SDI_PIN = GPIO20 // Rx

	// Default Serial Clock Bus 1 for SPI communications
	SPI1_SCK_PIN = GPIO10
	// Default Serial Out Bus 1 for SPI communications
	SPI1_SDO_PIN = GPIO11 // Tx
	// Default Serial In Bus 1 for SPI communications
	SPI1_SDI_PIN = GPIO12 // Rx
)

// LoRa default pins
const (
	LORA_CS    = GPIO9
	LORA_SCK   = GPIO10
	LORA_SDO   = GPIO11
	LORA_SDI   = GPIO12
	LORA_RESET = GPIO13
	LORA_DIO0  = GPIO14
	LORA_DIO1  = GPIO15
	LORA_DIO2  = GPIO18
)

// UART pins
const (
	UART0_TX_PIN = GPIO16
	UART0_RX_PIN = GPIO17
	UART1_TX_PIN = GPIO4
	UART1_RX_PIN = GPIO5
	UART_TX_PIN  = UART0_TX_PIN
	UART_RX_PIN  = UART0_RX_PIN
)

var DefaultUART = UART0

// USB identifiers
const (
	usb_STRING_PRODUCT      = "Challenger 2040 LoRa"
	usb_STRING_MANUFACTURER = "iLabs"
)

var (
	usb_VID uint16 = 0x2e8a
	usb_PID uint16 = 0x1023
)