i2c: switch all i2c drivers definitions to use i2c bus interface type instead of machine package concrete type

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2020-08-27 12:45:17 +02:00
committed by Ron Evans
parent a07b20f2f9
commit db02cbb8a4
24 changed files with 86 additions and 87 deletions
+4 -3
View File
@@ -5,15 +5,16 @@
package ds3231 // import "tinygo.org/x/drivers/ds3231"
import (
"machine"
"time"
"tinygo.org/x/drivers"
)
type Mode uint8
// Device wraps an I2C connection to a DS3231 device.
type Device struct {
bus machine.I2C
bus drivers.I2C
Address uint16
}
@@ -21,7 +22,7 @@ type Device struct {
// configured.
//
// This function only creates the Device object, it does not touch the device.
func New(bus machine.I2C) Device {
func New(bus drivers.I2C) Device {
return Device{
bus: bus,
Address: Address,