mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-10 01:43:40 +00:00
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:
+3
-5
@@ -4,13 +4,11 @@
|
||||
//
|
||||
package lis3dh // import "tinygo.org/x/drivers/lis3dh"
|
||||
|
||||
import (
|
||||
"machine"
|
||||
)
|
||||
import "tinygo.org/x/drivers"
|
||||
|
||||
// Device wraps an I2C connection to a LIS3DH device.
|
||||
type Device struct {
|
||||
bus machine.I2C
|
||||
bus drivers.I2C
|
||||
Address uint16
|
||||
r Range
|
||||
}
|
||||
@@ -18,7 +16,7 @@ type Device struct {
|
||||
// New creates a new LIS3DH connection. The I2C bus must already be 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: Address0}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user