33
33
__repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_AVRprog.git"
34
34
35
35
try :
36
- from typing import Any , Dict , List , Optional , Tuple , Union , TypedDict
36
+ from typing import List , Optional , Tuple , Union , TypedDict
37
37
from typing_extensions import TypeAlias
38
38
from os import PathLike
39
39
from busio import SPI
@@ -57,7 +57,7 @@ class ChipDictionary(TypedDict):
57
57
sig : List [int ]
58
58
flash_size : int
59
59
page_size : int
60
- fuse_mask : Tuple [int ]
60
+ fuse_mask : Tuple [int , int , int , int ]
61
61
62
62
class FileState (TypedDict ):
63
63
"""
@@ -159,7 +159,7 @@ def verify_sig(self, chip: ChipDictionary, verbose: bool = False) -> bool:
159
159
# pylint: disable=too-many-branches
160
160
def program_file (
161
161
self ,
162
- chip : Dict [ str , Any ] ,
162
+ chip : ChipDictionary ,
163
163
file_name : FileDescriptorOrPath ,
164
164
verbose : bool = False ,
165
165
verify : bool = True ,
@@ -231,7 +231,7 @@ def program_file(
231
231
232
232
def verify_file (
233
233
self ,
234
- chip : Dict [ str , Any ] ,
234
+ chip : ChipDictionary ,
235
235
file_name : FileDescriptorOrPath ,
236
236
verbose : bool = False ,
237
237
) -> bool :
@@ -279,7 +279,7 @@ def verify_file(
279
279
self .end ()
280
280
return True
281
281
282
- def read_fuses (self , chip : Dict [ str , Any ] ) -> Tuple [int , int , int , int ]:
282
+ def read_fuses (self , chip : ChipDictionary ) -> Tuple [int , int , int , int ]:
283
283
"""
284
284
Read the 4 fuses and return them in a tuple (low, high, ext, lock)
285
285
Each fuse is bitwise-&'s with the chip's fuse mask for simplicity
@@ -296,7 +296,7 @@ def read_fuses(self, chip: Dict[str, Any]) -> Tuple[int, int, int, int]:
296
296
# pylint: disable=unused-argument,too-many-arguments
297
297
def write_fuses (
298
298
self ,
299
- chip : Dict [ str , Any ] ,
299
+ chip : ChipDictionary ,
300
300
low : Optional [int ] = None ,
301
301
high : Optional [int ] = None ,
302
302
ext : Optional [int ] = None ,
@@ -318,7 +318,7 @@ def write_fuses(
318
318
# pylint: disable=too-many-arguments
319
319
def verify_fuses (
320
320
self ,
321
- chip : Dict [ str , Any ] ,
321
+ chip : ChipDictionary ,
322
322
low : Optional [int ] = None ,
323
323
high : Optional [int ] = None ,
324
324
ext : Optional [int ] = None ,
@@ -439,7 +439,7 @@ def _busy_wait(self) -> None:
439
439
440
440
441
441
def read_hex_page (
442
- file_state : Dict [ str , Any ] , page_addr : int , page_size : int , page_buffer : bytearray
442
+ file_state : FileState , page_addr : int , page_size : int , page_buffer : bytearray
443
443
) -> bool :
444
444
# pylint: disable=too-many-branches
445
445
"""
0 commit comments