@@ -153,7 +153,7 @@ def power_up(self) -> None:
153
153
# driver output control
154
154
self .command (
155
155
_SSD1680_DRIVER_CONTROL ,
156
- bytearray ([self ._height - 1 , (self ._height - 1 ) >> 8 , 0x00 ]),
156
+ bytearray ([( self ._height - 1 ) & 0xFF , (self ._height - 1 ) >> 8 , 0x00 ]),
157
157
)
158
158
# data entry mode
159
159
self .command (_SSD1680_DATA_MODE , bytearray ([0x03 ]))
@@ -163,20 +163,23 @@ def power_up(self) -> None:
163
163
self .command (_SSD1680_GATE_VOLTAGE , bytearray ([0x17 ]))
164
164
self .command (_SSD1680_SOURCE_VOLTAGE , bytearray ([0x41 , 0x00 , 0x32 ]))
165
165
166
+ height = self ._width
167
+ if height % 8 != 0 :
168
+ height += 8 - (height % 8 )
166
169
# Set ram X start/end postion
167
- self .command (_SSD1680_SET_RAMXPOS , bytearray ([0x01 , 0x10 ]))
170
+ self .command (_SSD1680_SET_RAMXPOS , bytearray ([0x00 , ( height // 8 ) - 1 ]))
168
171
# Set ram Y start/end postion
169
172
self .command (
170
173
_SSD1680_SET_RAMYPOS ,
171
- bytearray ([0 , 0 , self ._height - 1 , (self ._height - 1 ) >> 8 ]),
174
+ bytearray ([0x00 , 0x00 , ( self ._height - 1 ) & 0xFF , (self ._height - 1 ) >> 8 ]),
172
175
)
173
176
# Set border waveform
174
177
self .command (_SSD1680_WRITE_BORDER , bytearray ([0x05 ]))
175
178
176
179
# Set ram X count
177
- self .command (_SSD1680_SET_RAMXCOUNT , bytearray ([0x01 ]))
180
+ self .command (_SSD1680_SET_RAMXCOUNT , bytearray ([0x00 ]))
178
181
# Set ram Y count
179
- self .command (_SSD1680_SET_RAMYCOUNT , bytearray ([self . _height - 1 , 0 ]))
182
+ self .command (_SSD1680_SET_RAMYCOUNT , bytearray ([0x00 , 0x00 ]))
180
183
self .busy_wait ()
181
184
182
185
def power_down (self ) -> None :
@@ -206,9 +209,9 @@ def set_ram_address(self, x: int, y: int) -> None: # noqa: PLR6301, F841
206
209
"""Set the RAM address location, not used on this chipset but required by
207
210
the superclass"""
208
211
# Set RAM X address counter
209
- self .command (_SSD1680_SET_RAMXCOUNT , bytearray ([x + 1 ]))
212
+ self .command (_SSD1680_SET_RAMXCOUNT , bytearray ([0 ]))
210
213
# Set RAM Y address counter
211
- self .command (_SSD1680_SET_RAMYCOUNT , bytearray ([y , y >> 8 ]))
214
+ self .command (_SSD1680_SET_RAMYCOUNT , bytearray ([0 , 0 ]))
212
215
213
216
214
217
class Adafruit_SSD1680Z (Adafruit_SSD1680 ):
0 commit comments