Example code for FLEXSPI_TransferNonBlocking usage

cancel
Showing results for 
Search instead for 
Did you mean: 

Example code for FLEXSPI_TransferNonBlocking usage

84 Views
Contributor II

Hello,

I didn't find any example code for using FLEXSPI_TransferNonBlocking

SDK examples all use FLEXSPI_TransferBlocking.

 

Can someone point me to relevant example code for i.MXRT1050?

Thank you.

Labels (1)
0 Kudos
1 Reply

54 Views
NXP TechSupport
NXP TechSupport

Hi

please refer to below code snippet.

-Initialize
FLEXSPI_Enable(((FLEXSPI_Type *)FLEXSPI_BASE), true);
FLEXSPI_GetDefaultConfig(&config);
FLEXSPI_Init(((FLEXSPI_Type *)FLEXSPI_BASE), &config);

 

flexspi_handle_t rc_handle;
flexspi_handle_t tr_handle;

FLEXSPI_TransferCreateHandle(((FLEXSPI_Type *)FLEXSPI_BASE), &tr_handle, NULL, 0
/*flexspi_transfer_callback_t callback,
void *userData*/);

FLEXSPI_TransferCreateHandle(((FLEXSPI_Type *)FLEXSPI_BASE), &rc_handle, NULL, 0
/*flexspi_transfer_callback_t callback,
void *userData*/);

-Read QSPI.
status = FLEXSPI_TransferNonBlocking(((FLEXSPI_Type *)FLEXSPI_BASE), &rc_handle, &rc_data);

while((status = FLEXSPI_TransferGetCount (((FLEXSPI_Type *)FLEXSPI_BASE), &rc_handle, &count )) == kStatus_FLEXSPI_Busy);

 

 

Regards

Daniel

0 Kudos