Google is committed to advancing racial equity for Black communities. See how.

fuchsia.hardware.usb

PROTOCOLS

Usb

Defined in fuchsia.hardware.usb/usb.fidl

CancelAll

Cancels all transactions currently queued on the specified endpoint.

Request

NameType
ep_address uint8

Response

NameType
s zx/status

ControlIn

Request

NameType
request_type uint8
request uint8
value uint16
index uint16
timeout zx/time

Response

NameType
status zx/status
read vector<uint8>

ControlOut

Request

NameType
request_type uint8
request uint8
value uint16
index uint16
timeout zx/time
write vector<uint8>

Response

NameType
status zx/status

EnableEndpoint

Enables a USB endpoint, configuring it as specified by the provided descriptors.

Request

NameType
ep_desc fuchsia.hardware.usb.descriptor/UsbEndpointDescriptor
ss_com_desc fuchsia.hardware.usb.descriptor/UsbSsEpCompDescriptor
enable bool

Response

NameType
s zx/status

GetConfiguration

Returns the currently selected configuration for the device.

Request

NameType

Response

NameType
configuration uint8

GetConfigurationDescriptor

Returns the configuration descriptor for the specified configuration.

Request

NameType
configuration uint8

Response

NameType
s zx/status
desc vector<uint8>

GetConfigurationDescriptorLength

Returns the length of the configuration descriptor for the specified configuration.

Request

NameType
configuration uint8

Response

NameType
s zx/status
length uint64

GetCurrentFrame

Returns the current frame (in milliseconds), used for isochronous transfers.

Request

NameType

Response

NameType
frame uint64

GetDescriptors

returns the USB descriptors for the USB device or interface.

Request

NameType

Response

NameType
descs vector<uint8>

GetDescriptorsLength

Returns the length of the USB descriptors for the USB device or interface.

Request

NameType

Response

NameType
length uint64

GetDeviceDescriptor

Returns the device's device descriptor.

Request

NameType

Response

NameType
desc fuchsia.hardware.usb.descriptor/UsbDeviceDescriptor

GetDeviceId

Returns the device ID for the device. This ID is generated by and used internally by the USB HCI controller driver.

Request

NameType

Response

NameType
dev_id uint32

GetMaxTransferSize

Returns the maximum amount of data that can be transferred on an endpoint in a single transaction.

Request

NameType
ep_address uint8

Response

NameType
s uint64

GetRequestSize

Returns the size needed for a |usb_request_t|, including private storage needed by all layers of the USB stack.

Request

NameType

Response

NameType
size uint64

GetSpeed

Returns the speed of the device.

Request

NameType

Response

NameType
s fuchsia.hardware.usb.descriptor/UsbSpeed

GetStringDescriptor

Fetch the descriptor using the provided descriptor ID and language ID. If the language ID requested is not available, the first entry of the language ID table will be used instead and be provided in the updated version of the parameter.

The string will be encoded using UTF-8, and will be truncated to fit the space provided by the buflen parameter. buflen will be updated to indicate the amount of space needed to hold the actual UTF-8 encoded string lenth, and may be larger than the original value passed. Embedded nulls may be present in the string, and the result may not be null terminated if the string occupies the entire provided buffer.

Request

NameType
desc_id uint8
lang_id uint16

Response

NameType
s zx/status
lang_id uint16
string vector<uint8>

RequestQueue

Queues a USB request.

Request

NameType
usb_request fuchsia.hardware.usb.request/UsbRequest
complete_cb fuchsia.hardware.usb.request/UsbRequestCompleteCallback

Response

NameType

ResetDevice

Resets the device and restores the prior configuration. Returns ZX_ERR_BAD_STATE if the device is already being reset.

Request

NameType

Response

NameType
s zx/status

ResetEndpoint

Resets an endpoint that is in a halted or error state. Endpoints will be halted if the device returns a STALL in response to a USB transaction. When that occurs, the transaction will fail with ERR_IO_REFUSED. usb_reset_endpoint() the endpoint to normal running state.

Request

NameType
ep_address uint8

Response

NameType
s zx/status

SetConfiguration

Selects the configuration for the device.

Request

NameType
configuration uint8

Response

NameType
s zx/status

SetInterface

Selects an alternate setting for a USB interface.

Request

NameType
interface_number uint8
alt_setting uint8

Response

NameType
s zx/status

STRUCTS