squishy.core.device.SquishyHardwareDevice

Todo

Flesh this out

class squishy.core.device.SquishyHardwareDevice(dev: USBDevice, serial: str, timeout: int = 2500, **kwargs)

Squishy Hardware Device

This class represents and abstracted Squishy hardware device, exposing a common and stable API for applets to interact with the hardware on.

Parameters
  • dev (usb1.USBDevice) – The USB device handle for the hardware platform.

  • serial (str) – The serial number of the device.

Variables
  • serial (str) – The serial number of the device.

  • rev (int) – The revision of the hardware of the device.

can_dfu() bool

Check to see if the Device can DFU

classmethod get_device(serial: Optional[str] = None) Union[None, SquishyHardwareDevice]

Get attached Squishy device.

Get the attached and selected squishy device if possible, or if only one is attached to the system use that one.

Parameters

serial (str) – The serial number if any.

Returns

  • None – If no device is selected

  • squishy.core.device.SquishyHardwareDevice – The selected hardware if available.

classmethod enumerate() List[Tuple[str, float, USBDevice]]

Enumerate attached devices

Returns

The collection of SquishyDeviceContainer objects that match the enumeration critera.

Return type

List[Tuple[str, float, usb1.USBDevice]]

reset() bool

Reset the device

upload(data: bytearray, slot: int, progress: Optional[Progress] = None) bool

Push Firmware/Gateware to device

download(slot: int) Optional[bytearray]

Pull Firmware/Gateware from device (if supported)