diff options
author | Anton Staaf <robotboy@chromium.org> | 2015-07-21 12:04:42 -0700 |
---|---|---|
committer | ChromeOS Commit Bot <chromeos-commit-bot@chromium.org> | 2015-08-24 19:08:35 +0000 |
commit | 69bd4ce351ca56a3141281bf25431a07ea10512f (patch) | |
tree | 4486849beac1b26caf5d6ff8ac691a568869651f /chip/stm32/usart.h | |
parent | 16f63703c9ccc46ec48abcc586a595456e99fc9a (diff) | |
download | chrome-ec-69bd4ce351ca56a3141281bf25431a07ea10512f.tar.gz |
USART: Add DMA based receiver
This DMA receiver uses a separate small circular buffer to DMA into.
This allows the DMA transaction to be made circular, and thus it does
not require the interrupt latency to be low enough to setup the next
transfer before the next character comes in.
Additional diagnostics output have been added to the usart_info console
command to facilitate tuning of the FIFO size.
Signed-off-by: Anton Staaf <robotboy@chromium.org>
BRANCH=None
BUG=None
TEST=make buildall -j
Verify DMA works by cross connecting two discovery boards
Change-Id: Idcdf95a47fadf21ec2154f0c9128cd3586e568ec
Reviewed-on: https://chromium-review.googlesource.com/292870
Tested-by: Anton Staaf <robotboy@chromium.org>
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Commit-Queue: Anton Staaf <robotboy@chromium.org>
Trybot-Ready: Anton Staaf <robotboy@chromium.org>
Diffstat (limited to 'chip/stm32/usart.h')
-rw-r--r-- | chip/stm32/usart.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/chip/stm32/usart.h b/chip/stm32/usart.h index 8db3558b50..875dbfdc76 100644 --- a/chip/stm32/usart.h +++ b/chip/stm32/usart.h @@ -24,6 +24,12 @@ struct usart_state { * in the RX queue. */ uint32_t rx_dropped; + + /* + * Counter of the number of times an receive overrun condition is + * detected. This will not usually be a count of the number of bytes + * that were lost due to overrun conditions. + */ uint32_t rx_overrun; }; @@ -59,6 +65,13 @@ struct usart_rx { void (*init)(struct usart_config const *config); void (*interrupt)(struct usart_config const *config); + /* + * Print to the console any per-strategy diagnostic information, this + * is used by the usart_info command. This can be NULL if there is + * nothing interesting to display. + */ + void (*info)(struct usart_config const *config); + struct producer_ops producer_ops; }; @@ -66,6 +79,13 @@ struct usart_tx { void (*init)(struct usart_config const *config); void (*interrupt)(struct usart_config const *config); + /* + * Print to the console any per-strategy diagnostic information, this + * is used by the usart_info command. This can be NULL if there is + * nothing interesting to display. + */ + void (*info)(struct usart_config const *config); + struct consumer_ops consumer_ops; }; |