From 5507e14cd45612653342381d3caab54e43b61990 Mon Sep 17 00:00:00 2001 From: Alexandru Gagniuc Date: Thu, 9 May 2013 00:56:33 -0500 Subject: [PATCH] lm4f: Implement DMA enable/disable functions for the UART Add basic rx/tx_dma_enable/disable functionality. Signed-off-by: Alexandru Gagniuc --- lib/lm4f/uart.c | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/lib/lm4f/uart.c b/lib/lm4f/uart.c index e96af0f9..73ccc453 100644 --- a/lib/lm4f/uart.c +++ b/lib/lm4f/uart.c @@ -517,24 +517,44 @@ void uart_clear_interrupt_flag(u32 uart, enum uart_interrupt_flag ints) */ /**@{*/ +/** + * \brief Enable the UART Receive DMA. + * + * @param[in] uart UART block register address base @ref uart_reg_base + */ void uart_enable_rx_dma(u32 uart) { - /* TODO: this is just a stub. */ + UART_DMACTL(uart) |= UART_DMACTL_RXDMAE; } +/** + * \brief Disable the UART Receive DMA. + * + * @param[in] uart UART block register address base @ref uart_reg_base + */ void uart_disable_rx_dma(u32 uart) { - /* TODO: this is just a stub. */ + UART_DMACTL(uart) &= ~UART_DMACTL_RXDMAE; } +/** + * \brief Enable the UART Transmit DMA. + * + * @param[in] uart UART block register address base @ref uart_reg_base + */ void uart_enable_tx_dma(u32 uart) { - /* TODO: this is just a stub. */ + UART_DMACTL(uart) |= UART_DMACTL_TXDMAE; } +/** + * \brief Disable the UART Transmit DMA. + * + * @param[in] uart UART block register address base @ref uart_reg_base + */ void uart_disable_tx_dma(u32 uart) { - /* TODO: this is just a stub. */ + UART_DMACTL(uart) &= ~UART_DMACTL_TXDMAE; } /**@}*/