Hi There,
I was unable to change the Baud rate in LPSPI1 (the only one I tried) and I tracked it down to this logic in fsl_lpspi.c -> LPSPI_MasterSetBaudRate()
((base->CR & LPSPI_CR_MEN_MASK) != 0U)
For whatever reason this always evaluates as false, resulting in us sticking with the default 500K baud. Commenting out that check resolves the problem. The comment above says
"the LPSPI module needs to be disabled first, if enabled, return 0" but I'm not sure how to work around this since it always returns out and never resolves.
Here is my config:
const lpspi_master_config_t LPSPI1_config = {
.baudRate = 1000000UL,
.bitsPerFrame = 8UL,
.cpol = kLPSPI_ClockPolarityActiveHigh,
.cpha = kLPSPI_ClockPhaseFirstEdge,
.direction = kLPSPI_MsbFirst,
.pcsToSckDelayInNanoSec = 1000UL,
.lastSckToPcsDelayInNanoSec = 1000UL,
.betweenTransferDelayInNanoSec = 1000UL,
.whichPcs = kLPSPI_Pcs0,
.pcsActiveHighOrLow = kLPSPI_PcsActiveHigh,
.pinCfg = kLPSPI_SdiInSdoOut,
.dataOutConfig = kLpspiDataOutRetained
};