Skip to content

Commit 25d0186

Browse files
authored
Merge pull request #98 from adafruit/il0373_update
update il0373 for 2.13 flex
2 parents a48c337 + afd64a9 commit 25d0186

File tree

2 files changed

+46
-3
lines changed

2 files changed

+46
-3
lines changed

adafruit_epd/il0373.py

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,8 @@ def power_up(self) -> None:
117117
self.command(_IL0373_POWER_SETTING, bytearray([0x03, 0x00, 0x2B, 0x2B, 0x09]))
118118
self.command(_IL0373_BOOSTER_SOFT_START, bytearray([0x17, 0x17, 0x17]))
119119
self.command(_IL0373_POWER_ON)
120-
121120
self.busy_wait()
122121
time.sleep(0.2)
123-
124122
self.command(_IL0373_PANEL_SETTING, bytearray([0xCF]))
125123
self.command(_IL0373_CDI, bytearray([0x37]))
126124
self.command(_IL0373_PLL, bytearray([0x29]))
@@ -159,3 +157,47 @@ def set_ram_address(self, x: int, y: int) -> None: # noqa: PLR6301, F841
159157
"""Set the RAM address location, not used on this chipset but required by
160158
the superclass"""
161159
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]))

examples/epd_simpletest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
from adafruit_epd.ek79686 import Adafruit_EK79686
99
from adafruit_epd.epd import Adafruit_EPD
10-
from adafruit_epd.il0373 import Adafruit_IL0373
10+
from adafruit_epd.il0373 import Adafruit_IL0373, Adafruit_IL0373_213_Flex_Mono
1111
from adafruit_epd.il0398 import Adafruit_IL0398
1212
from adafruit_epd.il91874 import Adafruit_IL91874
1313
from adafruit_epd.jd79661 import Adafruit_JD79661
@@ -42,6 +42,7 @@
4242
# display = Adafruit_UC8179(648, 480, # 5.83" mono 648x480 display
4343
# display = Adafruit_UC8179(800, 480, # 7.5" mono 800x480 display
4444
# display = Adafruit_IL0373(128, 296, # 2.9" Tri-color display IL0373
45+
# display = Adafruit_IL0373_213_Flex_Mono(104, 212,# 2.13" mono flex display
4546
# display = Adafruit_SSD1680(128, 296, # 2.9" Tri-color display SSD1680
4647
# display = Adafruit_SSD1683(400, 300, # 4.2" 300x400 Tri-Color display
4748
# display = Adafruit_IL0398(400, 300, # 4.2" Tri-color display

0 commit comments

Comments
 (0)