Hi there,
I've been trying to port some SPI code from basic KSDK 1.0.0 to MQX 4.1 (SPI not SPI legacy).
Code works smoothly in KSDK 1.0.0, but I notice some timing issues in MQX 4.1.
We use the following set delays in KSDK. Is there similar set delay functionality in MQX for SPI?
status = DSPI_DRV_MasterSetDelay(instance,
kDspiPcsToSck,
500, // delayInNanoSec
& calculatedPcsToSck);
if (status != kStatus_DSPI_Success)
return false;
status = DSPI_DRV_MasterSetDelay(instance,
kDspiLastSckToPcs,
500, // delayInNanoSec
& calculatedLastSckToPcs);
if (status != kStatus_DSPI_Success)
return false;
status = DSPI_DRV_MasterSetDelay(instance,
kDspiAfterTransfer,
500, // delayInNanoSec
& calculatedAfterTransfer);
if (status != kStatus_DSPI_Success)
return false;
Thanks,
Cecylia
Solved! Go to Solution.
Hmmmpf, doesn't seem like MQX has explicit IOCTLs to set delays (KSDK "DSPI_DRV_MasterSetDelay") but if you set the baud rate correctly, MQX' "_dspi_find_baudrate" will resolve it for you.
Hmmmpf, doesn't seem like MQX has explicit IOCTLs to set delays (KSDK "DSPI_DRV_MasterSetDelay") but if you set the baud rate correctly, MQX' "_dspi_find_baudrate" will resolve it for you.
I think in mqx, you can use wait function, but the resolution is not fine. Thank you for your sharing.