SDK provide eDMA transactional APIs to transfer data using eDMA, the eDMA method is similar with interrupt transactional method.
More...
- Note
- eDMA transactional functions use multiple beats method for better performance, in contrast, the blocking functions and interupt functions use single beat method. The function FLEXIO_MCULCD_ReadData, FLEXIO_MCULCD_WriteData, FLEXIO_MCULCD_GetStatusFlags, and FLEXIO_MCULCD_ClearStatusFlags are only used for single beat case, so don't use these functions to work together with eDMA functions.
FlexIO eDMA MCU Interface LCD Driver
FLEXIO LCD send/receive using a DMA method
flexio_MCULCD_edma_handle_t handle;
volatile bool completeFlag = false;
{
{
completeFlag = true;
}
}
void main(void)
{
xfer.command = command2;
xfer.dataAddrOrSameValue = (uint32_t)dataToSend;
xfer.dataCount = sizeof(dataToSend);
completeFlag = false;
while (!completeFlag)
{
}
xfer.command = command2;
xfer.dataAddrOrSameValue = value;
xfer.dataCount = 1000;
completeFlag = false;
while (!completeFlag)
{
}
xfer.command = command3;
xfer.dataAddrOrSameValue = (uint32_t)dataToReceive;
xfer.dataCount = sizeof(dataToReceive);
completeFlag = false;
while (!completeFlag)
{
}
}
|
| status_t | FLEXIO_MCULCD_TransferCreateHandleEDMA (FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle, flexio_mculcd_edma_transfer_callback_t callback, void *userData, edma_handle_t *txDmaHandle, edma_handle_t *rxDmaHandle) |
| | Initializes the FLEXO MCULCD master eDMA handle. More...
|
| |
| status_t | FLEXIO_MCULCD_TransferEDMA (FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle, flexio_mculcd_transfer_t *xfer) |
| | Performs a non-blocking FlexIO MCULCD transfer using eDMA. More...
|
| |
| void | FLEXIO_MCULCD_TransferAbortEDMA (FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle) |
| | Aborts a FlexIO MCULCD transfer using eDMA. More...
|
| |
| status_t | FLEXIO_MCULCD_TransferGetCountEDMA (FLEXIO_MCULCD_Type *base, flexio_mculcd_edma_handle_t *handle, size_t *count) |
| | Gets the remaining bytes for FlexIO MCULCD eDMA transfer. More...
|
| |
| struct _flexio_mculcd_edma_handle |
| uint8_t _flexio_mculcd_edma_handle::txShifterNum |
| uint8_t _flexio_mculcd_edma_handle::rxShifterNum |
| uint32_t _flexio_mculcd_edma_handle::minorLoopBytes |
| uint32_t _flexio_mculcd_edma_handle::dataAddrOrSameValue |
When writing or reading array, this is the address of the data array.
| size_t _flexio_mculcd_edma_handle::dataCount |
| volatile size_t _flexio_mculcd_edma_handle::remainingCount |
| volatile uint32_t _flexio_mculcd_edma_handle::state |
| #define FSL_FLEXIO_MCULCD_EDMA_DRIVER_VERSION (MAKE_VERSION(2, 0, 5)) |
When transfer finished, the callback function is called and returns the status as kStatus_FLEXIO_MCULCD_Idle.
This function initializes the FLEXO MCULCD master eDMA handle which can be used for other FLEXO MCULCD transactional APIs. For a specified FLEXO MCULCD instance, call this API once to get the initialized handle.
- Parameters
-
| base | Pointer to FLEXIO_MCULCD_Type structure. |
| handle | Pointer to flexio_mculcd_edma_handle_t structure to store the transfer state. |
| callback | MCULCD transfer complete callback, NULL means no callback. |
| userData | callback function parameter. |
| txDmaHandle | User requested eDMA handle for FlexIO MCULCD eDMA TX, the DMA request source of this handle should be the first of TX shifters. |
| rxDmaHandle | User requested eDMA handle for FlexIO MCULCD eDMA RX, the DMA request source of this handle should be the last of RX shifters. |
- Return values
-
| kStatus_Success | Successfully create the handle. |
This function returns immediately after transfer initiates. To check whether the transfer is completed, user could:
- Use the transfer completed callback;
- Polling function FLEXIO_MCULCD_GetTransferCountEDMA
- Parameters
-
| base | pointer to FLEXIO_MCULCD_Type structure. |
| handle | pointer to flexio_mculcd_edma_handle_t structure to store the transfer state. |
| xfer | Pointer to FlexIO MCULCD transfer structure. |
- Return values
-
| kStatus_Success | Successfully start a transfer. |
| kStatus_InvalidArgument | Input argument is invalid. |
| kStatus_FLEXIO_MCULCD_Busy | FlexIO MCULCD is not idle, it is running another transfer. |
- Parameters
-
| base | pointer to FLEXIO_MCULCD_Type structure. |
| handle | FlexIO MCULCD eDMA handle pointer. |
- Parameters
-
| base | pointer to FLEXIO_MCULCD_Type structure. |
| handle | FlexIO MCULCD eDMA handle pointer. |
| count | Number of count transferred so far by the eDMA transaction. |
- Return values
-
| kStatus_Success | Get the transferred count Successfully. |
| kStatus_NoTransferInProgress | No transfer in process. |