MCUXpresso SDK API Reference Manual  Rev 2.15.000
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages

Overview

Data Structures

struct  _lpuart_edma_handle
 LPUART eDMA handle. More...
 

Typedefs

typedef void(* lpuart_edma_transfer_callback_t )(LPUART_Type *base, lpuart_edma_handle_t *handle, status_t status, void *userData)
 LPUART transfer callback function. More...
 

Driver version

#define FSL_LPUART_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 6, 0))
 LPUART EDMA driver version. More...
 

eDMA transactional

void LPUART_TransferCreateHandleEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_edma_transfer_callback_t callback, void *userData, edma_handle_t *txEdmaHandle, edma_handle_t *rxEdmaHandle)
 Initializes the LPUART handle which is used in transactional functions. More...
 
status_t LPUART_SendEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer)
 Sends data using eDMA. More...
 
status_t LPUART_ReceiveEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer)
 Receives data using eDMA. More...
 
void LPUART_TransferAbortSendEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle)
 Aborts the sent data using eDMA. More...
 
void LPUART_TransferAbortReceiveEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle)
 Aborts the received data using eDMA. More...
 
status_t LPUART_TransferGetSendCountEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count)
 Gets the number of bytes written to the LPUART TX register. More...
 
status_t LPUART_TransferGetReceiveCountEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count)
 Gets the number of received bytes. More...
 
void LPUART_TransferEdmaHandleIRQ (LPUART_Type *base, void *lpuartEdmaHandle)
 LPUART eDMA IRQ handle function. More...
 

Data Structure Documentation

struct _lpuart_edma_handle

Data Fields

lpuart_edma_transfer_callback_t callback
 Callback function. More...
 
void * userData
 LPUART 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...
 
edma_handle_ttxEdmaHandle
 The eDMA TX channel used. More...
 
edma_handle_trxEdmaHandle
 The eDMA RX channel used. More...
 
uint8_t nbytes
 eDMA minor byte transfer count initially configured. More...
 
volatile uint8_t txState
 TX transfer state. More...
 
volatile uint8_t rxState
 RX transfer state.
 

Field Documentation

lpuart_edma_transfer_callback_t _lpuart_edma_handle::callback
void* _lpuart_edma_handle::userData
size_t _lpuart_edma_handle::rxDataSizeAll
size_t _lpuart_edma_handle::txDataSizeAll
edma_handle_t* _lpuart_edma_handle::txEdmaHandle
edma_handle_t* _lpuart_edma_handle::rxEdmaHandle
uint8_t _lpuart_edma_handle::nbytes
volatile uint8_t _lpuart_edma_handle::txState

Macro Definition Documentation

#define FSL_LPUART_EDMA_DRIVER_VERSION   (MAKE_VERSION(2, 6, 0))

Typedef Documentation

typedef void(* lpuart_edma_transfer_callback_t)(LPUART_Type *base, lpuart_edma_handle_t *handle, status_t status, void *userData)

Function Documentation

void LPUART_TransferCreateHandleEDMA ( LPUART_Type *  base,
lpuart_edma_handle_t handle,
lpuart_edma_transfer_callback_t  callback,
void *  userData,
edma_handle_t txEdmaHandle,
edma_handle_t rxEdmaHandle 
)
Note
This function disables all LPUART interrupts.
Parameters
baseLPUART peripheral base address.
handlePointer to lpuart_edma_handle_t structure.
callbackCallback function.
userDataUser data.
txEdmaHandleUser requested DMA handle for TX DMA transfer.
rxEdmaHandleUser requested DMA handle for RX DMA transfer.
status_t LPUART_SendEDMA ( LPUART_Type *  base,
lpuart_edma_handle_t handle,
lpuart_transfer_t xfer 
)

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

Parameters
baseLPUART peripheral base address.
handleLPUART handle pointer.
xferLPUART eDMA transfer structure. See lpuart_transfer_t.
Return values
kStatus_Successif succeed, others failed.
kStatus_LPUART_TxBusyPrevious transfer on going.
kStatus_InvalidArgumentInvalid argument.
status_t LPUART_ReceiveEDMA ( LPUART_Type *  base,
lpuart_edma_handle_t handle,
lpuart_transfer_t xfer 
)

This function receives data using eDMA. This is non-blocking function, which returns right away. When all data is received, the receive callback function is called.

Parameters
baseLPUART peripheral base address.
handlePointer to lpuart_edma_handle_t structure.
xferLPUART eDMA transfer structure, see lpuart_transfer_t.
Return values
kStatus_Successif succeed, others fail.
kStatus_LPUART_RxBusyPrevious transfer ongoing.
kStatus_InvalidArgumentInvalid argument.
void LPUART_TransferAbortSendEDMA ( LPUART_Type *  base,
lpuart_edma_handle_t handle 
)

This function aborts the sent data using eDMA.

Parameters
baseLPUART peripheral base address.
handlePointer to lpuart_edma_handle_t structure.
void LPUART_TransferAbortReceiveEDMA ( LPUART_Type *  base,
lpuart_edma_handle_t handle 
)

This function aborts the received data using eDMA.

Parameters
baseLPUART peripheral base address.
handlePointer to lpuart_edma_handle_t structure.
status_t LPUART_TransferGetSendCountEDMA ( LPUART_Type *  base,
lpuart_edma_handle_t handle,
uint32_t *  count 
)

This function gets the number of bytes written to the LPUART TX register by DMA.

Parameters
baseLPUART peripheral base address.
handleLPUART handle pointer.
countSend bytes count.
Return values
kStatus_NoTransferInProgressNo send in progress.
kStatus_InvalidArgumentParameter is invalid.
kStatus_SuccessGet successfully through the parameter count;
status_t LPUART_TransferGetReceiveCountEDMA ( LPUART_Type *  base,
lpuart_edma_handle_t handle,
uint32_t *  count 
)

This function gets the number of received bytes.

Parameters
baseLPUART peripheral base address.
handleLPUART handle pointer.
countReceive bytes count.
Return values
kStatus_NoTransferInProgressNo receive in progress.
kStatus_InvalidArgumentParameter is invalid.
kStatus_SuccessGet successfully through the parameter count;
void LPUART_TransferEdmaHandleIRQ ( LPUART_Type *  base,
void *  lpuartEdmaHandle 
)

This function handles the LPUART tx complete IRQ request and invoke user callback. It is not set to static so that it can be used in user application.

Note
This function is used as default IRQ handler by double weak mechanism. If user's specific IRQ handler is implemented, make sure this function is invoked in the handler.
Parameters
baseLPUART peripheral base address.
lpuartEdmaHandleLPUART handle pointer.