diff options
author | Vincent Palatin <vpalatin@chromium.org> | 2014-12-20 18:03:47 -0800 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-04-10 23:29:31 +0000 |
commit | 15391709fd964e23d91deaf3db832a9d83da1ea5 (patch) | |
tree | 16c9bbcc696f810c7fbe2fc96f0cae9b901ccf72 /include | |
parent | 686a23585e2bc8a357842bd30ea3cae0cc5648da (diff) | |
download | chrome-ec-15391709fd964e23d91deaf3db832a9d83da1ea5.tar.gz |
twinkie: add simple text tracing mechanism
When using the Twinkie dongle without a protocol decoder on the host,
add a simple text tracing mechanism, so the user can get the timestamped traces
of the packets on the wire (in a best effort fashion).
Signed-off-by: Vincent Palatin <vpalatin@chromium.org>
BRANCH=none
BUG=none
TEST=On Twinkie command-line, type "tw trace on"
then plug a DingDong to Samus through Twinkie and
see the PD message traces on the console.
Change-Id: I4fa35d6783cc6279c95209c86f37e6d717de7301
Reviewed-on: https://chromium-review.googlesource.com/237222
Reviewed-by: Alec Berg <alecaberg@chromium.org>
Reviewed-by: Todd Broch <tbroch@chromium.org>
Trybot-Ready: Vincent Palatin <vpalatin@chromium.org>
Tested-by: Vincent Palatin <vpalatin@chromium.org>
Commit-Queue: Vincent Palatin <vpalatin@chromium.org>
Diffstat (limited to 'include')
-rw-r--r-- | include/usb_pd.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/include/usb_pd.h b/include/usb_pd.h index e79e2d907c..0f226096b8 100644 --- a/include/usb_pd.h +++ b/include/usb_pd.h @@ -1324,7 +1324,27 @@ void pd_hw_release(int port); */ void pd_hw_init(int port, int role); +/** + * Initialize the reception side of hardware used for PD. + * + * This is a subset of pd_hw_init() including only : + * the comparators + the RX edge delay timer + the RX DMA. + * + * @param port USB-C port number + */ +void pd_hw_init_rx(int port); + /* --- Protocol layer functions --- */ + +/** + * Decode a raw packet in the RX buffer. + * + * @param port USB-C port number + * @param payload buffer to store the packet payload (must be 7x 32-bit) + * @return the packet header or <0 in case of error + */ +int pd_analyze_rx(int port, uint32_t *payload); + /** * Get connected state * |