RTEMS 6.1-rc2
Loading...
Searching...
No Matches
Functions
uart_dma.c File Reference
#include "chip.h"
#include "string.h"
#include "stdlib.h"

Functions

uint32_t UARTD_Configure (UartDma *pUartd, uint8_t uartId, uint32_t uartMode, uint32_t baud, uint32_t clk)
 Initializes the UartDma structure and the corresponding UART & DMA . hardware select value. The driver will uses DMA channel 0 for RX and DMA channel 1 for TX. The DMA channels are freed automatically when no UART command processing.
 
uint32_t UARTD_EnableRxChannels (UartDma *pUartd, UartChannel *pRxCh)
 This function initialize the appropriate DMA channel for Rx channel of UART.
 
uint32_t UARTD_EnableTxChannels (UartDma *pUartd, UartChannel *pTxCh)
 This function initialize the appropriate DMA channel for Tx channel of UART.
 
uint32_t UARTD_DisableRxChannels (UartDma *pUartd, UartChannel *pRxCh)
 This function disables the appropriate DMA channel for Rx channel of USART.
 
uint32_t UARTD_DisableTxChannels (UartDma *pUartd, UartChannel *pTxCh)
 This function disables the appropriate DMA channel for Tx channel of USART.
 
uint32_t UARTD_SendData (UartDma *pUartd)
 Starts a UART master transfer. This is a non blocking function. It will return as soon as the transfer is started.
 
uint32_t UARTD_RcvData (UartDma *pUartd)
 Starts a UART master transfer. This is a non blocking function. It will return as soon as the transfer is started.
 

Detailed Description

Implementation for the UART with xDMA driver.

Function Documentation

◆ UARTD_Configure()

uint32_t UARTD_Configure ( UartDma pUartd,
uint8_t  uartId,
uint32_t  uartMode,
uint32_t  baud,
uint32_t  clk 
)

Initializes the UartDma structure and the corresponding UART & DMA . hardware select value. The driver will uses DMA channel 0 for RX and DMA channel 1 for TX. The DMA channels are freed automatically when no UART command processing.

Parameters
pUartdPointer to a UartDma instance.
pUartHwAssociated UART peripheral.
uartIdUART peripheral identifier.
uartModeUART peripheral identifier.*
baudUART baud rate
clkUART ref clock
pXdmadPointer to a Dmad instance.

◆ UARTD_DisableRxChannels()

uint32_t UARTD_DisableRxChannels ( UartDma pUartd,
UartChannel pRxCh 
)

This function disables the appropriate DMA channel for Rx channel of USART.

Parameters
pUsartdPointer to a UsartDma instance.
pRxChPointer to TxChannel configuration
Returns
0 if the transfer has been started successfully; otherwise returns USARTD_ERROR_LOCK is the driver is in use, or USARTD_ERROR if the command is not valid.

◆ UARTD_DisableTxChannels()

uint32_t UARTD_DisableTxChannels ( UartDma pUartd,
UartChannel pTxCh 
)

This function disables the appropriate DMA channel for Tx channel of USART.

Parameters
pUsartdPointer to a USARTDma instance.
pTxChPointer to TxChannel configuration
Returns
0 if the transfer has been started successfully; otherwise returns USARTD_ERROR_LOCK is the driver is in use, or USARTD_ERROR if the command is not valid.

◆ UARTD_EnableRxChannels()

uint32_t UARTD_EnableRxChannels ( UartDma pUartd,
UartChannel pRxCh 
)

This function initialize the appropriate DMA channel for Rx channel of UART.

Parameters
pUartdPointer to a UartDma instance.
pRxChPointer to TxChannel configuration
Returns
0 if the transfer has been started successfully; otherwise returns UARTD_ERROR_LOCK is the driver is in use, or UARTD_ERROR if the command is not valid.

◆ UARTD_EnableTxChannels()

uint32_t UARTD_EnableTxChannels ( UartDma pUartd,
UartChannel pTxCh 
)

This function initialize the appropriate DMA channel for Tx channel of UART.

Parameters
pUartdPointer to a UartDma instance.
pTxChPointer to RxChannel configuration
Returns
0 if the transfer has been started successfully; otherwise returns UARTD_ERROR_LOCK is the driver is in use, or UARTD_ERROR if the command is not valid.

◆ UARTD_RcvData()

uint32_t UARTD_RcvData ( UartDma pUartd)

Starts a UART master transfer. This is a non blocking function. It will return as soon as the transfer is started.

Parameters
pUartdPointer to a UartDma instance.
Returns
0 if the transfer has been started successfully; otherwise returns UARTD_ERROR_LOCK is the driver is in use, or UARTD_ERROR if the command is not valid.

◆ UARTD_SendData()

uint32_t UARTD_SendData ( UartDma pUartd)

Starts a UART master transfer. This is a non blocking function. It will return as soon as the transfer is started.

Parameters
pUartdPointer to a UartDma instance.
Returns
0 if the transfer has been started successfully; otherwise returns UARTD_ERROR_LOCK is the driver is in use, or UARTD_ERROR if the command is not valid.