machine/samd21: use pins specified in I2CConfig

Instead of configuring machine.I2C0, machine.I2C1, etc. statically,
allow the pins to be set using machine.I2CConfig. This will also
automatically configure the correct pin mode for each pin instead of
having to specify that manually.
This commit is contained in:
Ayke van Laethem
2019-09-30 14:21:52 +02:00
committed by Ron Evans
parent 8fe126b1f6
commit d266e44bc5
7 changed files with 52 additions and 31 deletions
+2
View File
@@ -5,6 +5,8 @@ import "errors"
var (
ErrInvalidInputPin = errors.New("machine: invalid input pin")
ErrInvalidOutputPin = errors.New("machine: invalid output pin")
ErrInvalidClockPin = errors.New("machine: invalid clock pin")
ErrInvalidDataPin = errors.New("machine: invalid data pin")
)
type PinConfig struct {