17#ifndef FSL_COMPONENT_ID
18#define FSL_COMPONENT_ID "platform.drivers.lpuart_edma"
22typedef struct _lpuart_edma_private_handle
43#define LPUART_HANDLE_ARRAY_SIZE 9
46#define LPUART_HANDLE_ARRAY_SIZE 8
49#define LPUART_HANDLE_ARRAY_SIZE 7
52#define LPUART_HANDLE_ARRAY_SIZE 6
55#define LPUART_HANDLE_ARRAY_SIZE 5
58#define LPUART_HANDLE_ARRAY_SIZE 4
61#define LPUART_HANDLE_ARRAY_SIZE 3
64#define LPUART_HANDLE_ARRAY_SIZE 2
67#define LPUART_HANDLE_ARRAY_SIZE 1
69#define LPUART_HANDLE_ARRAY_SIZE FSL_FEATURE_SOC_LPUART_COUNT
127 if (lpuartPrivateHandle->handle->callback)
129 lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle,
150 if (lpuartPrivateHandle->handle->callback)
152 lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle,
181 memset(handle, 0,
sizeof(*handle));
192#if defined(FSL_FEATURE_LPUART_HAS_FIFO) && FSL_FEATURE_LPUART_HAS_FIFO
203 base->WATER &= (~LPUART_WATER_RXWATER_MASK);
259 handle->
nbytes =
sizeof(uint8_t);
313 handle->
nbytes =
sizeof(uint8_t);
396 (uint32_t)handle->
nbytes *
427 (uint32_t)handle->
nbytes *
static BenchController instance
static void LPUART_ReceiveEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
LPUART EDMA receive finished callback function.
_lpuart_edma_tansfer_states
static lpuart_edma_private_handle_t s_edmaPrivateHandle[LPUART_HANDLE_ARRAY_SIZE]
static void LPUART_SendEDMACallback(edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
LPUART EDMA send finished callback function.
struct _lpuart_edma_private_handle lpuart_edma_private_handle_t
uint32_t EDMA_GetRemainingMajorLoopCount(DMA_Type *base, uint32_t channel)
Gets the remaining major loop count from the eDMA current channel TCD.
void EDMA_AbortTransfer(edma_handle_t *handle)
eDMA aborts transfer.
status_t EDMA_SubmitTransfer(edma_handle_t *handle, const edma_transfer_config_t *config)
Submits the eDMA transfer request.
void EDMA_SetCallback(edma_handle_t *handle, edma_callback callback, void *userData)
Installs a callback function for the eDMA transfer.
void EDMA_PrepareTransfer(edma_transfer_config_t *config, void *srcAddr, uint32_t srcWidth, void *destAddr, uint32_t destWidth, uint32_t bytesEachRequest, uint32_t transferBytes, edma_transfer_type_t type)
Prepares the eDMA transfer structure.
void EDMA_StartTransfer(edma_handle_t *handle)
eDMA starts transfer.
@ kEDMA_PeripheralToMemory
@ kEDMA_MemoryToPeripheral
int32_t status_t
Type used for all status and error return values.
@ kStatus_NoTransferInProgress
static void LPUART_EnableTxDMA(LPUART_Type *base, bool enable)
Enables or disables the LPUART transmitter DMA request.
uint32_t LPUART_GetInstance(LPUART_Type *base)
Get the LPUART instance from peripheral base address.
static void LPUART_EnableRxDMA(LPUART_Type *base, bool enable)
Enables or disables the LPUART receiver DMA.
static uint32_t LPUART_GetDataRegisterAddress(LPUART_Type *base)
Gets the LPUART data register address.
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.
status_t LPUART_SendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer)
Sends data using eDMA.
lpuart_edma_transfer_callback_t callback
status_t LPUART_TransferGetReceiveCountEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count)
Gets the number of received bytes.
void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle)
Aborts the sent data using eDMA.
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.
void(* lpuart_edma_transfer_callback_t)(LPUART_Type *base, lpuart_edma_handle_t *handle, status_t status, void *userData)
LPUART transfer callback function.
status_t LPUART_ReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer)
Receives data using eDMA.
edma_handle_t * rxEdmaHandle
edma_handle_t * txEdmaHandle
void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle)
Aborts the received data using eDMA.
eDMA transfer handle structure
eDMA transfer configuration
LPUART transfer structure.
static tstrWifiInitParam param