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
+7
View File
@@ -1,5 +1,12 @@
package machine
import "errors"
var (
ErrInvalidInputPin = errors.New("machine: invalid input pin")
ErrInvalidOutputPin = errors.New("machine: invalid output pin")
)
type PinConfig struct {
Mode PinMode
}