@@ -70,10 +70,8 @@ def __init__(
7070 sramcs_pin : DigitalInOut ,
7171 rst_pin : DigitalInOut ,
7272 busy_pin : DigitalInOut ,
73- pid : int = 0 , # Product ID, defaults to 0
7473 ) -> None :
7574 super ().__init__ (width , height , spi , cs_pin , dc_pin , sramcs_pin , rst_pin , busy_pin )
76- self .pid = pid
7775
7876 self ._buffer1_size = int (width * height / 8 )
7977 self ._buffer2_size = int (width * height / 8 )
@@ -116,29 +114,20 @@ def power_up(self) -> None:
116114 self .hardware_reset ()
117115 self .busy_wait ()
118116
119- if self .pid == 4243 : # Adafruit 2.13" HD Monochrome eInk Display - 212x104
120- self .command (_IL0373_BOOSTER_SOFT_START , bytearray ([0x17 , 0x17 , 0x17 ]))
121- self .command (_IL0373_POWER_ON )
122- self .busy_wait ()
123- time .sleep (0.2 )
124- self .command (_IL0373_PANEL_SETTING , bytearray ([0x1F , 0x0D ]))
125- self .command (_IL0373_CDI , bytearray ([0x97 ]))
126- else :
127- # Default IL0373 init sequence
128- self .command (_IL0373_POWER_SETTING , bytearray ([0x03 , 0x00 , 0x2B , 0x2B , 0x09 ]))
129- self .command (_IL0373_BOOSTER_SOFT_START , bytearray ([0x17 , 0x17 , 0x17 ]))
130- self .command (_IL0373_POWER_ON )
131- self .busy_wait ()
132- time .sleep (0.2 )
133- self .command (_IL0373_PANEL_SETTING , bytearray ([0xCF ]))
134- self .command (_IL0373_CDI , bytearray ([0x37 ]))
135- self .command (_IL0373_PLL , bytearray ([0x29 ]))
136- _b1 = self ._width & 0xFF
137- _b2 = (self ._height >> 8 ) & 0xFF
138- _b3 = self ._height & 0xFF
139- self .command (_IL0373_RESOLUTION , bytearray ([_b1 , _b2 , _b3 ]))
140- self .command (_IL0373_VCM_DC_SETTING , bytearray ([0x0A ]))
141- time .sleep (0.05 )
117+ self .command (_IL0373_POWER_SETTING , bytearray ([0x03 , 0x00 , 0x2B , 0x2B , 0x09 ]))
118+ self .command (_IL0373_BOOSTER_SOFT_START , bytearray ([0x17 , 0x17 , 0x17 ]))
119+ self .command (_IL0373_POWER_ON )
120+ self .busy_wait ()
121+ time .sleep (0.2 )
122+ self .command (_IL0373_PANEL_SETTING , bytearray ([0xCF ]))
123+ self .command (_IL0373_CDI , bytearray ([0x37 ]))
124+ self .command (_IL0373_PLL , bytearray ([0x29 ]))
125+ _b1 = self ._width & 0xFF
126+ _b2 = (self ._height >> 8 ) & 0xFF
127+ _b3 = self ._height & 0xFF
128+ self .command (_IL0373_RESOLUTION , bytearray ([_b1 , _b2 , _b3 ]))
129+ self .command (_IL0373_VCM_DC_SETTING , bytearray ([0x0A ]))
130+ time .sleep (0.05 )
142131
143132 def power_down (self ) -> None :
144133 """Power down the display - required when not actively displaying!"""
@@ -168,3 +157,47 @@ def set_ram_address(self, x: int, y: int) -> None: # noqa: PLR6301, F841
168157 """Set the RAM address location, not used on this chipset but required by
169158 the superclass"""
170159 return # on this chip it does nothing
160+
161+
162+ class Adafruit_IL0373_213_Flex_Mono (Adafruit_IL0373 ):
163+ """Driver for Adafruit 2.13" Flexible Monochrome 212x104"""
164+
165+ def __init__ (
166+ self ,
167+ width : int ,
168+ height : int ,
169+ spi : SPI ,
170+ * ,
171+ cs_pin : DigitalInOut ,
172+ dc_pin : DigitalInOut ,
173+ sramcs_pin : DigitalInOut ,
174+ rst_pin : DigitalInOut ,
175+ busy_pin : DigitalInOut ,
176+ ) -> None :
177+ super ().__init__ (
178+ width ,
179+ height ,
180+ spi ,
181+ cs_pin = cs_pin ,
182+ dc_pin = dc_pin ,
183+ sramcs_pin = sramcs_pin ,
184+ rst_pin = rst_pin ,
185+ busy_pin = busy_pin ,
186+ )
187+
188+ self .set_black_buffer (1 , True )
189+ self .set_color_buffer (0 , True )
190+
191+ def power_up (self ) -> None :
192+ """Power up the display in preparation for writing RAM and updating"""
193+ self .hardware_reset ()
194+ self .busy_wait ()
195+
196+ self .command (_IL0373_BOOSTER_SOFT_START , bytearray ([0x17 , 0x17 , 0x17 ]))
197+ self .command (_IL0373_POWER_ON )
198+
199+ self .busy_wait ()
200+ time .sleep (0.2 )
201+
202+ self .command (_IL0373_PANEL_SETTING , bytearray ([0x1F , 0x0D ]))
203+ self .command (_IL0373_CDI , bytearray ([0x97 ]))
0 commit comments