pull/90/head
George Sexton 1 year ago
parent 017fbe3705
commit f63f3df9a9

@ -3,9 +3,9 @@
// that can be found in the LICENSE file.
// Package mcp23xxx provides drivers for the MCP23XXX family of GPIO expanders.
// It's availble with either I2C or SPI interfaces in 8 and 16 bit variants.
// It's availble with either I2C or SPI interfaces in 8 and 16 bit variants.
// Additionally, variants are available that have Open-Drain outputs.
//
//
// # Datasheet
//
// https://ww1.microchip.com/downloads/en/DeviceDoc/20001952C.pdf

@ -45,8 +45,8 @@ func (pg *pinGroup) Pins() []pin.Pin {
pins := make([]pin.Pin, len(pg.pins))
for ix, p := range pg.pins {
pins[ix] = p
}
pins[ix] = p
}
return pins
}
@ -139,7 +139,7 @@ func (pg *pinGroup) Read(mask gpio.GPIOValue) (result gpio.GPIOValue, err error)
rmask |= (1 << pg.pins[bit].Number())
}
}
// Make sure the direction for the pins involved in this write read is
// Make sure the direction for the pins involved in this write read is
// Input.
port := pg.pins[0].port
currentIn, err := port.iodir.readValue(true)
@ -197,7 +197,7 @@ func (pg *pinGroup) Halt() error {
return r.Halt()
}
}
// TODO: I think we want to call Dev.Halt()
// TODO: I think we want to call Dev.Halt()
return nil
}

@ -108,7 +108,7 @@ func makeDev(ra registerAccess, variant Variant, devicename string) (*Dev, error
for i := range ports {
// pre-cache iodir
_, err := ports[i].iodir.readValue(false)
if err != nil {
if err != nil {
return nil, err
}
pins[i] = ports[i].pins()

Loading…
Cancel
Save