@@ -211,3 +211,52 @@ def set_ram_address(
211211 self .command (_SSD1680_SET_RAMXCOUNT , bytearray ([x + 1 ]))
212212 # Set RAM Y address counter
213213 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 - 1 , (self ._height - 1 ) >> 8 , 0x00 ]),
248+ )
249+ self .command (_SSD1680_DATA_MODE , bytearray ([0x03 ]))
250+ self .command (_SSD1680_SET_RAMXPOS , bytearray ([0x00 , (self ._width // 8 ) - 1 ]))
251+ self .command (
252+ _SSD1680_SET_RAMYPOS ,
253+ bytearray ([0x00 , 0x00 , self ._height - 1 , (self ._height - 1 ) >> 8 ]),
254+ )
255+
256+ def update (self ):
257+ """Update the display specifically for SSD1680Z."""
258+ self .command (_SSD1680_DISP_CTRL2 , bytearray ([0xF7 ])) # Full update for SSD1680Z
259+ self .command (_SSD1680_MASTER_ACTIVATE )
260+ self .busy_wait ()
261+ if not self .busy_pin :
262+ time .sleep (3 ) # Wait for update to complete
0 commit comments