Endpoints

Important

This module has been deprecated and moved to torii-usb, please see the migration guide.

USB3 endpoint-type implementations.

class sol_usb.gateware.usb.usb3.endpoints.USB3ControlEndpoint(*args: Any, src_loc_at: int = 0, **kwargs: Any)

Gateware that manages control request data progression.

This class is used by creating one or more request handler modules; which define how requests are handled. These handlers can be bound using add_request_handler.

For convenience, this module can also automatically be populated with a StandardRequestHandler via the add_standard_request_handlers.

Attributes:

interface (SuperSpeedEndpointInterface) – The interface from this endpoint to the core device hardware.

Parameters:

endpoint_number (int, optional) – The endpoint number for this control interface; defaults to (and almost always should be) zero. (default: 0)

add_request_handler(request_handler)

Adds a ControlRequestHandler module to this control endpoint.

No arbitration is performed between request handlers; so it’s important that request handlers not overlap in the requests they handle.

add_standard_request_handlers(descriptors: DeviceDescriptorCollection)

Adds a handlers for the standard USB requests.

This will handle all Standard-type requests; so any additional request handlers must not handle Standard requests.

Parameters:

descriptors (DeviceDescriptorCollection) – The descriptor collection to add.

elaborate(platform)

Todo

Document Me

Control

Low-level USB3 transceiver gateware – control transfer components.

class sol_usb.gateware.usb.usb3.endpoints.control.USB3ControlEndpoint(*args: Any, src_loc_at: int = 0, **kwargs: Any)

Gateware that manages control request data progression.

This class is used by creating one or more request handler modules; which define how requests are handled. These handlers can be bound using add_request_handler.

For convenience, this module can also automatically be populated with a StandardRequestHandler via the add_standard_request_handlers.

Attributes:

interface (SuperSpeedEndpointInterface) – The interface from this endpoint to the core device hardware.

Parameters:

endpoint_number (int, optional) – The endpoint number for this control interface; defaults to (and almost always should be) zero. (default: 0)

add_request_handler(request_handler)

Adds a ControlRequestHandler module to this control endpoint.

No arbitration is performed between request handlers; so it’s important that request handlers not overlap in the requests they handle.

add_standard_request_handlers(descriptors: DeviceDescriptorCollection)

Adds a handlers for the standard USB requests.

This will handle all Standard-type requests; so any additional request handlers must not handle Standard requests.

Parameters:

descriptors (DeviceDescriptorCollection) – The descriptor collection to add.

elaborate(platform)

Todo

Document Me

Stream

Endpoint interfaces for working with streams.

The endpoint interfaces in this module provide endpoint interfaces suitable for connecting streams to USB endpoints.

class sol_usb.gateware.usb.usb3.endpoints.stream.SuperSpeedStreamInEndpoint(*args: Any, src_loc_at: int = 0, **kwargs: Any)

Endpoint interface that transmits a simple data stream to a host.

This interface is suitable for a single bulk or interrupt endpoint.

This endpoint interface will automatically generate ZLPs when a stream packet would end without a short data packet. If the stream’s last signal is tied to zero, then a continuous stream of maximum-length-packets will be sent with no inserted ZLPs.

This implementation is double buffered; and can store a single packet’s worth of data while transmitting a second packet. Bursting is currently not supported.

Attributes:
  • stream (SuperSpeedStreamInterface, input stream) – Full-featured stream interface that carries the data we’ll transmit to the host.

  • interface (SuperSpeedEndpointInterface) – Communications link to our USB device.

Parameters:
  • endpoint_number (int) – The endpoint number (not address) this endpoint should respond to.

  • max_packet_size (int) – The maximum packet size for this endpoint. Should match the wMaxPacketSize provided in the USB endpoint descriptor. (default: 1024)

elaborate(platform)

Todo

Document Me