blob: 089eadbf0998011bf8a0fa906a9dac481d7d77a9 (
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
|
//go:build sam && atsamd21 && trinket_m0
package machine
// used to reset into bootloader
const resetMagicValue = 0xf01669ef
// GPIO Pins
const (
D0 = PA08 // PWM available
D1 = PA02
D2 = PA09 // PWM available
D3 = PA07 // PWM available / UART0 RX
D4 = PA06 // PWM available / UART0 TX
D13 = PA10 // LED
)
// Analog pins
const (
A0 = D1
A1 = D2
A2 = D0
A3 = D3
A4 = D4
)
const (
LED = D13
)
// USBCDC pins
const (
USBCDC_DM_PIN = PA24
USBCDC_DP_PIN = PA25
)
// UART1 pins
const (
UART_TX_PIN = D4
UART_RX_PIN = D3
)
// UART1 on the Trinket M0.
var UART1 = &sercomUSART0
// SPI pins
const (
SPI0_SCK_PIN = D3
SPI0_SDO_PIN = D4
SPI0_SDI_PIN = D2
)
// SPI on the Trinket M0.
var SPI0 = sercomSPIM0
// I2C pins
const (
SDA_PIN = D0 // SDA
SCL_PIN = D2 // SCL
)
// I2C on the Trinket M0.
var (
I2C0 = sercomI2CM2
)
// I2S pins
const (
I2S_SCK_PIN = PA10
I2S_SDO_PIN = PA08
I2S_SDI_PIN = NoPin // TODO: figure out what this is on Trinket M0.
I2S_WS_PIN = NoPin // TODO: figure out what this is on Trinket M0.
)
// USB CDC identifiers
const (
usb_STRING_PRODUCT = "Adafruit Trinket M0"
usb_STRING_MANUFACTURER = "Adafruit"
)
var (
usb_VID uint16 = 0x239A
usb_PID uint16 = 0x801E
)
var (
DefaultUART = UART1
)
|