|
14 | 14 | import adafruit_framebuf |
15 | 15 | from adafruit_epd.epd import Adafruit_EPD |
16 | 16 |
|
| 17 | +# for backwards compatibility |
| 18 | +from adafruit_epd.ssd1680b import ( # pylint: disable=unused-import |
| 19 | + Adafruit_SSD1680B as Adafruit_SSD1680Z, |
| 20 | +) |
| 21 | + |
17 | 22 | try: |
18 | 23 | """Needed for type annotations""" |
19 | 24 | import typing # pylint: disable=unused-import |
@@ -211,77 +216,3 @@ def set_ram_address( |
211 | 216 | self.command(_SSD1680_SET_RAMXCOUNT, bytearray([x + 1])) |
212 | 217 | # Set RAM Y address counter |
213 | 218 | self.command(_SSD1680_SET_RAMYCOUNT, bytearray([y, y >> 8])) |
214 | | - |
215 | | - |
216 | | -class Adafruit_SSD1680Z(Adafruit_SSD1680): |
217 | | - """Driver for SSD1680Z ePaper display, overriding SSD1680 settings.""" |
218 | | - |
219 | | - # pylint: disable=too-many-arguments, useless-parent-delegation |
220 | | - def __init__( |
221 | | - self, width, height, spi, *, cs_pin, dc_pin, sramcs_pin, rst_pin, busy_pin |
222 | | - ): |
223 | | - # Call the parent class's __init__() to initialize attributes |
224 | | - super().__init__( |
225 | | - width, |
226 | | - height, |
227 | | - spi, |
228 | | - cs_pin=cs_pin, |
229 | | - dc_pin=dc_pin, |
230 | | - sramcs_pin=sramcs_pin, |
231 | | - rst_pin=rst_pin, |
232 | | - busy_pin=busy_pin, |
233 | | - ) |
234 | | - self.busy_pin = busy_pin # Ensure busy_pin is set |
235 | | - |
236 | | - # pylint: enable=too-many-arguments, useless-parent-delegation |
237 | | - |
238 | | - def power_up(self): |
239 | | - """Power up sequence specifically for SSD1680Z.""" |
240 | | - self.hardware_reset() |
241 | | - self.busy_wait() |
242 | | - self.command(_SSD1680_SW_RESET) |
243 | | - self.busy_wait() |
244 | | - |
245 | | - self.command( |
246 | | - _SSD1680_DRIVER_CONTROL, |
247 | | - bytearray([self._height, (self._height) >> 8, 0x00]), |
248 | | - ) |
249 | | - self.command(_SSD1680_DATA_MODE, bytearray([0x03])) |
250 | | - |
251 | | - # Set voltages |
252 | | - self.command(_SSD1680_WRITE_VCOM_REG, bytearray([0x36])) |
253 | | - self.command(_SSD1680_GATE_VOLTAGE, bytearray([0x17])) |
254 | | - self.command(_SSD1680_SOURCE_VOLTAGE, bytearray([0x41, 0x00, 0x32])) |
255 | | - |
256 | | - self.command(_SSD1680_SET_RAMXPOS, bytearray([0x00, (self._width // 8)])) |
257 | | - self.command( |
258 | | - _SSD1680_SET_RAMYPOS, |
259 | | - bytearray([0x00, 0x00, self._height, (self._height) >> 8]), |
260 | | - ) |
261 | | - |
262 | | - # Set border waveform |
263 | | - self.command(_SSD1680_WRITE_BORDER, bytearray([0x05])) |
264 | | - |
265 | | - # Set ram X count |
266 | | - self.command(_SSD1680_SET_RAMXCOUNT, bytearray([0x01])) |
267 | | - # Set ram Y count |
268 | | - self.command(_SSD1680_SET_RAMYCOUNT, bytearray([self._height, 0])) |
269 | | - self.busy_wait() |
270 | | - |
271 | | - def update(self): |
272 | | - """Update the display specifically for SSD1680Z.""" |
273 | | - self.command(_SSD1680_DISP_CTRL2, bytearray([0xF7])) # Full update for SSD1680Z |
274 | | - self.command(_SSD1680_MASTER_ACTIVATE) |
275 | | - self.busy_wait() |
276 | | - if not self.busy_pin: |
277 | | - time.sleep(3) # Wait for update to complete |
278 | | - |
279 | | - def set_ram_address( |
280 | | - self, x: int, y: int |
281 | | - ) -> None: # pylint: disable=unused-argument, no-self-use |
282 | | - """Set the RAM address location, not used on this chipset but required by |
283 | | - the superclass""" |
284 | | - # Set RAM X address counter |
285 | | - self.command(_SSD1680_SET_RAMXCOUNT, bytearray([x])) |
286 | | - # Set RAM Y address counter |
287 | | - self.command(_SSD1680_SET_RAMYCOUNT, bytearray([y, y >> 8])) |
0 commit comments