Ralim/usb-pd

More simple PPS example?

puzrin opened this issue · 0 comments

From user's point of view, it would be nice to have more "obvious" api for PPS mode:

  1. Check if PPS mode with max [voltage, current] availavle.
  2. Update (anytime) custom [voltage, current].
  3. Optional. Check success of (2) somehow.

That means, in app i'd like to use something like

// On setup
if (!pd_is_pps_available(21000, 3000)) {
    printf("Error: PPS mode with 21V/3A required")
}

// Somewhere in heater's PID
pd_pps_set(my_voltage, 3000);

I understant, current api has unlimited flexibility. But in real world many projects have more simple needs

  • PD trigger with single fixed voltage (one of 9 / 12 / 15 / 20).
  • PPS mode only (see description above).

It would be nice to have copy-paste-able examples for that. May be somewhere in examples/ folder.