summaryrefslogtreecommitdiff
path: root/board/discovery/board.c
diff options
context:
space:
mode:
authorAnton Staaf <robotboy@chromium.org>2015-07-21 12:04:42 -0700
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-08-24 19:08:35 +0000
commit69bd4ce351ca56a3141281bf25431a07ea10512f (patch)
tree4486849beac1b26caf5d6ff8ac691a568869651f /board/discovery/board.c
parent16f63703c9ccc46ec48abcc586a595456e99fc9a (diff)
downloadchrome-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 'board/discovery/board.c')
-rw-r--r--board/discovery/board.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/board/discovery/board.c b/board/discovery/board.c
index eb58434aa7..81fe437850 100644
--- a/board/discovery/board.c
+++ b/board/discovery/board.c
@@ -11,6 +11,7 @@
#include "registers.h"
#include "task.h"
#include "usart-stm32f0.h"
+#include "usart_rx_dma.h"
#include "usart_tx_dma.h"
#include "util.h"
@@ -43,12 +44,15 @@ static struct queue const loopback_queue =
loopback_usart.producer,
loopback_usart.consumer);
+static struct usart_rx_dma const loopback_rx_dma =
+ USART_RX_DMA(STM32_DMAC_CH6, 32);
+
static struct usart_tx_dma const loopback_tx_dma =
USART_TX_DMA(STM32_DMAC_CH7, 16);
static struct usart_config const loopback_usart =
USART_CONFIG(usart2_hw,
- usart_rx_interrupt,
+ loopback_rx_dma.usart_rx,
loopback_tx_dma.usart_tx,
115200,
loopback_queue,