59
59
b"\x50 \x01 \x37 " # CDI setting
60
60
b"\x30 \x01 \x29 " # PLL set to 150 Hz
61
61
b"\x61 \x03 \x00 \x00 \x00 " # Resolution
62
- b"\x82 \x81 \x32 \x0a " # VCM DC and delay 50ms
62
+ b"\x82 \x81 \x12 \x32 " # VCM DC and delay 50ms
63
63
)
64
64
65
- _GRAYSCALE_LUT = (
65
+ _GRAYSCALE_START_SEQUENCE = (
66
+ b"\x01 \x05 \x03 \x00 \x2b \x2b \x13 " # power setting
67
+ b"\x06 \x03 \x17 \x17 \x17 " # booster soft start
68
+ b"\x04 \x80 \xc8 " # power on and wait 200 ms
69
+ b"\x00 \x01 \x2f " # panel setting. Further filled in below.
70
+ b"\x50 \x01 \x97 " # CDI setting
71
+ b"\x30 \x01 \x3C " # PLL set to 50 Hz (M = 7, N = 4)
72
+ b"\x61 \x03 \x00 \x00 \x00 " # Resolution
73
+ b"\x82 \x81 \x12 \x32 " # VCM DC and delay 50ms
66
74
# Common voltage
67
75
b"\x20 \x2a "
68
76
b"\x00 \x0A \x00 \x00 \x00 \x01 "
112
120
113
121
_STOP_SEQUENCE = (
114
122
b"\x50 \x01 \x17 " # CDI setting
115
- b"\x82 \x01 \x00 " # VCM DC and delay 50ms
123
+ b"\x82 \x01 \x00 " # VCM DC to -0.10 V
116
124
b"\x02 \x00 " # Power off
117
125
)
118
126
# pylint: disable=too-few-public-methods
@@ -139,9 +147,7 @@ class IL0373(displayio.EPaperDisplay):
139
147
140
148
def __init__ (self , bus , swap_rams = False , ** kwargs ):
141
149
if kwargs .get ("grayscale" , False ):
142
- start_sequence = bytearray (len (_START_SEQUENCE ) + len (_GRAYSCALE_LUT ))
143
- start_sequence [: len (_START_SEQUENCE )] = _START_SEQUENCE
144
- start_sequence [len (_START_SEQUENCE ) :] = _GRAYSCALE_LUT
150
+ start_sequence = bytearray (_GRAYSCALE_START_SEQUENCE )
145
151
else :
146
152
start_sequence = bytearray (_START_SEQUENCE )
147
153
@@ -164,12 +170,6 @@ def __init__(self, bus, swap_rams=False, **kwargs):
164
170
black_bits_inverted = kwargs .pop ("black_bits_inverted" , False )
165
171
if "highlight_color" not in kwargs :
166
172
start_sequence [17 ] |= 1 << 4 # Set BWR to only do black and white.
167
- if kwargs .get ("grayscale" , False ):
168
- start_sequence [17 ] |= (
169
- 1 << 5
170
- ) # Set REG_EN to use the LUT sequence from the registers.
171
- start_sequence [6 ] = 0x13 # Boost the voltage
172
- start_sequence [23 ] = 0x3C # PLL set to 50 Hz (M = 7, N = 4)
173
173
174
174
# Set the resolution to scan
175
175
if width > 128 :
0 commit comments