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 1818 from typing import Any , Union , Callable , Optional
1919 from busio import SPI
2020 from digitalio import Direction , DigitalInOut
21- from PIL . Image import Image
21+ from circuitpython_typing . pil import Image
2222
2323except ImportError :
2424 pass
@@ -195,7 +195,7 @@ def command(
195195
196196 return ret
197197
198- def _spi_transfer (self , data : Union [int , bytearray ]) -> int :
198+ def _spi_transfer (self , data : Union [int , bytearray ]) -> Optional [ int ] :
199199 """Transfer one byte or bytearray, toggling the cs pin if required by the EPD chipset"""
200200 if isinstance (data , int ): # single byte!
201201 self ._spibuf [0 ] = data
Original file line number Diff line number Diff line change 1616
1717try :
1818 """Needed for type annotations"""
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -144,7 +144,7 @@ def update(self) -> None:
144144 if not self ._busy :
145145 time .sleep (15 ) # wait 15 seconds
146146
147- def write_ram (self , index : Union [0 , 1 ]) -> Any :
147+ def write_ram (self , index : Union [0 , 1 ]) -> int :
148148 """Send the one byte command for starting the RAM write process. Returns
149149 the byte read at the same time over SPI. index is the RAM buffer, can be
150150 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1616
1717try :
1818 """Needed for type annotations"""
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -144,7 +144,7 @@ def update(self) -> None:
144144 if not self ._busy :
145145 time .sleep (15 ) # wait 15 seconds
146146
147- def write_ram (self , index : Union [0 , 1 ]) -> Any :
147+ def write_ram (self , index : Union [0 , 1 ]) -> int :
148148 """Send the one byte command for starting the RAM write process. Returns
149149 the byte read at the same time over SPI. index is the RAM buffer, can be
150150 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1616
1717try :
1818 "Needed for type annotations"
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -167,7 +167,7 @@ def update(self) -> None:
167167 if not self ._busy :
168168 time .sleep (16 ) # wait 16 seconds
169169
170- def write_ram (self , index : Union [0 , 1 ]) -> Any :
170+ def write_ram (self , index : Union [0 , 1 ]) -> int :
171171 """Send the one byte command for starting the RAM write process. Returns
172172 the byte read at the same time over SPI. index is the RAM buffer, can be
173173 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1616
1717try :
1818 """Needed for type annotations"""
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -156,7 +156,7 @@ def update(self) -> None:
156156 if not self ._busy :
157157 time .sleep (3 ) # wait 3 seconds
158158
159- def write_ram (self , index : Union [0 ]) -> Any :
159+ def write_ram (self , index : Union [0 ]) -> int :
160160 """Send the one byte command for starting the RAM write process. Returns
161161 the byte read at the same time over SPI. index is the RAM buffer, can be
162162 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1616
1717try :
1818 """Needed for type annotations"""
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -178,7 +178,7 @@ def update(self) -> None:
178178 if not self ._busy :
179179 time .sleep (3 ) # wait 3 seconds
180180
181- def write_ram (self , index : Union [0 , 1 ]) -> Any :
181+ def write_ram (self , index : Union [0 , 1 ]) -> int :
182182 """Send the one byte command for starting the RAM write process. Returns
183183 the byte read at the same time over SPI. index is the RAM buffer, can be
184184 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1616
1717try :
1818 """Needed for type annotations"""
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -220,7 +220,7 @@ def update(self) -> None:
220220 if not self ._busy :
221221 time .sleep (3 ) # wait 3 seconds
222222
223- def write_ram (self , index : Union [0 , 1 ]) -> Any :
223+ def write_ram (self , index : Union [0 , 1 ]) -> int :
224224 """Send the one byte command for starting the RAM write process. Returns
225225 the byte read at the same time over SPI. index is the RAM buffer, can be
226226 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1616
1717try :
1818 """Needed for type annotations"""
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -191,7 +191,7 @@ def update(self) -> None:
191191 if not self ._busy :
192192 time .sleep (3 ) # wait 3 seconds
193193
194- def write_ram (self , index : Union [0 , 1 ]) -> Any :
194+ def write_ram (self , index : Union [0 , 1 ]) -> int :
195195 """Send the one byte command for starting the RAM write process. Returns
196196 the byte read at the same time over SPI. index is the RAM buffer, can be
197197 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1515from adafruit_epd .epd import Adafruit_EPD
1616
1717try :
18- from typing import Union , Any
18+ from typing import Union
1919 from busio import SPI
2020 from digitalio import DigitalInOut
2121
@@ -173,7 +173,7 @@ def update(self) -> None:
173173 if not self ._busy :
174174 time .sleep (3 ) # wait 3 seconds
175175
176- def write_ram (self , index : Union [0 , 1 ]) -> Any :
176+ def write_ram (self , index : Union [0 , 1 ]) -> int :
177177 """Send the one byte command for starting the RAM write process. Returns
178178 the byte read at the same time over SPI. index is the RAM buffer, can be
179179 0 or 1 for tri-color displays."""
Original file line number Diff line number Diff line change 1616
1717try :
1818 """Needed for type annotations"""
19- from typing import Union , Any
19+ from typing import Union
2020 from busio import SPI
2121 from digitalio import DigitalInOut
2222
@@ -152,7 +152,7 @@ def update(self) -> None:
152152 if not self ._busy :
153153 time .sleep (15 ) # wait 15 seconds
154154
155- def write_ram (self , index : Union [0 , 1 ]) -> Any :
155+ def write_ram (self , index : Union [0 , 1 ]) -> int :
156156 """Send the one byte command for starting the RAM write process. Returns
157157 the byte read at the same time over SPI. index is the RAM buffer, can be
158158 0 or 1 for tri-color displays."""
You can’t perform that action at this time.
0 commit comments