@@ -87,7 +87,8 @@ def __init__(
87
87
height : int ,
88
88
* ,
89
89
external_vcc : bool ,
90
- reset : Optional [DigitalInOut ]
90
+ reset : Optional [DigitalInOut ],
91
+ col : Optional [int ] = None # Shortened argument name
91
92
):
92
93
super ().__init__ (buffer , width , height )
93
94
self .width = width
@@ -98,9 +99,10 @@ def __init__(
98
99
if self .reset_pin :
99
100
self .reset_pin .switch_to_output (value = False )
100
101
self .pages = self .height // 8
101
- self ._column_offset = 0
102
- if self .height == 32 :
103
- self ._column_offset = 4 # hardcoded for now...
102
+
103
+ # Set default column offset, allow override
104
+ self ._column_offset = col if col is not None else 4
105
+
104
106
# Note the subclass must initialize self.framebuf to a framebuffer.
105
107
# This is necessary because the underlying data buffer is different
106
108
# between I2C and SPI implementations (I2C needs an extra byte).
@@ -220,7 +222,8 @@ def __init__(
220
222
* ,
221
223
addr : int = 0x3C ,
222
224
external_vcc : bool = False ,
223
- reset : Optional [DigitalInOut ] = None
225
+ reset : Optional [DigitalInOut ] = None ,
226
+ col = None
224
227
):
225
228
self .i2c_device = i2c_device .I2CDevice (i2c , addr )
226
229
self .addr = addr
@@ -238,6 +241,7 @@ def __init__(
238
241
height ,
239
242
external_vcc = external_vcc ,
240
243
reset = reset ,
244
+ col = col , # <-- Forwarded col parameter to base class
241
245
)
242
246
243
247
def write_cmd (self , cmd : int ) -> None :
@@ -281,7 +285,8 @@ def __init__(
281
285
external_vcc : bool = False ,
282
286
baudrate : int = 8000000 ,
283
287
polarity : int = 0 ,
284
- phase : int = 0
288
+ phase : int = 0 ,
289
+ col = None
285
290
):
286
291
self .rate = 10 * 1024 * 1024
287
292
dc .switch_to_output (value = False )
@@ -296,6 +301,7 @@ def __init__(
296
301
height ,
297
302
external_vcc = external_vcc ,
298
303
reset = reset ,
304
+ col = col ,
299
305
)
300
306
301
307
def write_cmd (self , cmd : int ) -> None :
0 commit comments