embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

Module types

Module types 

Source
Expand description

USB Test & Measurement Class (USBTMC) and USB488 types, headers, and constants.

Structs§

Capabilities
Device and interface capabilities (USBTMC 1.0 Table 37 & USB488 Table 8).
DevDepMsgInHeader
12-byte header for a DEV_DEP_MSG_IN response (sent by device on Bulk-IN).
DevDepMsgOutHeader
12-byte header for a DEV_DEP_MSG_OUT message (sent by host on Bulk-OUT).
MsgHeader
Base 4-byte header common to all USBTMC bulk messages.
ReceivedMessage
A received message from the host.
RequestDevDepMsgInHeader
12-byte header for a REQUEST_DEV_DEP_MSG_IN request (sent by host on Bulk-OUT).

Enums§

UsbtmcError
Errors that can occur during USBTMC communication.
UsbtmcEvent
An event received on the Bulk-OUT endpoint.
UsbtmcStatus
USBTMC status codes returned in control responses (USBTMC 1.0 Table 18 & USB488 Table 12).

Constants§

MSG_ID_DEV_DEP_MSG_IN
Device sends a device-dependent message to the host (Bulk-IN).
MSG_ID_DEV_DEP_MSG_OUT
Host sends a device-dependent command message to the device (Bulk-OUT).
MSG_ID_REQUEST_DEV_DEP_MSG_IN
Host requests a device-dependent message from the device (Bulk-OUT).
MSG_ID_REQUEST_VENDOR_SPECIFIC_IN
Host requests a vendor-specific message from device (Bulk-OUT).
MSG_ID_TRIGGER
USB488 Trigger message (Bulk-OUT).
MSG_ID_VENDOR_SPECIFIC_IN
Vendor-specific message from device to host (Bulk-IN).
MSG_ID_VENDOR_SPECIFIC_OUT
Vendor-specific message from host to device (Bulk-OUT).
REQ_CHECK_ABORT_BULK_IN_STATUS
Check status of aborting Bulk-IN transfer.
REQ_CHECK_ABORT_BULK_OUT_STATUS
Check status of aborting Bulk-OUT transfer.
REQ_CHECK_CLEAR_STATUS
Check status of clear operation.
REQ_GET_CAPABILITIES
Get USBTMC and USB488 capabilities (24 bytes).
REQ_INDICATOR_PULSE
Optional indicator pulse (e.g. to blink an LED or identify instrument).
REQ_INITIATE_ABORT_BULK_IN
Abort a Bulk-IN transfer.
REQ_INITIATE_ABORT_BULK_OUT
Abort a Bulk-OUT transfer.
REQ_INITIATE_CLEAR
Clear device input/output buffers and halt Bulk-OUT endpoint.
REQ_USB488_GO_TO_LOCAL
Go to Local control.
REQ_USB488_LOCAL_LOCKOUT
Local Lockout control.
REQ_USB488_READ_STATUS_BYTE
Read IEEE 488.2 status byte (*STB).
REQ_USB488_REN_CONTROL
Remote Enable control.
USB488_BNOTIFY1_SRQ
USB488 Service Request (SRQ) notification sent on Interrupt-IN.
USB_CLASS_APPL_SPEC
USB class code for Application Specific Class (used by USBTMC).
USB_PROTOCOL_USB488
USB protocol code for USB488 (USBTMC with IEEE 488.2 / SCPI extensions).
USB_PROTOCOL_USBTMC
USB protocol code for standard USBTMC.
USB_SUBCLASS_TEST_MEASUREMENT
USB subclass code for USB Test and Measurement Class.

Functions§

padding_bytes
Calculates the number of padding bytes (0..3) required to align len to a 4-byte boundary.