yambs.uf2
index
/home/vkottler/src/vkottler/workspace/yambs/yambs/uf2/__init__.py

A module implementing interfaces for USB Flashing Format (UF2).
 
See https://github.com/microsoft/uf2.

 
Package Contents
       

 
Classes
       
builtins.object
Block

 
class Block(builtins.object)
    Block(addr) -> None
 
A UF2 block.
 
  Methods defined here:
__init__(self, addr) -> None
Initialize this instance.
encode(self, blockno: int, numblocks: int) -> bytes
Encode a block.

Data descriptors defined here:
__dict__
dictionary for instance variables
__weakref__
list of weak references to the object

 
Functions
       
board_id(path, info_file: str = '/INFO_UF2.TXT') -> Optional[str]
Get the board identifier.
convert_from_hex_to_uf2(buf: str) -> bytes
Create uf2 bytes from hex data.
convert_from_uf2(buf: bytes) -> bytes
Convert a uf2-formatted file into a regular one.
convert_to_carray(file_content: bytes) -> bytes
Create a C snippet that declares an array equivalent to raw file data.
convert_to_uf2(file_content: bytes) -> bytes
Convert a file to uf2.
get_drives(info_file: str = '/INFO_UF2.TXT') -> List[str]
Get mountable drives.
is_hex(buf: bytes) -> bool
Determine if the provided buffer has a header that indicates it's Intel
HEX format.
is_uf2(buf: bytes) -> bool
Checks whether or not the provided buffer has the header magic bytes.
list_drives() -> None
Print drives.
load_families() -> Dict[str, int]
The expectation is that the `uf2families.json` file is in the same
directory as this script. Make a path that works using `__file__`
which contains the full path to this script.
to_str(data: bytes) -> str
Convert bytes to a string.
write_file(name: str, buf: bytes) -> None
Write the given buffer to a file with the given name.

 
Data
        APPSTARTADDR = 8192
ARBITER = <vcorelib.io.arbiter.DataArbiter object>
Dict = typing.Dict
FAMILYID = 0
INFO_FILE = '/INFO_UF2.TXT'
List = typing.List
Optional = typing.Optional
PKG_NAME = 'yambs'
UF2_MAGIC_END = 179400496
UF2_MAGIC_START0 = 171066965
UF2_MAGIC_START1 = 2656915799
__annotations__ = {'APPSTARTADDR': typing.Optional[int]}