Standalone USB-PD Stack For All Your Sink Needs

USB PD is a fun protocol to explore, but it can be a bit complex to fully implement. It makes sense weβre seeing new stacks pop up all the time, and todayβs stack is a cool one as far as code reusability goes. [Vitaly] over on Hackaday.io brings us pdsink β a C++ based PD stack with no platform dependencies, and fully-featured sink capabilities.
This stack can do SPR (5/9/15/20V) just like youβd expect, but it also does PPS without breaking a sweat β perfect for your Lithium Ion battery charging or any other current-limited shenanigans. Whatβs more, it can do EPR (28V and up) β for all your high-power needs. For reference, the SPR/PPS/EPR combination is all you could need from a PD stack intended for fully taking advantage of any USB-PD chargerβs capabilities. The stack is currently tailored to the classic FUSB302, but [Vitaly] says it wouldnβt be hard to add support for a PD PHY chip of your choice.
Itβs nice to have a choice in how you want your PD interactions to go β weβve covered a few stacks before, and each of them has strong and weak sides. Now, if you have the CPU bandwidth, you could go seriously low-tech and talk PD with just a few resistors, transistors, and GPIOs! Need to debug a particular USB-C edge case? Donβt forget a logger.

