SAMV71 Xplained Ultra Software Package 1.4

uart_dma.h File Reference

#include "chip.h"

Go to the source code of this file.

Data Structures

struct  UartChannel
 usart Transfer Request prepared by the application upper layer. More...
struct  UartDma

Defines

#define UARTD_ERROR   1
#define UARTD_ERROR_LOCK   2

Typedefs

typedef void(* UartdCallback )(uint8_t, void *)

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_EnableTxChannels (UartDma *pUartd, UartChannel *pTxCh)
 This function initialize the appropriate DMA channel for Tx channel of UART.
uint32_t UARTD_EnableRxChannels (UartDma *pUartd, UartChannel *pRxCh)
 This function initialize the appropriate DMA channel for Rx channel of UART.
uint32_t UARTD_DisableTxChannels (UartDma *pUartd, UartChannel *pTxCh)
 This function disables the appropriate DMA channel for Tx channel of USART.
uint32_t UARTD_DisableRxChannels (UartDma *pUartd, UartChannel *pRxCh)
 This function disables the appropriate DMA channel for Rx 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 of UART driver, transfer data through DMA.

Definition in file uart_dma.h.


Define Documentation

#define UARTD_ERROR   1

An unspecified error has occurred.

Definition at line 51 of file uart_dma.h.

#define UARTD_ERROR_LOCK   2

UART driver is currently in use.

Definition at line 54 of file uart_dma.h.


Typedef Documentation

typedef void(* UartdCallback)(uint8_t, void *)

UART transfer complete callback.

Definition at line 66 of file uart_dma.h.


Function Documentation

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:
pUartd Pointer to a UartDma instance.
pUartHw Associated UART peripheral.
uartId UART peripheral identifier.
uartMode UART peripheral identifier.*
baud UART baud rate
clk UART ref clock
pXdmad Pointer to a Dmad instance.

Definition at line 340 of file uart_dma.c.

Here is the call graph for this function:

uint32_t UARTD_DisableRxChannels ( UartDma pUartd,
UartChannel pRxCh 
)

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

Parameters:
pUsartd Pointer to a UsartDma instance.
pRxCh Pointer 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.

Definition at line 492 of file uart_dma.c.

Here is the call graph for this function:

uint32_t UARTD_DisableTxChannels ( UartDma pUartd,
UartChannel pTxCh 
)

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

Parameters:
pUsartd Pointer to a USARTDma instance.
pTxCh Pointer 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.

Definition at line 529 of file uart_dma.c.

Here is the call graph for this function:

uint32_t UARTD_EnableRxChannels ( UartDma pUartd,
UartChannel pRxCh 
)

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

Parameters:
pUartd Pointer to a UartDma instance.
pRxCh Pointer 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.

Definition at line 388 of file uart_dma.c.

Here is the call graph for this function:

uint32_t UARTD_EnableTxChannels ( UartDma pUartd,
UartChannel pTxCh 
)

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

Parameters:
pUartd Pointer to a UartDma instance.
pTxCh Pointer 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.

Definition at line 439 of file uart_dma.c.

Here is the call graph for this function:

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:
pUartd Pointer 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.

Definition at line 585 of file uart_dma.c.

Here is the call graph for this function:

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:
pUartd Pointer 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.

Definition at line 564 of file uart_dma.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines