Skip to main content

Crate viva_u3v

Crate viva_u3v 

Source
Expand description

USB3 Vision transport layer.

Provides device discovery, GenCP-over-USB control, bootstrap register parsing, and bulk-endpoint streaming for USB3 Vision cameras.

The usb feature flag enables actual USB hardware access via nusb, a pure-Rust USB library (ADR-0032). Without it, only protocol types, encoding, and mock-based testing compile.

The modules are private; what is public is re-exported here (ADR-0030). registers is the one public namespace: the bootstrap register maps, the vocabulary the fake camera shares.

Modules§

registers
The bootstrap register maps, by offset: the ABRM, the SBRM and the SIRM, with their capability bits (USB3 Vision 1.0; GenCP 1.2 for the ABRM).

Structs§

Abrm
Technology Agnostic Bootstrap Register Map — GenCP’s registers at address 0.
Completion
A transfer BulkIn::wait_next hands back.
ControlChannel
GenCP control channel over a USB3 Vision bulk endpoint pair.
Eirm
What the device says about its event interface.
Leader
Parsed U3V stream leader.
ManifestEntry
One entry of the device’s Manifest Table: a GenICam file in its memory.
MockUsbTransfer
In-memory mock of UsbTransfer for unit tests.
NusbTransfer
UsbTransfer over a USB3 Vision device opened with nusb: its control interface claimed, and its streaming and event interfaces when it has them.
RawFrame
A block as received from the U3V stream, before conversion to the transport-agnostic Frame type.
Sbrm
USB3 Vision’s technology-specific Bootstrap Register Map.
Sirm
What the device says about one stream channel.
StreamLayout
How the host reads one block: the sizes it writes to the SIRM, and reads with.
Trailer
Parsed U3V stream trailer.
U3vDevice
High-level handle for a USB3 Vision device.
U3vDeviceInfo
Information about a discovered USB3 Vision device.
U3vEvent
One event a USB3 Vision device sent.
U3vEventStream
The events a device sends, read from its event endpoint with a few event commands’ transfers queued.
U3vInterfaceInfo
Information about a USB3 Vision device’s interfaces and endpoints, extracted from USB descriptors.
U3vStream
U3V stream receiver: reads blocks from a USB bulk endpoint, with several transfers queued on it.
U3vStreamCounters
What a stream has counted since it was opened.
U3vStreamOptions
How a stream reads: the payload size to use when the device does not say, and the transfers it keeps queued.

Enums§

FileFormat
How a manifest file is stored (Schema / Filetype / Fileformat bits 10-15).
U3vError
Errors produced by the USB3 Vision transport layer.
U3vStatus
A USB3 Vision acknowledgement’s status.
UsbSpeed
The bus speed a device runs at: the SBRM’s current speed register, as the Grasshopper3’s XML decodes it, or the speed the host reports.

Constants§

DEFAULT_MAX_TRANSFER_SIZE
Largest single payload transfer the host asks for: aravis’s default (ARV_UV_STREAM_MAXIMUM_TRANSFER_SIZE_DEFAULT, 1 MiB).
DEFAULT_TRANSFERS_IN_FLIGHT
Transfers a stream keeps queued: aravis’s eight (ARV_UV_STREAM_N_MAXIMUM_SUBMITS).
PAYLOAD_TYPE_CHUNK
Payload type of chunk data alone.
PAYLOAD_TYPE_IMAGE
Payload type of an image (ARV_UVSP_PAYLOAD_TYPE_IMAGE).
PAYLOAD_TYPE_IMAGE_EXTENDED_CHUNK
Payload type of an image followed by chunk data.

Traits§

BulkIn
A bulk IN endpoint’s queue of transfers: submitted in order, completed in order (USB bulk transfers on one endpoint complete in the order they were queued).
UsbTransfer
Abstraction over a claimed USB device for bulk endpoint I/O.

Functions§

discover
Enumerate all USB3 Vision devices currently connected to the system.
parse_chunks
The chunks of a USB3 Vision chunk payload, as (chunk ID, offset, length) in payload order.
parse_event_command
The events in one event command.
parse_leader
Parse a U3V stream leader from raw bytes.
parse_trailer
Parse a U3V stream trailer from raw bytes.