File tree Expand file tree Collapse file tree 10 files changed +20
-20
lines changed Expand file tree Collapse file tree 10 files changed +20
-20
lines changed Original file line number Diff line number Diff line change 18
18
from typing import Any , Union , Callable , Optional
19
19
from busio import SPI
20
20
from digitalio import Direction , DigitalInOut
21
- from PIL . Image import Image
21
+ from circuitpython_typing . pil import Image
22
22
23
23
except ImportError :
24
24
pass
@@ -195,7 +195,7 @@ def command(
195
195
196
196
return ret
197
197
198
- def _spi_transfer (self , data : Union [int , bytearray ]) -> int :
198
+ def _spi_transfer (self , data : Union [int , bytearray ]) -> Optional [ int ] :
199
199
"""Transfer one byte or bytearray, toggling the cs pin if required by the EPD chipset"""
200
200
if isinstance (data , int ): # single byte!
201
201
self ._spibuf [0 ] = data
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"""Needed for type annotations"""
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -144,7 +144,7 @@ def update(self) -> None:
144
144
if not self ._busy :
145
145
time .sleep (15 ) # wait 15 seconds
146
146
147
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
147
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
148
148
"""Send the one byte command for starting the RAM write process. Returns
149
149
the byte read at the same time over SPI. index is the RAM buffer, can be
150
150
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"""Needed for type annotations"""
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -144,7 +144,7 @@ def update(self) -> None:
144
144
if not self ._busy :
145
145
time .sleep (15 ) # wait 15 seconds
146
146
147
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
147
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
148
148
"""Send the one byte command for starting the RAM write process. Returns
149
149
the byte read at the same time over SPI. index is the RAM buffer, can be
150
150
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"Needed for type annotations"
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -167,7 +167,7 @@ def update(self) -> None:
167
167
if not self ._busy :
168
168
time .sleep (16 ) # wait 16 seconds
169
169
170
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
170
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
171
171
"""Send the one byte command for starting the RAM write process. Returns
172
172
the byte read at the same time over SPI. index is the RAM buffer, can be
173
173
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"""Needed for type annotations"""
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -156,7 +156,7 @@ def update(self) -> None:
156
156
if not self ._busy :
157
157
time .sleep (3 ) # wait 3 seconds
158
158
159
- def write_ram (self , index : Union [0 ]) -> Any :
159
+ def write_ram (self , index : Union [0 ]) -> int :
160
160
"""Send the one byte command for starting the RAM write process. Returns
161
161
the byte read at the same time over SPI. index is the RAM buffer, can be
162
162
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"""Needed for type annotations"""
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -178,7 +178,7 @@ def update(self) -> None:
178
178
if not self ._busy :
179
179
time .sleep (3 ) # wait 3 seconds
180
180
181
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
181
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
182
182
"""Send the one byte command for starting the RAM write process. Returns
183
183
the byte read at the same time over SPI. index is the RAM buffer, can be
184
184
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"""Needed for type annotations"""
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -220,7 +220,7 @@ def update(self) -> None:
220
220
if not self ._busy :
221
221
time .sleep (3 ) # wait 3 seconds
222
222
223
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
223
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
224
224
"""Send the one byte command for starting the RAM write process. Returns
225
225
the byte read at the same time over SPI. index is the RAM buffer, can be
226
226
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"""Needed for type annotations"""
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -191,7 +191,7 @@ def update(self) -> None:
191
191
if not self ._busy :
192
192
time .sleep (3 ) # wait 3 seconds
193
193
194
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
194
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
195
195
"""Send the one byte command for starting the RAM write process. Returns
196
196
the byte read at the same time over SPI. index is the RAM buffer, can be
197
197
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 15
15
from adafruit_epd .epd import Adafruit_EPD
16
16
17
17
try :
18
- from typing import Union , Any
18
+ from typing import Union
19
19
from busio import SPI
20
20
from digitalio import DigitalInOut
21
21
@@ -173,7 +173,7 @@ def update(self) -> None:
173
173
if not self ._busy :
174
174
time .sleep (3 ) # wait 3 seconds
175
175
176
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
176
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
177
177
"""Send the one byte command for starting the RAM write process. Returns
178
178
the byte read at the same time over SPI. index is the RAM buffer, can be
179
179
0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 16
16
17
17
try :
18
18
"""Needed for type annotations"""
19
- from typing import Union , Any
19
+ from typing import Union
20
20
from busio import SPI
21
21
from digitalio import DigitalInOut
22
22
@@ -152,7 +152,7 @@ def update(self) -> None:
152
152
if not self ._busy :
153
153
time .sleep (15 ) # wait 15 seconds
154
154
155
- def write_ram (self , index : Union [0 , 1 ]) -> Any :
155
+ def write_ram (self , index : Union [0 , 1 ]) -> int :
156
156
"""Send the one byte command for starting the RAM write process. Returns
157
157
the byte read at the same time over SPI. index is the RAM buffer, can be
158
158
0 or 1 for tri-color displays."""
You can’t perform that action at this time.
0 commit comments