Endpoints

USB3 endpoint-type implementations.

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

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.

Variables:

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.

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 – The descriptor collection to add.

Control

Low-level USB3 transceiver gateware – control transfer components.

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

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.

Variables:

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.

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 – The descriptor collection to add.

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, src_loc_at: int = 0, **kwargs)

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.

Variables:
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.