diff --git a/inky/impression.go b/inky/impression.go index 2c54739..0acd72a 100644 --- a/inky/impression.go +++ b/inky/impression.go @@ -160,7 +160,7 @@ func NewImpression(p spi.Port, dc gpio.PinOut, reset gpio.PinOut, busy gpio.PinI // is 192K Bytes. To make the Impression 7.3 treat this as single trans- // action, we have to take over control of the CS pin and manipulate it // as required. - c, err := p.Connect(cSpeed, spi.Mode0|spi.NoCS, cs0Pin) + c, err := p.Connect(cSpeed, spi.Mode0|spi.NoCS, 8) if err != nil { return nil, fmt.Errorf("failed to connect to inky over spi: %v", err) } @@ -191,7 +191,7 @@ func NewImpression(p spi.Port, dc gpio.PinOut, reset gpio.PinOut, busy gpio.PinI model: o.Model, variant: o.DisplayVariant, pcbVariant: o.PCBVariant, - cs: gpioreg.ByName("GPIO8"), + cs: gpioreg.ByName(cs0Pin), }, saturation: 50, // Looks good enough for most of the images. } diff --git a/inky/inky.go b/inky/inky.go index 4dc029b..6cdd610 100644 --- a/inky/inky.go +++ b/inky/inky.go @@ -23,7 +23,7 @@ var _ display.Drawer = &Dev{} var _ conn.Resource = &Dev{} const ( - cs0Pin = 8 + cs0Pin = "GPIO8" ) var borderColor = map[Color]byte{ @@ -75,7 +75,7 @@ func New(p spi.Port, dc gpio.PinOut, reset gpio.PinOut, busy gpio.PinIn, o *Opts return nil, fmt.Errorf("unsupported color: %v", o.ModelColor) } - c, err := p.Connect(488*physic.KiloHertz, spi.Mode0, cs0Pin) + c, err := p.Connect(488*physic.KiloHertz, spi.Mode0 | spi.NoCS, 8) if err != nil { return nil, fmt.Errorf("failed to connect to inky over spi: %v", err) } @@ -101,7 +101,7 @@ func New(p spi.Port, dc gpio.PinOut, reset gpio.PinOut, busy gpio.PinIn, o *Opts model: o.Model, variant: o.DisplayVariant, pcbVariant: o.PCBVariant, - cs: gpioreg.ByName("GPIO8"), + cs: gpioreg.ByName(cs0Pin), } switch o.Model {