Skip to content

Commit 7abc671

Browse files
authored
sam: add support for the MKR1000 board
1 parent 2540172 commit 7abc671

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

src/machine/board_arduino_mkr1000.go

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
// +build arduino_mkr1000
2+
3+
// This contains the pin mappings for the Arduino MKR1000 board.
4+
//
5+
// For more information, see: https://store.arduino.cc/usa/arduino-mkr1000-with-headers-mounted
6+
//
7+
package machine
8+
9+
// used to reset into bootloader
10+
const RESET_MAGIC_VALUE = 0x07738135
11+
12+
// GPIO Pins
13+
const (
14+
RX0 Pin = PB23 // UART2 RX
15+
TX1 Pin = PB22 // UART2 TX
16+
17+
D0 Pin = PA22 // PWM available
18+
D1 Pin = PA23 // PWM available
19+
D2 Pin = PA10 // PWM available
20+
D3 Pin = PA11 // PWM available
21+
D4 Pin = PB10 // PWM available
22+
D5 Pin = PB11 // PWM available
23+
24+
D6 Pin = PA20 // PWM available
25+
D7 Pin = PA21 // PWM available
26+
D8 Pin = PA16 // PWM available
27+
D9 Pin = PA17
28+
D10 Pin = PA19 // PWM available
29+
D11 Pin = PA08 // SDA
30+
D12 Pin = PA09 // PWM available, SCL
31+
D13 Pin = PB23 // RX
32+
D14 Pin = PB22 // TX
33+
)
34+
35+
// Analog pins
36+
const (
37+
A0 Pin = PA02 // ADC0/AIN[0]
38+
A1 Pin = PB02 // AIN[10]
39+
A2 Pin = PB03 // AIN[11]
40+
A3 Pin = PA04 // AIN[04]
41+
A4 Pin = PA05 // AIN[05]
42+
A5 Pin = PA06 // AIN[06]
43+
A6 Pin = PA07 // AIN[07]
44+
)
45+
46+
const (
47+
LED = D6
48+
)
49+
50+
// UART0 aka USBCDC pins
51+
const (
52+
USBCDC_DM_PIN Pin = PA24
53+
USBCDC_DP_PIN Pin = PA25
54+
)
55+
56+
// UART1 pins
57+
const (
58+
UART_TX_PIN Pin = PB22
59+
UART_RX_PIN Pin = PB23
60+
)
61+
62+
// I2C pins
63+
const (
64+
SDA_PIN Pin = D11 // SDA
65+
SCL_PIN Pin = D12 // SCL
66+
)
67+
68+
// SPI pins
69+
const (
70+
SPI0_SCK_PIN Pin = D9 // SCK: S1
71+
SPI0_SDO_PIN Pin = D8 // SDO: S1
72+
SPI0_SDI_PIN Pin = D10 // SDI: S1
73+
)
74+
75+
// I2S pins
76+
const (
77+
I2S_SCK_PIN Pin = PA10
78+
I2S_SD_PIN Pin = PA07
79+
I2S_WS_PIN = NoPin // TODO: figure out what this is on Arduino Nano 33.
80+
)
81+
82+
// USB CDC identifiers
83+
const (
84+
usb_STRING_PRODUCT = "Arduino MKR1000"
85+
usb_STRING_MANUFACTURER = "Arduino"
86+
)
87+
88+
var (
89+
usb_VID uint16 = 0x2341
90+
usb_PID uint16 = 0x804e
91+
)

targets/arduino-mkr1000.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"inherits": ["atsamd21g18a"],
3+
"build-tags": ["arduino_mkr1000"],
4+
"flash-command": "bossac -i -e -w -v -R -U --port={port} --offset=0x2000 {bin}",
5+
"flash-1200-bps-reset": "true"
6+
}

0 commit comments

Comments
 (0)