@@ -70,8 +70,10 @@ def __init__(
7070 sramcs_pin : DigitalInOut ,
7171 rst_pin : DigitalInOut ,
7272 busy_pin : DigitalInOut ,
73+ pid : int = 0 , # Product ID, defaults to 0
7374 ) -> None :
7475 super ().__init__ (width , height , spi , cs_pin , dc_pin , sramcs_pin , rst_pin , busy_pin )
76+ self .pid = pid
7577
7678 self ._buffer1_size = int (width * height / 8 )
7779 self ._buffer2_size = int (width * height / 8 )
@@ -114,22 +116,29 @@ def power_up(self) -> None:
114116 self .hardware_reset ()
115117 self .busy_wait ()
116118
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-
121- self .busy_wait ()
122- time .sleep (0.2 )
123-
124- self .command (_IL0373_PANEL_SETTING , bytearray ([0xCF ]))
125- self .command (_IL0373_CDI , bytearray ([0x37 ]))
126- self .command (_IL0373_PLL , bytearray ([0x29 ]))
127- _b1 = self ._width & 0xFF
128- _b2 = (self ._height >> 8 ) & 0xFF
129- _b3 = self ._height & 0xFF
130- self .command (_IL0373_RESOLUTION , bytearray ([_b1 , _b2 , _b3 ]))
131- self .command (_IL0373_VCM_DC_SETTING , bytearray ([0x0A ]))
132- time .sleep (0.05 )
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 )
133142
134143 def power_down (self ) -> None :
135144 """Power down the display - required when not actively displaying!"""
0 commit comments