Skip to content

Commit 4424fe0

Browse files
deadprogramaykevl
authored andcommitted
machine/circuitplay_express: add basic support for Adafruit Circuit Playground express pin mappings
Signed-off-by: Ron Evans <[email protected]>
1 parent 34939ab commit 4424fe0

File tree

2 files changed

+75
-0
lines changed

2 files changed

+75
-0
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
// +build sam,atsamd21,circuitplay_express
2+
3+
package machine
4+
5+
// GPIO Pins
6+
const (
7+
D0 = PB09
8+
D1 = PB08
9+
D2 = PB02
10+
D3 = PB03
11+
D4 = PA28
12+
D5 = PA14
13+
D6 = PA05
14+
D7 = PA15
15+
D8 = PB23
16+
D9 = PA06
17+
D10 = PA07
18+
D11 = 0xff // does not seem to exist
19+
D12 = PA02
20+
D13 = PA17 // PWM available
21+
)
22+
23+
// Analog Pins
24+
const (
25+
A0 = PA02 // PWM available, also ADC/AIN[0]
26+
A1 = PA05 // ADC/AIN[5]
27+
A2 = PA06 // PWM available, also ADC/AIN[6]
28+
A3 = PA07 // PWM available, also ADC/AIN[7]
29+
A4 = PB03 // PORTB
30+
A5 = PB02 // PORTB
31+
A6 = PB09 // PORTB
32+
A7 = PB08 // PORTB
33+
A8 = PA11 // ADC/AIN[19]
34+
A9 = PA09 // ADC/AIN[17]
35+
A10 = PA04
36+
)
37+
38+
const (
39+
LED = D13
40+
NEOPIXELS = D8
41+
42+
BUTTONA = D4
43+
BUTTONB = D5
44+
SLIDER = D7 // built-in slide switch
45+
46+
BUTTON = BUTTONA
47+
BUTTON1 = BUTTONB
48+
49+
LIGHTSENSOR = A8
50+
TEMPSENSOR = A9
51+
PROXIMITY = A10
52+
)
53+
54+
// USBCDC pins
55+
const (
56+
USBCDC_DM_PIN = PA24
57+
USBCDC_DP_PIN = PA25
58+
)
59+
60+
// UART0 pins
61+
const (
62+
UART_TX_PIN = PB08 // PORTB
63+
UART_RX_PIN = PB09 // PORTB
64+
)
65+
66+
// I2C pins
67+
const (
68+
SDA_PIN = PA00 // SDA: SERCOM3/PAD[0]
69+
SCL_PIN = PA01 // SCL: SERCOM3/PAD[1]
70+
)

targets/circuitplay-express.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"inherits": ["atsamd21g18a"],
3+
"build-tags": ["sam", "atsamd21g18a", "circuitplay_express"],
4+
"flash": "uf2conv.py {bin}"
5+
}

0 commit comments

Comments
 (0)