aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/machine/board_microbit.go
blob: a606ad8695b6e9c973021b58c2e2892143e41d6c (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
// +build microbit

package machine

// The micro:bit does not have a 32kHz crystal on board.
const HasLowFrequencyCrystal = false

// Buttons on the micro:bit (A and B)
const (
	BUTTON  Pin = BUTTONA
	BUTTONA Pin = 17
	BUTTONB Pin = 26
)

// UART pins
const (
	UART_TX_PIN Pin = 24
	UART_RX_PIN Pin = 25
)

// ADC pins
const (
	ADC0 Pin = 3 // P0 on the board
	ADC1 Pin = 2 // P1 on the board
	ADC2 Pin = 1 // P2 on the board
)

// I2C pins
const (
	SDA_PIN Pin = 30 // P20 on the board
	SCL_PIN Pin = 0  // P19 on the board
)

// SPI pins
const (
	SPI0_SCK_PIN Pin = 23 // P13 on the board
	SPI0_SDO_PIN Pin = 21 // P15 on the board
	SPI0_SDI_PIN Pin = 22 // P14 on the board
)

// GPIO/Analog pins
const (
	P0  Pin = 3
	P1  Pin = 2
	P2  Pin = 1
	P3  Pin = 4
	P4  Pin = 5
	P5  Pin = 17
	P6  Pin = 12
	P7  Pin = 11
	P8  Pin = 18
	P9  Pin = 10
	P10 Pin = 6
	P11 Pin = 26
	P12 Pin = 20
	P13 Pin = 23
	P14 Pin = 22
	P15 Pin = 21
	P16 Pin = 16
)

// LED matrix pins
const (
	LED_COL_1 Pin = 4
	LED_COL_2 Pin = 5
	LED_COL_3 Pin = 6
	LED_COL_4 Pin = 7
	LED_COL_5 Pin = 8
	LED_COL_6 Pin = 9
	LED_COL_7 Pin = 10
	LED_COL_8 Pin = 11
	LED_COL_9 Pin = 12
	LED_ROW_1 Pin = 13
	LED_ROW_2 Pin = 14
	LED_ROW_3 Pin = 15
)