Skip to content

Feature request: display sleep/wake functions #24

Closed
@rpavlik

Description

@rpavlik

I was trying to sleep/wake the device (to save the shiny parts) when not in use. My usual technique (on TFTs anyway) is to set display.brightness = 0 to turn off the backlight, but I discovered that the command told by the source (in circuitpython core) for this board for brightness is actually "contrast" according to the controller datasheet (oled -> no backlight), which explains why it got dimmer but did not turn off completely.

The standalone SH1107 driver has sleep() and wake() functions that use explicit sleep/wake commands: https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107/blob/main/adafruit_displayio_sh1107.py#L164 but this board's display support is built-in using C, and no such functions are there. I ended up just mangling a copy of that library to wrap an existing displayio display, which works, but is not awesome. (see https://gist.github.com/rpavlik/73d1de102038f85de051fc1b8cdd3009 )

Not sure if "sleep" and "wake" can be monkey-patched in from Python into the C displayio class, or if there's some other, better way to provide those functions, but I figured this would be the library to do them in.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions