summaryrefslogtreecommitdiff
path: root/board/discovery-stm32f072
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-stm32f072
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-stm32f072')
-rw-r--r--board/discovery-stm32f072/board.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/board/discovery-stm32f072/board.c b/board/discovery-stm32f072/board.c
index 5aa185ffc3..360f970001 100644
--- a/board/discovery-stm32f072/board.c
+++ b/board/discovery-stm32f072/board.c
@@ -14,6 +14,7 @@
#include "task.h"
#include "usart-stm32f0.h"
#include "usart_tx_dma.h"
+#include "usart_rx_dma.h"
#include "usb_gpio.h"
#include "usb_spi.h"
#include "usb-stream.h"
@@ -53,12 +54,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_CH3, 8);
+
static struct usart_tx_dma const loopback_tx_dma =
USART_TX_DMA(STM32_DMAC_CH2, 16);
static struct usart_config const loopback_usart =
USART_CONFIG(usart1_hw,
- usart_rx_interrupt,
+ loopback_rx_dma.usart_rx,
loopback_tx_dma.usart_tx,
115200,
loopback_queue,