mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-09 01:13:40 +00:00
feature: some additional changes to drivers.Pin HAL for clarity and readability.
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
+5
-6
@@ -12,7 +12,6 @@ import (
|
||||
|
||||
"tinygo.org/x/drivers"
|
||||
"tinygo.org/x/drivers/internal/legacy"
|
||||
"tinygo.org/x/drivers/internal/pin"
|
||||
"tinygo.org/x/drivers/pixel"
|
||||
)
|
||||
|
||||
@@ -32,10 +31,10 @@ type Config struct {
|
||||
|
||||
type Device struct {
|
||||
bus drivers.SPI
|
||||
cs drivers.PinOutput
|
||||
dc drivers.PinOutput
|
||||
rst drivers.PinOutput
|
||||
isBusy drivers.PinInput
|
||||
cs drivers.PinOutputFunc
|
||||
dc drivers.PinOutputFunc
|
||||
rst drivers.PinOutputFunc
|
||||
isBusy drivers.PinInputFunc
|
||||
width int16
|
||||
height int16
|
||||
buffer []uint8
|
||||
@@ -50,7 +49,7 @@ type Device struct {
|
||||
type Speed uint8
|
||||
|
||||
// New returns a new uc8151 driver. Pass in a fully configured SPI bus.
|
||||
func New(bus drivers.SPI, csPin, dcPin, rstPin pin.Output, busyPin pin.Input) Device {
|
||||
func New(bus drivers.SPI, csPin, dcPin, rstPin drivers.PinOutput, busyPin drivers.PinInput) Device {
|
||||
legacy.ConfigurePinOut(csPin)
|
||||
legacy.ConfigurePinOut(dcPin)
|
||||
legacy.ConfigurePinOut(rstPin)
|
||||
|
||||
Reference in New Issue
Block a user