machine: refactor pin handling to auto-detect pin mode

With this change, it's no longer necessary to set a specific pin mode:
it will get autodetected in the Configure() call.

Tested on an ItsyBitsy M4 with the mpu6050 example in the drivers repo.
This commit is contained in:
Ayke van Laethem
2020-01-18 14:12:55 +01:00
committed by Ron Evans
parent 4c0ebb5b41
commit c61657d22d
6 changed files with 48 additions and 27 deletions
+4 -4
View File
@@ -69,10 +69,10 @@ const (
// I2C on the ItsyBitsy M4.
var (
I2C0 = I2C{Bus: sam.SERCOM2_I2CM,
SDA: SDA_PIN,
SCL: SCL_PIN,
PinMode: PinSERCOM}
I2C0 = I2C{
Bus: sam.SERCOM2_I2CM,
SERCOM: 2,
}
)
// SPI pins