SAMV71 Xplained Ultra Software Package 1.3

usart_dma.h File Reference

#include "chip.h"

Go to the source code of this file.

Data Structures

struct  UsartChannel
 usart Transfer Request prepared by the application upper layer. More...
struct  UsartDma

Defines

#define USARTD_ERROR   1
#define USARTD_ERROR_LOCK   2

Typedefs

typedef void(* UsartdCallback )(uint8_t, void *)

Functions

uint32_t USARTD_Configure (UsartDma *pUsartd, uint8_t USARTId, uint32_t UsartMode, uint32_t BaudRate, uint32_t UsartClk)
 Initializes the USARTDma structure and the corresponding USART & 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 USART command processing.
uint32_t USARTD_EnableTxChannels (UsartDma *pUsartd, UsartChannel *pTxCh)
 This function initialize the appropriate DMA channel for Tx channel of USART.
uint32_t USARTD_EnableRxChannels (UsartDma *pUsartd, UsartChannel *pRxCh)
 This function initialize the appropriate DMA channel for Rx channel of USART.
uint32_t USARTD_DisableTxChannels (UsartDma *pUsartd, UsartChannel *pTxCh)
 This function disables the appropriate DMA channel for Tx channel of USART.
uint32_t USARTD_DisableRxChannels (UsartDma *pUsartd, UsartChannel *pTxCh)
 This function disables the appropriate DMA channel for Rx channel of USART.
uint32_t USARTD_SendData (UsartDma *pUsartd)
 Starts a USART master transfer. This is a non blocking function. It will return as soon as the transfer is started.
uint32_t USARTD_RcvData (UsartDma *pUsartd)
 Starts a USART master transfer. This is a non blocking function. It will return as soon as the transfer is started.

Detailed Description

Implementation of USART driver, transfer data through DMA.

Definition in file usart_dma.h.


Define Documentation

#define USARTD_ERROR   1

An unspecified error has occurred.

Definition at line 51 of file usart_dma.h.

#define USARTD_ERROR_LOCK   2

USART driver is currently in use.

Definition at line 54 of file usart_dma.h.


Typedef Documentation

typedef void(* UsartdCallback)(uint8_t, void *)

USART transfer complete callback.

Definition at line 66 of file usart_dma.h.


Function Documentation

uint32_t USARTD_Configure ( UsartDma pUsartd,
uint8_t  usartId,
uint32_t  UsartMode,
uint32_t  BaudRate,
uint32_t  UsartClk 
)

Initializes the USARTDma structure and the corresponding USART & 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 USART command processing.

Parameters:
pUSARTD Pointer to a UsartDma instance.
pUsartHw Associated USART peripheral.
usartId USART peripheral identifier.
UsartClk USART clock.
pXdmad Pointer to a Dmad instance.

Definition at line 334 of file usart_dma.c.

Here is the call graph for this function:

uint32_t USARTD_DisableRxChannels ( UsartDma pUsartd,
UsartChannel 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 483 of file usart_dma.c.

Here is the call graph for this function:

uint32_t USARTD_DisableTxChannels ( UsartDma pUsartd,
UsartChannel 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 517 of file usart_dma.c.

Here is the call graph for this function:

uint32_t USARTD_EnableRxChannels ( UsartDma pUsartd,
UsartChannel pRxCh 
)

This function initialize 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 378 of file usart_dma.c.

Here is the call graph for this function:

uint32_t USARTD_EnableTxChannels ( UsartDma pUsartd,
UsartChannel pTxCh 
)

This function initialize 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 432 of file usart_dma.c.

Here is the call graph for this function:

uint32_t USARTD_RcvData ( UsartDma pUsartd  ) 

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

Parameters:
pUSARTD Pointer to a USARTDma instance.
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 570 of file usart_dma.c.

Here is the call graph for this function:

uint32_t USARTD_SendData ( UsartDma pUsartd  ) 

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

Parameters:
pUSARTD Pointer to a USARTDma instance.
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 550 of file usart_dma.c.

Here is the call graph for this function:

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines