libsigrok: add vbus voltage and current support for libsigrok

Vbus voltage and current are both in 16 bits.
Their timestamp offset with respect to the current packet timestamp
is also reported.  All these values are 16 bits.
Current value can be negative; negative means the samus is being charged;
positive means that the samus is supplying power.
Update: accepting timestamp in us; delete the threshold settings. report
all vbus information that are available. Let the decoders do the threshold
setting.

Updated: backward compatibility by allowing user to compile two verions of
the software. in libsigrok/src/hardware/chromium-twinkie/protocol.h
Use #define CONFIG_USBC_SNIFFER_HEADER_V1 if the twinkie is the old version,
which does not send out vbus information;
use #define CONFIG_USBC_SNIFFER_HEADER_V2 if the twinkie is the new version,
which sends out vbus information.

BUG=chrome-os-partner:42703
BRANCH=none

TEST=BEGIN
connect Twinkie to a waveform generator, record data using:
sudo sigrok-cli -d chromium-twinkie --continuous -o test.sr
then check the resulting waveforms on pulseview.
END

Signed-off-by: Dawei Li <daweili@google.com>

Change-Id: I471a1855f656dc93a0bf9935553acc4bcefd3329
Reviewed-on: https://chromium-review.googlesource.com/285532
Commit-Ready: Sheng-liang Song <ssl@chromium.org>
Tested-by: Dawei Li <daweili@google.com>
Reviewed-by: Sheng-liang Song <ssl@chromium.org>
3 files changed