ardnew / STUSB4500

Arduino library for USB PD sink controller (STUSB4500)
MIT License
29 stars 3 forks source link

License? #3

Closed stwirth closed 2 years ago

stwirth commented 2 years ago

Hi @ardnew, nice work with this library!

I've been trying to find a driver for the ST4500 for an embedded Linux project and I found the official library from ST (https://github.com/usb-c/STUSB4500) hard to integrate/adapt to a non-ST platform. Your library here seems much easier to port to embedded Linux. I could not find any license information in the repo, could you clarify how your code can be used? Thanks!

ardnew commented 2 years ago

Hah, you're telling me – their code is actually what my library was based on, believe it or not. Theirs is extremely dense, with most of the high-level logic controlled implicitly with HAL hooks and event handlers. So good luck following it if you aren't familiar with their HAL. I had to use their IDE + debugger to trace execution path.

Aaaaanyway, I usually stick with the MIT license. Just added LICENSE to the root of this repository.

Thanks for the feedback!

stwirth commented 2 years ago

Thanks @ardnew!

FYI I'm also looking at https://github.com/sparkfun/SparkFun_STUSB4500_Arduino_Library which is MIT licensed as well. I like your typedefs though but unfortunately I don't have the alert and attach pins connected on my board...

ardnew commented 2 years ago

@stwirth You should know there is a major difference between this and the SparkFun library. Your choice of library to use should probably be based on these functional differences instead of which source code design is more appealing to you.

These differences may matter depending on how you plan to use the device: using fixed power profiles or using dynamic power profiles.

sparkfun/SparkFun_STUSB4500_Arduino_Library

Uses the device's integrated NVM for configuring PDOs, which implies the following:

ardnew/STUSB4500 and ardnew/tinygo-stusb4500

Does not use the device's integrated NVM but configures the PDOs dynamically at run-time (RAM), which implies the following:

Hope this clarifies some confusion and helps you choose an appropriate library for your project!

stwirth commented 2 years ago

@ardnew thanks for your guidance and for pointing out the differences in the libraries!