-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b78572
commit a55974c
Showing
16 changed files
with
122 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
from typing import Optional | ||
|
||
class Curve: | ||
order: Optional[int] | ||
|
||
NIST256p = Curve() | ||
|
||
class SigningKey: | ||
@classmethod | ||
def generate(cls, curve: Curve) -> "SigningKey": ... | ||
@classmethod | ||
def from_secret_exponent(cls, secexp: int, curve: Curve) -> "SigningKey": ... | ||
@classmethod | ||
def from_string(cls, string: bytes, curve: Curve) -> "SigningKey": ... | ||
@classmethod | ||
def from_pem(cls, string: str) -> "SigningKey": ... | ||
def to_pem(self) -> bytes: ... | ||
def get_verifying_key(self) -> "VerifyingKey": ... | ||
def sign_digest(self, digest: bytes) -> bytes: ... | ||
|
||
class VerifyingKey: | ||
def to_string(self) -> bytes: ... | ||
def to_pem(self) -> bytes: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from array import array | ||
from typing import BinaryIO, Literal, Optional, Sequence, TextIO, Tuple, Union, overload | ||
|
||
from click import File | ||
|
||
class IntelHex: | ||
def __init__(self, source: Optional[str] = None) -> None: ... | ||
@overload | ||
def fromfile(self, fobj: Union[str, TextIO], format: Literal["hex"]) -> None: ... | ||
@overload | ||
def fromfile(self, fobj: Union[str, BinaryIO], format: Literal["bin"]) -> None: ... | ||
|
||
loadfile = fromfile | ||
|
||
@overload | ||
def tofile(self, fobj: Union[str, TextIO], format: Literal["hex"]) -> None: ... | ||
@overload | ||
def tofile(self, fobj: Union[str, BinaryIO], format: Literal["bin"]) -> None: ... | ||
def merge(self, other: "IntelHex", overlap: str = "error") -> None: ... | ||
def tobinarray( | ||
self, start: Optional[int] = None, size: Optional[int] = None | ||
) -> array[int]: ... | ||
def segments(self) -> Sequence[Tuple[int, int]]: ... | ||
def minaddr(self) -> int: ... | ||
def write_hex_file(self, f: Union[str, TextIO, File]) -> None: ... | ||
@overload | ||
def __getitem__(self, addr: int) -> int: ... | ||
@overload | ||
def __getitem__(self, addr: slice) -> "IntelHex": ... | ||
def __setitem__(self, addr16: int, word: int) -> None: ... |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
from array import array | ||
from typing import Literal | ||
|
||
from usb1 import USBDeviceHandle | ||
|
||
class DFUBadSate(Exception): ... | ||
|
||
class DFU: | ||
def __init__(self, handle: USBDeviceHandle) -> None: ... | ||
def download(self, data: array[int]) -> Literal["Finished"]: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from typing import Optional | ||
|
||
class SerialException(IOError): ... | ||
|
||
class Serial: | ||
def __init__( | ||
self, | ||
port: Optional[str] = None, | ||
baudrate: int = 9600, | ||
timeout: Optional[float] = None, | ||
) -> None: ... | ||
def read(self, size: int) -> bytes: ... | ||
def close(self) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class Entry: | ||
def __init__(self, type_id: int, data: object) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from .core import USBError as USBError | ||
|
||
class Device: | ||
filename: str | ||
|
||
def open(self) -> "DeviceHandle": ... | ||
|
||
class DeviceHandle: | ||
def getString(self, index: int, length: int) -> bytes: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
class USBError(IOError): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from typing import Any, Optional | ||
|
||
class USBContext: | ||
def __enter__(self) -> "USBContext": ... | ||
def __exit__(self, exc_type: Any, exc_val: Any, exc_tb: Any) -> None: ... | ||
def getDeviceList(self) -> list["USBDevice"]: ... | ||
def getByVendorIDAndProductID( | ||
self, vendor_id: int, product_id: int | ||
) -> Optional["USBDevice"]: ... | ||
|
||
class USBDevice: | ||
def getVendorID(self) -> int: ... | ||
def getProductID(self) -> int: ... | ||
def open(self) -> "USBDeviceHandle": ... | ||
|
||
class USBDeviceHandle: ... |