This commit adds support for the firmware version extension, as
described at http://www.fwupd.org/developers S. USB Firmware Version
Extensions. This gives a new way of reading the firmware version, which
is apparently preferred by fwupd. I'd kinda like to be able to use
fwupd to update the device's firmware starting with the new minor
version, so this is a first step towards that.
Now the error behavior for set_v and set_i is well-defined by the
documentation: they print nothing on success and an error message on
failure. The range of valid values is now [0, 20000] for set_v and
[0, 5000] for set_i, matching the voltages and currents that can be
provided by USB Power Delivery.
Bumped version number to 1.0.1, reflecting this bugfix.
The iSerial descriptor now holds the firmware version number. This is
1.0.0 since I don't expect any major API changes any time soon. The USB
descriptors have been documented in docs/console_config.md so there
will be no questions as to how to identify the devices and what their
"serial numbers" mean.
The VID:PID pair 1209:9DB5 is now officially assigned for the PD Buddy
Sink. Thanks, Arachnid! Now the firmware uses its proper PID instead
of the testing one.
The command shell is based on the ChibiOS-provided one, but modified to
not run in a new thread and generally be a bit simpler, while also
having PD Buddy branding. The storage functions work with the STM32
flash registers directly, taking over the last page of flash. A new
linker script is used to ensure that program code can't end up using
that page. The DPM has been updated to use the saved settings rather
than hardcoded ones. Now what's needed is real commands for editing the
configuration.
Added commands to edit configuration
We now have commands to load the current settings into RAM, edit the
settings in RAM, and write them back to flash. The only settings
currently supported are current and fixed voltage, because the rest of
the code doesn't support GiveBack or variable/battery PDOs yet.
Short help messages were added for each command. Nothing too exciting,
but it should be a great help for someone poking around in the PD Buddy
Sink configuration shell for the first time.
Wrote new usage information for the firmware
Now that we have a command shell, the README should indicate how to use
it.