MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
FlexIO eDMA MCU Interface LCD Driver

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_MCULCD_edma_handle_t handle;
volatile bool completeFlag = false;
edma_handle_t rxEdmaHandle;
edma_handle_t txEdmaHandle;
void flexioLcdCallback(FLEXIO_MCULCD_Type *base, flexio_MCULCD_edma_handle_t *handle, status_t status, void *userData)
{
{
completeFlag = true;
}
}
void main(void)
{
// Create the edma Handle.
EDMA_CreateHandle(&rxEdmaHandle, DMA0, channel);
EDMA_CreateHandle(&txEdmaHandle, DMA0, channel);
// Configure the DMAMUX.
// ...
// rxEdmaHandle should use the last FlexIO RX shifters as DMA requst source.
// txEdmaHandle should use the first FlexIO TX shifters as DMA requst source.
// Init the FlexIO LCD driver.
// Create the transactional handle.
FLEXIO_MCULCD_TransferCreateHandleEDMA(&flexioLcdDev, &handle, flexioLcdCallback, NULL, &txEdmaHandle, &rxEdmaHandle);
xfer.command = command2;
xfer.dataAddrOrSameValue = (uint32_t)dataToSend;
xfer.dataCount = sizeof(dataToSend);
completeFlag = false;
FLEXIO_MCULCD_TransferEDMA(&flexioLcdDev, &handle, &xfer);
while (!completeFlag)
{
}
xfer.command = command2;
xfer.dataAddrOrSameValue = value;
xfer.dataCount = 1000;
completeFlag = false;
FLEXIO_MCULCD_TransferEDMA(&flexioLcdDev, &handle, &xfer);
while (!completeFlag)
{
}
xfer.command = command3;
xfer.dataAddrOrSameValue = (uint32_t)dataToReceive;
xfer.dataCount = sizeof(dataToReceive);
completeFlag = false;
FLEXIO_MCULCD_TransferEDMA(&flexioLcdDev, &handle, &xfer);
while (!completeFlag)
{
}
}