32
32
from adafruit_epd .epd import Adafruit_EPD
33
33
from adafruit_epd .mcp_sram import Adafruit_MCP_SRAM
34
34
35
- IL0373_POWER_SETTING = const (0x01 )
36
- IL0373_PANEL_SETTING = const (0x00 )
37
- IL0373_POWER_OFF = const (0x02 )
38
- IL0373_POWER_OFF_SEQUENCE = const (0x03 )
39
- IL0373_POWER_ON = const (0x04 )
40
- IL0373_POWER_ON_MEASURE = const (0x05 )
41
- IL0373_BOOSTER_SOFT_START = const (0x06 )
42
- IL0373_DEEP_SLEEP = const (0x07 )
43
- IL0373_DTM1 = const (0x10 )
44
- IL0373_DATA_STOP = const (0x11 )
45
- IL0373_DISPLAY_REFRESH = const (0x12 )
46
- IL0373_DTM2 = const (0x13 )
47
- IL0373_PDTM1 = const (0x14 )
48
- IL0373_PDTM2 = const (0x15 )
49
- IL0373_PDRF = const (0x16 )
50
- IL0373_LUT1 = const (0x20 )
51
- IL0373_LUTWW = const (0x21 )
52
- IL0373_LUTBW = const (0x22 )
53
- IL0373_LUTWB = const (0x23 )
54
- IL0373_LUTBB = const (0x24 )
55
- IL0373_PLL = const (0x30 )
56
- IL0373_CDI = const (0x50 )
57
- IL0373_RESOLUTION = const (0x61 )
58
- IL0373_VCM_DC_SETTING = const (0x82 )
35
+ _IL0373_POWER_SETTING = const (0x01 )
36
+ _IL0373_PANEL_SETTING = const (0x00 )
37
+ _IL0373_POWER_OFF = const (0x02 )
38
+ _IL0373_POWER_OFF_SEQUENCE = const (0x03 )
39
+ _IL0373_POWER_ON = const (0x04 )
40
+ _IL0373_POWER_ON_MEASURE = const (0x05 )
41
+ _IL0373_BOOSTER_SOFT_START = const (0x06 )
42
+ _IL0373_DEEP_SLEEP = const (0x07 )
43
+ _IL0373_DTM1 = const (0x10 )
44
+ _IL0373_DATA_STOP = const (0x11 )
45
+ _IL0373_DISPLAY_REFRESH = const (0x12 )
46
+ _IL0373_DTM2 = const (0x13 )
47
+ _IL0373_PDTM1 = const (0x14 )
48
+ _IL0373_PDTM2 = const (0x15 )
49
+ _IL0373_PDRF = const (0x16 )
50
+ _IL0373_LUT1 = const (0x20 )
51
+ _IL0373_LUTWW = const (0x21 )
52
+ _IL0373_LUTBW = const (0x22 )
53
+ _IL0373_LUTWB = const (0x23 )
54
+ _IL0373_LUTBB = const (0x24 )
55
+ _IL0373_PLL = const (0x30 )
56
+ _IL0373_CDI = const (0x50 )
57
+ _IL0373_RESOLUTION = const (0x61 )
58
+ _IL0373_VCM_DC_SETTING = const (0x82 )
59
59
60
60
class Adafruit_IL0373 (Adafruit_EPD ):
61
61
"""driver class for Adafruit IL0373 ePaper display breakouts"""
@@ -77,27 +77,27 @@ def begin(self, reset=True):
77
77
while self ._busy .value is False :
78
78
pass
79
79
80
- self .command (IL0373_POWER_SETTING , bytearray ([0x03 , 0x00 , 0x2b , 0x2b , 0x09 ]))
81
- self .command (IL0373_BOOSTER_SOFT_START , bytearray ([0x17 , 0x17 , 0x17 ]))
80
+ self .command (_IL0373_POWER_SETTING , bytearray ([0x03 , 0x00 , 0x2b , 0x2b , 0x09 ]))
81
+ self .command (_IL0373_BOOSTER_SOFT_START , bytearray ([0x17 , 0x17 , 0x17 ]))
82
82
83
83
def update (self ):
84
84
"""update the display"""
85
- self .command (IL0373_DISPLAY_REFRESH )
85
+ self .command (_IL0373_DISPLAY_REFRESH )
86
86
87
87
if self ._busy :
88
88
while self ._busy .value is False :
89
89
pass
90
90
else :
91
91
time .sleep (15 ) # wait 15 seconds
92
92
93
- self .command (IL0373_CDI , bytearray ([0x17 ]))
94
- self .command (IL0373_VCM_DC_SETTING , bytearray ([0x00 ]))
95
- self .command (IL0373_POWER_OFF )
93
+ self .command (_IL0373_CDI , bytearray ([0x17 ]))
94
+ self .command (_IL0373_VCM_DC_SETTING , bytearray ([0x00 ]))
95
+ self .command (_IL0373_POWER_OFF )
96
96
time .sleep (2 )
97
97
98
98
def power_up (self ):
99
99
"""power up the display"""
100
- self .command (IL0373_POWER_ON )
100
+ self .command (_IL0373_POWER_ON )
101
101
102
102
if self ._busy :
103
103
while self ._busy .value is False :
@@ -106,15 +106,15 @@ def power_up(self):
106
106
time .sleep (3 ) # wait a bit
107
107
time .sleep (.2 )
108
108
109
- self .command (IL0373_PANEL_SETTING , bytearray ([0xCF ]))
110
- self .command (IL0373_CDI , bytearray ([0x37 ]))
111
- self .command (IL0373_PLL , bytearray ([0x29 ]))
109
+ self .command (_IL0373_PANEL_SETTING , bytearray ([0xCF ]))
110
+ self .command (_IL0373_CDI , bytearray ([0x37 ]))
111
+ self .command (_IL0373_PLL , bytearray ([0x29 ]))
112
112
_b1 = self .height & 0xFF
113
113
_b2 = (self .height >> 8 ) & 0xFF
114
114
_b3 = self .width & 0xFF
115
115
_b4 = (self .width >> 8 ) & 0xFF
116
- self .command (IL0373_RESOLUTION , bytearray ([_b1 , _b2 , _b3 , _b4 ]))
117
- self .command (IL0373_VCM_DC_SETTING , bytearray ([0x0A ]))
116
+ self .command (_IL0373_RESOLUTION , bytearray ([_b1 , _b2 , _b3 , _b4 ]))
117
+ self .command (_IL0373_VCM_DC_SETTING , bytearray ([0x0A ]))
118
118
119
119
120
120
def display (self ):
@@ -133,7 +133,7 @@ def display(self):
133
133
134
134
#first data byte from SRAM will be transfered in at the
135
135
#same time as the EPD command is transferred out
136
- cmd = self .command (IL0373_DTM1 , end = False )
136
+ cmd = self .command (_IL0373_DTM1 , end = False )
137
137
138
138
while not self .spi_device .try_lock ():
139
139
pass
@@ -157,7 +157,7 @@ def display(self):
157
157
158
158
#first data byte from SRAM will be transfered in at the
159
159
#same time as the EPD command is transferred out
160
- cmd = self .command (IL0373_DTM2 , end = False )
160
+ cmd = self .command (_IL0373_DTM2 , end = False )
161
161
162
162
while not self .spi_device .try_lock ():
163
163
pass
@@ -171,7 +171,7 @@ def display(self):
171
171
self .sram .cs_pin .value = True
172
172
self .spi_device .unlock ()
173
173
else :
174
- cmd = self .command (IL0373_DTM1 , end = False )
174
+ cmd = self .command (_IL0373_DTM1 , end = False )
175
175
while not self .spi_device .try_lock ():
176
176
pass
177
177
self ._dc .value = True
@@ -181,7 +181,7 @@ def display(self):
181
181
182
182
time .sleep (.02 )
183
183
184
- cmd = self .command (IL0373_DTM2 , end = False )
184
+ cmd = self .command (_IL0373_DTM2 , end = False )
185
185
while not self .spi_device .try_lock ():
186
186
pass
187
187
self ._dc .value = True
0 commit comments