manuelbl / usb-pd-arduino

USB Power Delivery for Arduino
MIT License
53 stars 10 forks source link

v2, FUSB302 USB PD controller and PPS #17

Open gc-ss opened 1 month ago

gc-ss commented 1 month ago

Noticed you have a v2 in the works and have chosen the FUSB302 USB PD controller. It's my understanding that the FUSB302 doesn't support PPS. There are others, like the AP33772 that does support PPS, though.

Would you be interested in the AP33772 so that PPS can be supported as well?

manuelbl commented 1 month ago

"v2" is an experimental branch. It's unclear if it will ever reach a reasonable state. The FUSB302 implementation works with ESP32 only. In its current form, it's not suitable for other MCUs.

FUSB302 fully supports PPS.

The AP33772 is – as far as I can tell – a far more autonomous PD sink controller than FUSB302. It fully covers all protocol layers while the FUSB302 only covers the lower layers. In order to use it, there is no need for handling all protocol details and timing constraints. It's sufficient to set a few I2C registers. Arduino examples are provided by the manufacturer. It doesn't really make sense to add support for it in this project.

gc-ss commented 1 month ago

Thank You for the explanation and sharing your findings

It doesn't really make sense to add support for it in this project

Can you explain this a bit more? It seems the AP33772 is more "user friendly" and you don't lose any functionality over FUSB302, so if you will be using an external PHY, why won't you use one that's cheaper and more "user friendly"?

manuelbl commented 1 month ago

USB PD communication consists of several protocol layers. In simple terms, they are:

This library covers all three layers. If FUSB302 is used, only the highest layer and most of the middle layer is needed. If AP33772 is used, none of the layers is needed as the chip handles all three layers itself. And requesting a certain voltage can be achieved in several ways, most of which do not involve any USB PD elements.

So this library cannot really provide any added value for the AP33772. It can easily be used with any I2C library.