Basic USB-C Source
This example demonstrates how to create a USB-C Power Delivery application using the USB-C subsystem. The application implements a USB-C Source device.
After a USB-C Sink device is plugged into the USB-C Source device, it negotiates with the Source device to provide 5V at 100mA, 9V at 100mA, or 15V at 100mA and the Requested Data Object (RDO) provided by the Source is displayed.
The TCPC device used by the sample is specified in the devicetree
node that’s compatible with
The sample has been tested on
An overlay file is provided.
Building and Running
Build and flash as follows, changing
stm32g081b_eval for your board:
west build -b stm32g081b_eval samples/subsys/usb_c/source
Connect a sink device and see console output:
REQUEST RDO: 1300280a
Object Position: 1
Capability Mismatch: 0
USB Comm Capable: 1
No USB Suspend: 1
Unchunk Ext MSG Support: 0
Operating Current: 100 mA
Min Operating Current: 100 mA