Hi
For your application need to check the SPI input data value, which need to add related code with SPI communication handler.
The KSDK driver code could provide some flexible usage, such as DSPI_StopTransfer() function to stop the SPI transfer.
/*!
* @brief Stops (halts) DSPI transfers and sets HALT bit in MCR.
*
* This function stops data transfers in either master or slave mode.
*
* @param base DSPI peripheral address.
*/
static inline void DSPI_StopTransfer(SPI_Type *base)
{
base->MCR |= SPI_MCR_HALT_MASK;
}
Wish it helps.
Have a great day,
Ma Hui
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------