spi: remove machine.SPI and replace with drivers.SPI interface for almost all SPI drivers

Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
deadprogram
2020-10-18 18:03:12 +02:00
parent e376785596
commit 39e9e209ec
23 changed files with 135 additions and 124 deletions
+4 -2
View File
@@ -9,11 +9,13 @@ import (
"image/color"
"machine"
"time"
"tinygo.org/x/drivers"
)
// Device wraps an SPI connection.
type Device struct {
bus machine.SPI
bus drivers.SPI
dcPin machine.Pin
rstPin machine.Pin
scePin machine.Pin
@@ -29,7 +31,7 @@ type Config struct {
}
// New creates a new PCD8544 connection. The SPI bus must already be configured.
func New(bus machine.SPI, dcPin, rstPin, scePin machine.Pin) *Device {
func New(bus drivers.SPI, dcPin, rstPin, scePin machine.Pin) *Device {
return &Device{
bus: bus,
dcPin: dcPin,