machine/atsamd21: refactor SPI pin handling to only look at pin numbers

Pin mode and pad numbers are automatically calculated from the pin
numbers, returning an error if no pinout could be found.
This commit is contained in:
Ayke van Laethem
2019-09-26 15:58:37 +02:00
committed by Ron Evans
parent 01e58691a1
commit 3fa926c512
7 changed files with 202 additions and 71 deletions
+4 -7
View File
@@ -114,13 +114,10 @@ const (
// SPI on the Circuit Playground Express.
var (
SPI0 = SPI{Bus: sam.SERCOM3_SPI,
SCK: SPI0_SCK_PIN,
MOSI: SPI0_MOSI_PIN,
MISO: SPI0_MISO_PIN,
DOpad: spiTXPad2SCK3,
DIpad: sercomRXPad0,
PinMode: PinSERCOMAlt}
SPI0 = SPI{
Bus: sam.SERCOM3_SPI,
SERCOM: 3,
}
)
// I2S pins