API Reference

A python wrapper for tycmd.

tycmd.identify(filename: Path | str) list[str]

Identify models compatible with firmware.

Parameters

filenamePath | str

Path to the firmware file.

Returns

list[str]

List of models compatible with firmware.

tycmd.list_boards() list[dict]

List available boards.

Returns

list[dict]

List of available devices.

tycmd.reset(port: str | None = None, serial: str | None = None, bootloader: bool = False, log_level: int = 20) None

Reset board. Status messages are logged.

Parameters

portstr, optional

Port of targeted board.

serialstr, optional

Serial number of targeted board.

bootloaderbool, optional

Switch board to bootloader if True. Default is False.

log_levelint, optional

Log level. Defaults to INFO.

tycmd.upload(filename: Path | str, port: str | None = None, serial: str | None = None, check: bool = True, reset_board: bool = True, rtc_mode: Literal['local', 'utc', 'none'] = 'local', log_level: int = 20)

Upload firmware to board. Status messages are logged.

Parameters

filenamePath | str

Path to the firmware file.

portstr, optional

Port of targeted board.

serialstr, optional

Serial number of targeted board.

checkbool, optional

Check if board is compatible before upload. Defaults to True.

reset_boardbool, optional

Reset the device once the upload is finished. Defaults to True.

rtc_modestr, optional

Set RTC if supported: ‘local’ (default), ‘utc’ or ‘none’.

log_levelint, optional

Log level. Defaults to INFO.

tycmd.version() str

Return version information from tycmd binary.

Returns

str

The version of tycmd.

Raises

RuntimeError

If the version string could not be determined.