rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Typedefs | Enumerations | Functions | Variables
fsl_lpuart_edma.c File Reference

Typedefs

typedef struct _lpuart_edma_private_handle lpuart_edma_private_handle_t
 

Enumerations

enum  _lpuart_edma_tansfer_states { kLPUART_TxIdle , kLPUART_TxBusy , kLPUART_RxIdle , kLPUART_RxBusy }
 

Functions

static void LPUART_SendEDMACallback (edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
 LPUART EDMA send finished callback function.
 
static void LPUART_ReceiveEDMACallback (edma_handle_t *handle, void *param, bool transferDone, uint32_t tcds)
 LPUART EDMA receive finished callback function.
 
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.
 
status_t LPUART_SendEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer)
 Sends data using eDMA.
 
status_t LPUART_ReceiveEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, lpuart_transfer_t *xfer)
 Receives data using eDMA.
 
void LPUART_TransferAbortSendEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle)
 Aborts the sent data using eDMA.
 
void LPUART_TransferAbortReceiveEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle)
 Aborts the received data using eDMA.
 
status_t LPUART_TransferGetReceiveCountEDMA (LPUART_Type *base, lpuart_edma_handle_t *handle, uint32_t *count)
 Gets the number of received bytes.
 
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.
 

Variables

static lpuart_edma_private_handle_t s_edmaPrivateHandle [LPUART_HANDLE_ARRAY_SIZE]
 

Typedef Documentation

◆ lpuart_edma_private_handle_t

typedef struct _lpuart_edma_private_handle lpuart_edma_private_handle_t

Enumeration Type Documentation

◆ _lpuart_edma_tansfer_states

Enumerator
kLPUART_TxIdle 
kLPUART_TxBusy 
kLPUART_RxIdle 
kLPUART_RxBusy 

Definition at line 29 of file fsl_lpuart_edma.c.

30{
31 kLPUART_TxIdle, /* TX idle. */
32 kLPUART_TxBusy, /* TX busy. */
33 kLPUART_RxIdle, /* RX idle. */
34 kLPUART_RxBusy /* RX busy. */
35};
@ kLPUART_TxIdle
@ kLPUART_RxBusy
@ kLPUART_TxBusy
@ kLPUART_RxIdle

Function Documentation

◆ LPUART_ReceiveEDMACallback()

static void LPUART_ReceiveEDMACallback ( edma_handle_t handle,
void *  param,
bool  transferDone,
uint32_t  tcds 
)
static

LPUART EDMA receive finished callback function.

This function is called when LPUART EDMA receive finished. It disables the LPUART RX EDMA request and sends kStatus_LPUART_RxIdle to LPUART callback.

Parameters
handleThe EDMA handle.
paramCallback function parameter.

Definition at line 135 of file fsl_lpuart_edma.c.

136{
137 assert(param);
138
140
141 /* Avoid warning for unused parameters. */
142 handle = handle;
143 tcds = tcds;
144
145 if (transferDone)
146 {
147 /* Disable transfer. */
148 LPUART_TransferAbortReceiveEDMA(lpuartPrivateHandle->base, lpuartPrivateHandle->handle);
149
150 if (lpuartPrivateHandle->handle->callback)
151 {
152 lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle,
153 kStatus_LPUART_RxIdle, lpuartPrivateHandle->handle->userData);
154 }
155 }
156}
struct _lpuart_edma_private_handle lpuart_edma_private_handle_t
@ kStatus_LPUART_RxIdle
Definition fsl_lpuart.h:34
void LPUART_TransferAbortReceiveEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle)
Aborts the received data using eDMA.
static tstrWifiInitParam param

Referenced by LPUART_TransferCreateHandleEDMA().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LPUART_SendEDMACallback()

static void LPUART_SendEDMACallback ( edma_handle_t handle,
void *  param,
bool  transferDone,
uint32_t  tcds 
)
static

LPUART EDMA send finished callback function.

This function is called when LPUART EDMA send finished. It disables the LPUART TX EDMA request and sends kStatus_LPUART_TxIdle to LPUART callback.

Parameters
handleThe EDMA handle.
paramCallback function parameter.

Definition at line 113 of file fsl_lpuart_edma.c.

114{
115 assert(param);
116
118
119 /* Avoid the warning for unused variables. */
120 handle = handle;
121 tcds = tcds;
122
123 if (transferDone)
124 {
125 LPUART_TransferAbortSendEDMA(lpuartPrivateHandle->base, lpuartPrivateHandle->handle);
126
127 if (lpuartPrivateHandle->handle->callback)
128 {
129 lpuartPrivateHandle->handle->callback(lpuartPrivateHandle->base, lpuartPrivateHandle->handle,
130 kStatus_LPUART_TxIdle, lpuartPrivateHandle->handle->userData);
131 }
132 }
133}
@ kStatus_LPUART_TxIdle
Definition fsl_lpuart.h:33
void LPUART_TransferAbortSendEDMA(LPUART_Type *base, lpuart_edma_handle_t *handle)
Aborts the sent data using eDMA.

Referenced by LPUART_TransferCreateHandleEDMA().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_edmaPrivateHandle

lpuart_edma_private_handle_t s_edmaPrivateHandle[LPUART_HANDLE_ARRAY_SIZE]
static

Definition at line 81 of file fsl_lpuart_edma.c.

Referenced by LPUART_TransferCreateHandleEDMA().

Go to the source code of this file.