emUSB-C PD
Software to manage USB-C power delivery in embedded applications
emUSB-C PD is a complete power delivery protocol implementation for USB-C as defined by USB-IF, especially designed for use in embedded devices.
Overview
emUSB-C PD turns the cable into a smart connection, enabling the detection of the type of device connected, power supply capabilities, USB Host/Device software, and more. With SEGGER's emUSB-C PD library, embedded applications can easily handle a USB-C port on any embedded device with a USB PD controller. emUSB-C PD can be used in combination with emUSB-Host and/or emUSB-Device. It can also be used without a USB stack for devices that just use USB-C as a power source or to charge a dedicated battery.
USB Type-C (short: USB-C) is a 24-pin double-sided USB connector format that enables transmission of both data and power on one single cable. This new industrial standard stands out from previous types A and B due to its compact form-factor and reversible cable. In terms of functionality, USB-C also allows power supplies to charge or power devices (e.g. smartphones, monitors). It is more durable than Micro-B as it can take full advantage of higher voltages and currents up to 48V 5A (240W) and maximum transfer rates of 10 Gbps (Superspeed+).
Key features
- Device connection detection on USB Type-C connectors
- Power source/sink detection
- Host/device USB data role detection
- Dead battery signaling (if supported by hardware)
- Dynamic power supply negotiation up to 20V 3A
- Use of chargers with variable supply voltage
- ISO/ANSI C source code
- Simple configuration
- Configurable for minimal memory footprint
- Very easy API
Role swap
A key feature of emUSB-C PD is the support of role swap. Per default, the USB Host is always the power source and a device is always the power sink. Using role swaps, a host can be a power sink and a connected USB device can be the power source.
Fast role swap (FRS)
The fast role swap (FRS) feature enables role swaps during ongoing operation of a device. It is intended to provide uninterrupted power on the USB connection. This might be the case, if a battery-driven device works as source, but has drained its power supply, or if a wall-powered device loses wall power. Now the affected device can signal the partner device, that it requires power immediately to avoid losing the connections and with it any ongoing transmission. This is handled via the fast role swap.
Use cases
USB-C has additional lines and can transmit more power than previous USB connections. Even for power-hungry applications, the USB cable can transmit enough power from the source as well. This opens specific use cases, mostly related to different models to provide power, and helps embedded system developers meet the requirement of an EU mandate. According to the new EU Common Charger Directive (Radio Equipment Directive 2014/53/EU), all electronic equipment using wired charging technology is required to be powered via USB-C cable.
Avoiding sudden power loss
When a device regularly powered by battery is connected to another device, it could switch off its own power pack and draw the power from the connected device to reduce the drain on its batteries. Or once its batteries start getting depleted, it can ask the other device to provide power avoiding a sudden loss of connection.
Devices with rechargeable batteries
With traditional USB, power is limited to 5V and 500mA, with 1.5A as the best case scenario with charger detection. This rarely provides enough power to reliably charge a battery and when it does, it definitely takes a long time. With USB-C, the connection can be used to transmit higher voltages and higher currents. To achieve this, the USB-C PD protocol is used to query the capabilities of the cable and to request power from the sourcing device.
Technical specifications
emUSB-C PD is a software library for embedded applications that fully supports the power delivery protocol implementation of USB-C. It consists of two layers: The device-independent emUSB-C PD protocol stack and a driver to handle the specific target hardware. Drivers are available for several different target hardware controllers.
Both layers are divided into two functional modules: The base module that provides the API for the application and handles the static sensing of the CC pins, and the PD module that is responsible for the power delivery packet communication. The emUSB-C PD API can also be used in connection with a legacy OTG driver to implement OTG functionality on a device without a USB-C connector.
Pinout functions
The USB-C connector has 24 pins. The USB-C connector is primarily used to control the additional CC pins CC1 and CC2. These are the channel configuration pins that are used to determine the cable alignment, the role distribution, and the port control.
Resource usage
Function | Code | RAM |
---|---|---|
USB-C OTG (on the go) | 1400 | 220 |
USB-C PD (power delivery) | 5100 | 450 |
USB-C OTG (sink only) | 1000 | 220 |
USB-C PD (sink only) | 3800 | 450 |
USB-C OTG (source only) | 1000 | 220 |
USB-C PD (source only) | 3300 | 450 |
Licensing
emUSB-C PD is available under various Embedded Software License models and delivered in source code packages. With a wide range of licensing options, emUSB-C PD can fulfill commercial requirements as well as technical requirements. All licenses are one-time payments. emUSB-C PD is royalty-free and not subscription-based.