Skip to content

added ssd1680z 2.13 eink bonnet #83

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

Merged
merged 9 commits into from
Oct 30, 2024
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
49 changes: 49 additions & 0 deletions adafruit_epd/ssd1680.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,52 @@ def set_ram_address(
self.command(_SSD1680_SET_RAMXCOUNT, bytearray([x + 1]))
# Set RAM Y address counter
self.command(_SSD1680_SET_RAMYCOUNT, bytearray([y, y >> 8]))


class Adafruit_SSD1680Z(Adafruit_SSD1680):
"""Driver for SSD1680Z ePaper display, overriding SSD1680 settings."""

# pylint: disable=too-many-arguments, useless-parent-delegation
def __init__(
self, width, height, spi, *, cs_pin, dc_pin, sramcs_pin, rst_pin, busy_pin
):
# Call the parent class's __init__() to initialize attributes
super().__init__(
width,
height,
spi,
cs_pin=cs_pin,
dc_pin=dc_pin,
sramcs_pin=sramcs_pin,
rst_pin=rst_pin,
busy_pin=busy_pin,
)
self.busy_pin = busy_pin # Ensure busy_pin is set

# pylint: enable=too-many-arguments, useless-parent-delegation

def power_up(self):
"""Power up sequence specifically for SSD1680Z."""
self.hardware_reset()
self.busy_wait()
self.command(_SSD1680_SW_RESET)
self.busy_wait()

self.command(
_SSD1680_DRIVER_CONTROL,
bytearray([self._height - 1, (self._height - 1) >> 8, 0x00]),
)
self.command(_SSD1680_DATA_MODE, bytearray([0x03]))
Copy link

@joxl joxl Dec 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I'm understanding the chart in the PR description (and quoted below) correctly, shouldn't the value for this _SSD1680_DATA_MODE command be 0x01?

Feature/Command SSD1680 Library SSD1680Z Library
Data Entry Mode bytearray([0x03]) bytearray([0x01])
... ... ...

I'm not familiar with these chips (yet), so I'm still trying to figure out where the old vs new values came from. If you could share any pointers regarding where/how you found the new values, it would be much appreciated!

self.command(_SSD1680_SET_RAMXPOS, bytearray([0x00, (self._width // 8) - 1]))
self.command(
_SSD1680_SET_RAMYPOS,
bytearray([0x00, 0x00, self._height - 1, (self._height - 1) >> 8]),
)

def update(self):
"""Update the display specifically for SSD1680Z."""
self.command(_SSD1680_DISP_CTRL2, bytearray([0xF7])) # Full update for SSD1680Z
self.command(_SSD1680_MASTER_ACTIVATE)
self.busy_wait()
if not self.busy_pin:
time.sleep(3) # Wait for update to complete