Finomnis/st7565

Access to `set_line_offset` in graphics mode.

agrif opened this issue · 4 comments

My ST7565 controller does not appear to set the line offset to 0 after a reset. I'm not sure yet whether this is a weird cloned ST7565 or if something else is going on. Right now I'm setting a 0 line offset manually.

However, set_line_offset is only available in raw mode, and there doesn't appear to be any way to move from raw mode to graphics mode or vice versa. At the moment, I'm detaching the display from the SPI interface and sending the raw command myself.

I can think of a few ways to make this less awkward. Any one of these would be enough, but they're not exclusive.

  • Set the line offset to 0 inside either reset or flush. There's some indication in the datasheet that this is normal. This is what the original firmware driving my display does during reset.

  • Move set_line_offset (and maybe a few other settings commands) into the common interface accessible from all modes. It would be neat, for example, to invert the entire screen or turn on all pixels cheaply even in graphics mode.

  • Add a way to move from graphics mode to raw mode and back. I haven't thought too hard about whether this would cause problems.

Set the line offset to 0 inside either reset or flush. - If a chip reset doesn't initialize this properly, we should add this regardless of whether or not we implement your other proposed changes.

I can make a PR for that, at least. I don't have strong opinions on the other two changes, though I'd be happy to add those also.

Of the two, I think exposing set_line_offset, set_inverted, and display_all_points in all modes has the smallest impact.

Sure, whatever you deem useful :)

Fixed by #23