Skip to content

Commit 6907bce

Browse files
committed
off by one adjustments
fix alignment so all 122x250 pixels are available
1 parent b896b61 commit 6907bce

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

adafruit_epd/ssd1680.py

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
except ImportError:
2525
pass
2626

27-
__version__ = "0.0.0+auto.0"
27+
__version__ = "2.13.0"
2828
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_EPD.git"
2929

3030
_SSD1680_DRIVER_CONTROL = const(0x01)
@@ -244,13 +244,13 @@ def power_up(self):
244244

245245
self.command(
246246
_SSD1680_DRIVER_CONTROL,
247-
bytearray([self._height - 1, (self._height - 1) >> 8, 0x00]),
247+
bytearray([self._height, (self._height) >> 8, 0x00]),
248248
)
249249
self.command(_SSD1680_DATA_MODE, bytearray([0x03]))
250-
self.command(_SSD1680_SET_RAMXPOS, bytearray([0x00, (self._width // 8) - 1]))
250+
self.command(_SSD1680_SET_RAMXPOS, bytearray([0x00, (self._width // 8)]))
251251
self.command(
252252
_SSD1680_SET_RAMYPOS,
253-
bytearray([0x00, 0x00, self._height - 1, (self._height - 1) >> 8]),
253+
bytearray([0x00, 0x00, self._height, (self._height) >> 8]),
254254
)
255255

256256
def update(self):
@@ -260,3 +260,13 @@ def update(self):
260260
self.busy_wait()
261261
if not self.busy_pin:
262262
time.sleep(3) # Wait for update to complete
263+
264+
def set_ram_address(
265+
self, x: int, y: int
266+
) -> None: # pylint: disable=unused-argument, no-self-use
267+
"""Set the RAM address location, not used on this chipset but required by
268+
the superclass"""
269+
# Set RAM X address counter
270+
self.command(_SSD1680_SET_RAMXCOUNT, bytearray([x]))
271+
# Set RAM Y address counter
272+
self.command(_SSD1680_SET_RAMYCOUNT, bytearray([y, y >> 8]))

0 commit comments

Comments
 (0)