mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-13 03:13:41 +00:00
revision: modify proposed pin HAL.
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
+4
-3
@@ -7,6 +7,7 @@ package ft6336
|
||||
import (
|
||||
"tinygo.org/x/drivers"
|
||||
"tinygo.org/x/drivers/internal/legacy"
|
||||
"tinygo.org/x/drivers/internal/pin"
|
||||
"tinygo.org/x/drivers/touch"
|
||||
)
|
||||
|
||||
@@ -19,13 +20,13 @@ type Device struct {
|
||||
}
|
||||
|
||||
// New returns FT6336 device for the provided I2C bus using default address.
|
||||
func New(i2c drivers.I2C, intPin legacy.PinInput) *Device {
|
||||
func New(i2c drivers.I2C, intPin pin.Input) *Device {
|
||||
return &Device{
|
||||
bus: i2c,
|
||||
buf: make([]byte, 11),
|
||||
Address: Address,
|
||||
configurePins: func() {
|
||||
legacy.ConfigurePinInputPulldown(intPin)
|
||||
pin.ConfigureInputPulldown(intPin)
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -37,7 +38,7 @@ type Config struct {
|
||||
// Configure the FT6336 device.
|
||||
func (d *Device) Configure(config Config) error {
|
||||
if d.configurePins == nil {
|
||||
return legacy.ErrConfigBeforeInstantiated
|
||||
return pin.ErrConfigBeforeInstantiated
|
||||
}
|
||||
d.write1Byte(0xA4, 0x00)
|
||||
d.configurePins()
|
||||
|
||||
Reference in New Issue
Block a user