Skip to main content

Crate usbpd

Crate usbpd 

Source
Expand description

§Library for USB PD

Modeled after the Universal Serial Bus Power Delivery Specification: USB PD R3.2 v1.1 (2024/10).

The library implements:

  • A policy engine for each supported mode,
  • the protocol layer, and
  • the DevicePolicyManager trait, which allows a device user application to talk to the policy engine, and control it.

§Currently supported modes

  • SPR Sink with helpers for requesting
  • A fixed supply
  • A Programmable Power Supply (PPS)

Modules§

_20millivolts_mod
Defines a unit for electric potential in 20 mV steps.
_25millivolts_mod
Defines a unit for electric potential in 25 mV steps. Used by AVS (Adjustable Voltage Supply) per USB PD 3.2 Table 6.26.
_50milliamperes_mod
Defines a unit for electric current in 50 mA steps.
_50millivolts_mod
Defines a unit for electric potential in 50 mV steps.
_250milliwatts_mod
Defines a unit for power in 250 mW steps.
protocol_layer
The protocol layer is controlled by the policy engine, and commands the PHY layer.
sink
The sink implementation.
timers
Timers that are used by the protocol layer and policy engine.
units
This module defines the CGS (centimeter-gram-second) unit system for use in the USB Power Delivery Protocol layer. These units are defined using the uom (units of measurement) library and are expressed as u32 values for milliamps, millivolts, and microwatts.

Enums§

DataRole
The data role of the port.
PowerRole
The power role of the port.