Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of the set_vertical_scroll Display constructor parameter. #23

Merged
merged 1 commit into from
Aug 24, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions adafruit_displayio_ssd1306.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,14 @@


class SSD1306(displayio.Display):
"""SSD1306 driver"""
"""
SSD1306 driver

:param int width: The width of the display
:param int height: The height of the display
:param int rotation: The rotation of the display in degrees. Default is 0. Must be one of
(0, 90, 180, 270)
"""

def __init__(self, bus, **kwargs):
# Patch the init sequence for 32 pixel high displays.
Expand All @@ -74,7 +81,6 @@ def __init__(self, bus, **kwargs):
set_column_command=0x21,
set_row_command=0x22,
data_as_commands=True,
set_vertical_scroll=0xD3,
brightness_command=0x81,
single_byte_bounds=True,
)
Expand All @@ -85,17 +91,18 @@ def is_awake(self):
"""
The power state of the display. (read-only)

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

:type: bool
"""
return self._is_awake

def sleep(self):
"""
Put display into sleep mode
Put display into sleep mode.

Display uses < 10uA in sleep mode
Display remembers display data and operation mode active prior to sleeping
MP can access (update) the built-in display RAM
Display uses < 10uA in sleep mode. Display remembers display data and operation mode
active prior to sleeping. MP can access (update) the built-in display RAM.
"""
if self._is_awake:
self.bus.send(int(0xAE), "") # 0xAE = display off, sleep mode
Expand Down