Hello Peter,
Does the function of "DSPI_HAL_SetPcsPolarityMode()" can meet your requirement ?
/*FUNCTION**********************************************************************
*
* Function Name : DSPI_HAL_SetPcsPolarityMode
* Description : Configure DSPI peripheral chip select polarity.
* This function will take in the desired peripheral chip select (PCS) and it's
* corresponding desired polarity and will configure the PCS signal to operate with the
* desired characteristic.
*
*END**************************************************************************/
void DSPI_HAL_SetPcsPolarityMode(SPI_Type * base, dspi_which_pcs_config_t pcs,
dspi_pcs_polarity_config_t activeLowOrHigh)
{
uint32_t temp;
temp = SPI_RD_MCR_PCSIS(base);
if (activeLowOrHigh == kDspiPcs_ActiveLow)
{
temp |= pcs;
}
else /* kDspiPcsPolarity_ActiveHigh */
{
temp &= ~(unsigned)pcs;
}
SPI_BWR_MCR_PCSIS(base, temp);
}
Hope it helps
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Have a great day,
Alice Yang