usb module#
USB Protocol#
This package contains the definitions for the Universal Serial Bus protocol.
`https://en.wikipedia.org/wiki/USB`_ `https://www.usb.org/`_
Transport vs Connector Bundles#
The USB protocol contains many different layers from physical to logical. The bundles in this package are organized to support two levels in the application:
Transport - This is the set of signals that convey the information in the bus. These signals typically traverse many components from the connector to the processor endpoint.
These signals typically have SI constraints attached to them.
Connector - This is the physical layer where the USB cable meets the board. This interface may have power, shield, and other accessory pins in addition to the transport layer signals. These additional connections may or may not make there way to the processor endpoint.
In the code below, the “transport” bundles are what you would typically use when connecting up the different modules of your circuit. The “connector” bundles are typically used to define the ports on a physical connector component or module that contains the physical connector component.
Symmetry in Transport Bundles#
If you look closely at the bundles defined below, you will notice some symmetry in the definitions of the transport bundles.
The USBData bundle defines the USB2.0 interface with port data.
This same interface gets reused in USBSuperSpeed and
USB_C later on.
Similarly, we use lane to define an array of
LanePair` bundles (RX + TX differential pairs). This
same pattern gets used in USB_C.
This is not by accident. The reason we structure the bundles this way is:
They can easily used in
provide/requirepin assignment statements.We can simplify the implementation of the connect, constrain, and routing structure application functions.
Matching Lanes#
For most of the constraint functions in this package, the bundle types
themselves are not checked for equality. Instead - we check for matching
lane configurations. This allows a USBSuperSpeed and
USB_C transport bundle to connect to each other if they have the
correct number of lanes defined.
- class USB2[source]#
Bases:
PortTransport Bundle for the USB 2.0 Interface
- data = DiffPair()#
Differential pair for USB data
- class USB2Connector[source]#
Bases:
PortConnector Bundle for the USB 2.0 Interface
- vbus = Power()#
Powerbundle for USB connector interface
- id = Port()#
ID signal
- class USBSuperSpeed(lane_count=2)[source]#
Bases:
USB2Transport Bundle for Superspeed USB
This bundle supports USB 3/4 transport signals. These are the signals that are typically connected with SI constraints from the connector to the MCU or other components.
This bundle type is usually used to construct the ports on MCUs, ESD devices, Muxes, etc in the USB 3/4 applications.
- Parameters:
lane_count – Number of superspeed lanes in this bundle.
- lane: Sequence[LanePair]#
A configurable number of lane-pairs for data transfer
- class USBSuperSpeedConnector[source]#
Bases:
PortConnector Bundle for USB Type A SuperSpeed™ Connectors
- vbus = Power()#
Powerbundle for USB connector interface
- bus = USBSuperSpeed()#
USBSuperSpeedbundle for high speed data transfer
- shield = Port()#
Pin for connection to cable shield
- class USB_C(lane_count=2)[source]#
Bases:
USBSuperSpeedTransport Bundle for USB3/4
- Parameters:
lane_count – Number of superspeed lanes in this bundle.
- cc = (Port(), Port())#
CC pins for capability identification
- sbu = (Port(), Port())#
SBU pins for side band utility
- class USB_C_Connector[source]#
Bases:
PortConnector Bundle - USB Type C Connector
This bundle is typically applied to a physical connector component in a board design.
- vbus = Power()#
Powerbundle for USB connector interface
- shield = Port()#
Pin for connection to cable shield
- class USBStandard(skew, impedance)[source]#
- Parameters:
skew (Toleranced)
impedance (Toleranced)
-
skew:
Toleranced#
-
impedance:
Toleranced#
- loss = 12.0#
- Constraint(structure: DifferentialRoutingStructure | None = None)[source]#
Construct a
SignalConstraintapplicable to USB topologies of this standard.- Parameters:
std (USBStandard)
structure (DifferentialRoutingStructure | None)
- class USB(skew, impedance)[source]#
Bases:
USBStandard,Enum- v2 = USBStandard(skew=Toleranced(0, 3.75e-12, 3.75e-12), impedance=Toleranced(90, 13.5, 13.5))#
- v3 = USBStandard(skew=Toleranced(0, 1e-12, 1e-12), impedance=Toleranced(90, 13.5, 13.5))#
- v4 = USBStandard(skew=Toleranced(0, 1e-12, 1e-12), impedance=Toleranced(85, 9, 9))#