mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-07-26 10:38:41 +00:00
adc: update drivers with ADC to use new config struct
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
@@ -57,7 +57,7 @@ func New(pin machine.Pin) Device {
|
||||
|
||||
// Configure configures the ADC pin used for the thermistor.
|
||||
func (d *Device) Configure() {
|
||||
d.adc.Configure()
|
||||
d.adc.Configure(machine.ADCConfig{})
|
||||
}
|
||||
|
||||
// ReadTemperature returns the temperature in celsius milli degrees (°C/1000)
|
||||
|
||||
@@ -86,7 +86,7 @@ func (res *FourWire) ReadX() uint16 {
|
||||
res.xm.Pin.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||
res.xm.Pin.Low()
|
||||
|
||||
res.yp.Configure()
|
||||
res.yp.Configure(machine.ADCConfig{})
|
||||
|
||||
return 0xFFFF - res.yp.Get()
|
||||
}
|
||||
@@ -101,7 +101,7 @@ func (res *FourWire) ReadY() uint16 {
|
||||
res.ym.Pin.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||
res.ym.Pin.Low()
|
||||
|
||||
res.xp.Configure()
|
||||
res.xp.Configure(machine.ADCConfig{})
|
||||
|
||||
return 0xFFFF - res.xp.Get()
|
||||
}
|
||||
@@ -114,8 +114,8 @@ func (res *FourWire) ReadZ() uint16 {
|
||||
res.ym.Pin.Configure(machine.PinConfig{Mode: machine.PinOutput})
|
||||
res.ym.Pin.High()
|
||||
|
||||
res.xm.Configure()
|
||||
res.yp.Configure()
|
||||
res.xm.Configure(machine.ADCConfig{})
|
||||
res.yp.Configure(machine.ADCConfig{})
|
||||
|
||||
z1 := res.xm.Get()
|
||||
z2 := res.yp.Get()
|
||||
|
||||
Reference in New Issue
Block a user