Fix formatting

pull/91/head
George Sexton 1 year ago
parent 4242fd7315
commit bb4ba57096

@ -43,7 +43,7 @@ func NewAdafruitI2CBackpack(bus i2c.Bus, address uint16, rows, cols int) (*HD447
reset, _ := gr.ByOffset(4).(gpio.PinOut) reset, _ := gr.ByOffset(4).(gpio.PinOut)
enable, _ := gr.ByOffset(5).(gpio.PinOut) enable, _ := gr.ByOffset(5).(gpio.PinOut)
bl := gr.ByOffset(6).(gpio.PinOut) bl := gr.ByOffset(6).(gpio.PinOut)
return NewHD44780(gr, &reset, &enable, NewBacklight(bl), rows, cols) return NewHD44780(gr, reset, enable, NewBacklight(bl), rows, cols)
} }
// This function returns a display configured to use the SPI side of the Adafruit // This function returns a display configured to use the SPI side of the Adafruit
@ -55,8 +55,8 @@ func NewAdafruitSPIBackpack(conn spi.Conn, rows, cols int) (*HD44780, error) {
} }
// The SPI side has the same pins but in reverse order from the I2C side. // The SPI side has the same pins but in reverse order from the I2C side.
gr, _ := chip.Group(d7, d6, d5, d4) gr, _ := chip.Group(d7, d6, d5, d4)
rs := &chip.Pins[rsPin] rs := chip.Pins[rsPin]
e := &chip.Pins[enablePin] e := chip.Pins[enablePin]
bl := chip.Pins[backlightPin] bl := chip.Pins[backlightPin]
return NewHD44780(gr, rs, e, NewBacklight(bl), rows, cols) return NewHD44780(gr, rs, e, NewBacklight(bl), rows, cols)
} }

@ -46,7 +46,7 @@ func Example() {
reset := pins[4].(gpio.PinOut) reset := pins[4].(gpio.PinOut)
enable := pins[5].(gpio.PinOut) enable := pins[5].(gpio.PinOut)
bl := hd44780.NewBacklight(pins[6].(gpio.PinOut)) bl := hd44780.NewBacklight(pins[6].(gpio.PinOut))
lcd, err := hd44780.NewHD44780(ls, &reset, &enable, bl, 2, 16) lcd, err := hd44780.NewHD44780(ls, reset, enable, bl, 2, 16)
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

@ -83,7 +83,7 @@ func getRowConstant(row, maxcols int) byte {
// display.DisplayRGBBacklight. See GPIOMonoBacklight. // display.DisplayRGBBacklight. See GPIOMonoBacklight.
func NewHD44780( func NewHD44780(
dataPinGroup gpio.Group, dataPinGroup gpio.Group,
resetPin, enablePin *gpio.PinOut, resetPin, enablePin gpio.PinOut,
backlight any, backlight any,
rows, cols int) (*HD44780, error) { rows, cols int) (*HD44780, error) {
@ -94,8 +94,8 @@ func NewHD44780(
lcd := &HD44780{ lcd := &HD44780{
dataPins: dataPinGroup, dataPins: dataPinGroup,
resetPin: *resetPin, resetPin: resetPin,
enablePin: *enablePin, enablePin: enablePin,
mode: mode, mode: mode,
rows: rows, rows: rows,
cols: cols, cols: cols,

@ -46,5 +46,5 @@ func NewPCF857xBackpack(bus i2c.Bus, address uint16, rows, cols int) (*HD44780,
reset := grPins[4].(gpio.PinOut) reset := grPins[4].(gpio.PinOut)
enable := grPins[5].(gpio.PinOut) enable := grPins[5].(gpio.PinOut)
bl := grPins[6].(gpio.PinOut) bl := grPins[6].(gpio.PinOut)
return NewHD44780(gr, &reset, &enable, NewBacklight(bl), rows, cols) return NewHD44780(gr, reset, enable, NewBacklight(bl), rows, cols)
} }

Loading…
Cancel
Save