#usb-pd #embedded #sink

no-std usbpd

USB-PD library for [no_std]

10 releases (1 stable)

Uses new Rust 2024

new 1.0.0 May 10, 2025
0.2.1 Mar 20, 2025
0.2.0 Feb 10, 2025
0.1.2 Feb 8, 2025
0.0.5 Jan 27, 2025

#366 in Hardware support

MIT license

125KB
3K SLoC

USB PD library.

Includes capabilities for implementing:

  • SPR sink

Provides a policy engine (depending on selected capability), protocol layer, and relevant traits for the user applation to implement.


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.

The library depends on the crate usbpd-traits, which provides traits for supporting USB PD PHYs.

Currently supported modes

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

Credit

Inherits message parsing code from usb-pd-rs.

Dependencies

~2.6–3.5MB
~71K SLoC