adafruit_displayio_sh1107

DisplayIO driver for SH1107 monochrome displays

  • Author(s): Scott Shawcroft, Mark Roberts (mdroberts1243), James Carr

Implementation Notes

Hardware:

Software and Dependencies:

adafruit_displayio_sh1107.DISPLAY_OFFSET_ADAFRUIT_128x128_OLED_5297 = 0

The hardware display offset to use when configuring the SH1107 for the Adafruit Monochrome 1.12” 128x128 OLED.

from adafruit_displayio_sh1107 import SH1107, DISPLAY_OFFSET_ADAFRUIT_128x128_OLED_5297

# Constructor for the Adafruit Monochrome 1.12" 128x128 OLED
display = SH1107(bus, width=128, height=128,
    display_offset=DISPLAY_OFFSET_ADAFRUIT_128x128_OLED_5297, rotation=90)
adafruit_displayio_sh1107.DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650 = 96

The hardware display offset to use when configuring the SH1107 for the Adafruit Featherwing 128x64 OLED. This is the default if not passed in.

from adafruit_displayio_sh1107 import SH1107, DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650

# Constructor for the Adafruit FeatherWing 128x64 OLED
display = SH1107(bus, width=128, height=64,
    display_offset=DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650)
# Or as it's the default
display = SH1107(bus, width=128, height=64)
adafruit_displayio_sh1107.DISPLAY_OFFSET_PIMORONI_MONO_OLED_PIM374 = 0

The hardware display offset to use when configuring the SH1107 for the Pimoroni Mono 128x128 OLED

from adafruit_displayio_sh1107 import SH1107, DISPLAY_OFFSET_PIMORONI_MONO_OLED_PIM374

# Constructor for the Pimoroni Mono 128x128 OLED
display = SH1107(bus, width=128, height=128,
    display_offset=DISPLAY_OFFSET_PIMORONI_MONO_OLED_PIM374)
class adafruit_displayio_sh1107.SH1107(*args: Any, **kwargs: Any)

SH1107 driver for use with DisplayIO

Parameters
  • bus – The bus that the display is connected to.

  • width (int) – The width of the display. Maximum of 128

  • height (int) – The height of the display. Maximum of 128

  • rotation (int) – The rotation of the display. 0, 90, 180 or 270.

  • display_offset (int) – The display offset that the first column is wired to. This will be dependent on the OLED display and two displays with the same dimensions could have different offsets. This defaults to DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650

property is_awake

The power state of the display. (read-only)

True if the display is active, False if in sleep mode.

Type

bool

sleep()

Put display into sleep mode. The display uses < 5uA in sleep mode

Sleep mode does the following:

  1. Stops the oscillator and DC-DC circuits

  2. Stops the OLED drive

  3. Remembers display data and operation mode active prior to sleeping

  4. The MP can access (update) the built-in display RAM

wake()

Wake display from sleep mode