stoner_measurement.instruments.transport.ftdi_d2xx_transport.FtdiD2xxTransport

class stoner_measurement.instruments.transport.ftdi_d2xx_transport.FtdiD2xxTransport(device: int | str = 0, *, dll_path: str | Path | None = None, timeout: float = 2.0, write_timeout: float = 2.0)[source]

Bases: BaseTransport

Access an FTDI device directly through the native D2XX library.

Parameters:

device (int | str) – Zero-based device index, or FTDI serial number.

Keyword Parameters:
  • dll_path (str | Path | None) – Explicit path to ftd2xx.dll. When omitted the platform loader searches its normal locations.

  • timeout (float) – Read timeout in seconds.

  • write_timeout (float) – Write timeout in seconds.

close() → None[source]

Close the selected FTDI device.

flush() → None[source]

Purge both native D2XX receive and transmit queues.

open() → None[source]

Load D2XX and open the selected FTDI device.

read(num_bytes: int | None = None) → bytes[source]

Read up to the requested fixed frame size before the timeout.

property transport_address: str

Return a stable D2XX resource identifier.

write(data: bytes, slow: int | None = None) → int[source]

Write data exactly as supplied, without a terminator.