All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
LPSCI DMA Driver
LPSCI: Universal Asynchronous Receiver/Transmitter

## Overview

## Data Structures

struct | lpsci_dma_handle_t
| LPSCI DMA handle. More...

## Typedefs

typedef void(* | lpsci_dma_transfer_callback_t )(UART0_Type *base, lpsci_dma_handle_t *handle, status_t status, void *userData)
| LPSCI transfer callback function. More...

## eDMA transactional

void | LPSCI_TransferCreateHandleDMA (UART0_Type *base, lpsci_dma_handle_t *handle, lpsci_dma_transfer_callback_t callback, void *userData, dma_handle_t *txDmaHandle, dma_handle_t *rxDmaHandle)
| Initializes the LPSCI handle which is used in transactional functions. More...
status_t | LPSCI_TransferSendDMA (UART0_Type *base, lpsci_dma_handle_t *handle, lpsci_transfer_t *xfer)
| Sends data using DMA. More...
status_t | LPSCI_TransferReceiveDMA (UART0_Type *base, lpsci_dma_handle_t *handle, lpsci_transfer_t *xfer)
| Receives data using DMA. More...
void | LPSCI_TransferAbortSendDMA (UART0_Type *base, lpsci_dma_handle_t *handle)
| Aborts the sent data using DMA. More...
void | LPSCI_TransferAbortReceiveDMA (UART0_Type *base, lpsci_dma_handle_t *handle)
| Aborts the receive data using DMA. More...
status_t | LPSCI_TransferGetSendCountDMA (UART0_Type *base, lpsci_dma_handle_t *handle, uint32_t *count)
| Gets the number of bytes written to the LPSCI TX register. More...
status_t | LPSCI_TransferGetReceiveCountDMA (UART0_Type *base, lpsci_dma_handle_t *handle, uint32_t *count)
| Gets the number of bytes that have been received. More...

## Data Structure Documentation

struct _lpsci_dma_handle

### Data Fields

UART0_Type * | base
| LPSCI peripheral base address. More...
lpsci_dma_transfer_callback_t | callback
| Callback function. More...
void * | userData
| UART callback function parameter. More...
size_t | rxDataSizeAll
| Size of the data to receive. More...
size_t | txDataSizeAll
| Size of the data to send out. More...
dma_handle_t * | txDmaHandle
| The DMA TX channel used. More...
dma_handle_t * | rxDmaHandle
| The DMA RX channel used. More...
volatile uint8_t | txState
| TX transfer state. More...
volatile uint8_t | rxState
| RX transfer state.

#### Field Documentation

UART0_Type* lpsci_dma_handle_t::base

lpsci_dma_transfer_callback_t lpsci_dma_handle_t::callback

void* lpsci_dma_handle_t::userData

size_t lpsci_dma_handle_t::rxDataSizeAll

size_t lpsci_dma_handle_t::txDataSizeAll

dma_handle_t* lpsci_dma_handle_t::txDmaHandle

dma_handle_t* lpsci_dma_handle_t::rxDmaHandle

volatile uint8_t lpsci_dma_handle_t::txState

## Typedef Documentation

typedef void(* lpsci_dma_transfer_callback_t)(UART0_Type *base, lpsci_dma_handle_t *handle, status_t status, void *userData)

## Function Documentation

void LPSCI_TransferCreateHandleDMA | ( | UART0_Type * | base,
|  | lpsci_dma_handle_t * | handle,
|  | lpsci_dma_transfer_callback_t | callback,
|  | void * | userData,
|  | dma_handle_t * | txDmaHandle,
|  | dma_handle_t * | rxDmaHandle
| ) |  |

Parameters

  handle | Pointer to lpsci_dma_handle_t structure
  base | LPSCI peripheral base address
  rxDmaHandle | User requested DMA handle for RX DMA transfer
  txDmaHandle | User requested DMA handle for TX DMA transfer

status_t LPSCI_TransferSendDMA | ( | UART0_Type * | base,
|  | lpsci_dma_handle_t * | handle,
|  | lpsci_transfer_t * | xfer
| ) |  |

This function sends data using DMA. This is a non-blocking function, which returns immediately. When all data is sent, the send callback function is called.

Parameters

  handle | LPSCI handle pointer.
  xfer | LPSCI DMA transfer structure, see lpsci_transfer_t.

Return values

  kStatus_Success | if successful, others failed.
  kStatus_LPSCI_TxBusy | Previous transfer on going.
  kStatus_InvalidArgument | Invalid argument.

status_t LPSCI_TransferReceiveDMA | ( | UART0_Type * | base,
|  | lpsci_dma_handle_t * | handle,
|  | lpsci_transfer_t * | xfer
| ) |  |

This function receives data using DMA. This is a non-blocking function, which returns immediately. When all data is received, the receive callback function is called.

Parameters

  handle | Pointer to lpsci_dma_handle_t structure
  xfer | LPSCI DMA transfer structure, see lpsci_transfer_t.

Return values

  kStatus_Success | if successful, others failed.
  kStatus_LPSCI_RxBusy | Previous transfer on going.
  kStatus_InvalidArgument | Invalid argument.

void LPSCI_TransferAbortSendDMA | ( | UART0_Type * | base,
|  | lpsci_dma_handle_t * | handle
| ) |  |

This function aborts the sent data using DMA.

Parameters

  handle | Pointer to lpsci_dma_handle_t structure.

void LPSCI_TransferAbortReceiveDMA | ( | UART0_Type * | base,
|  | lpsci_dma_handle_t * | handle
| ) |  |

This function aborts the receive data using DMA.

Parameters

  handle | Pointer to lpsci_dma_handle_t structure.

status_t LPSCI_TransferGetSendCountDMA | ( | UART0_Type * | base,
|  | lpsci_dma_handle_t * | handle,
|  | uint32_t * | count
| ) |  |

This function gets the number of bytes that have been written to the LPSCI TX register by DMA.

Parameters

  base | LPSCI peripheral base address.
  handle | LPSCI handle pointer.
  count | Send bytes count.

Return values

  kStatus_NoTransferInProgress | No send in progress.
  kStatus_InvalidArgument | Parameter is invalid.
  kStatus_Success | Get successfully through the parameter `count`;

status_t LPSCI_TransferGetReceiveCountDMA | ( | UART0_Type * | base,
|  | lpsci_dma_handle_t * | handle,
|  | uint32_t * | count
| ) |  |

This function gets the number of bytes that have been received.

Parameters

  base | LPSCI peripheral base address.
  handle | LPSCI handle pointer.
  count | Receive bytes count.

Return values

  kStatus_NoTransferInProgress | No receive in progress.
  kStatus_InvalidArgument | Parameter is invalid.
  kStatus_Success | Get successfully through the parameter `count`;