Hello,
We know how to set the CS pin in SPI as GPIO and toggle it manually to assert CS signal and negate the signal as well. I'm wondering if we can configure in registers in SPI and let the module control CS signal automatically?
That's my question. Thank you for any feedback.
Best Regards,
Hi,
This is done using commands to the PUSHR of the PUSH_TX_FIFO (see Reference manual 49.3.7, SPI_PUSHR). The most significant word contains the command to the SPI peripheral, including which CTAR register to use for the transfer and the PCS field contains which chip select line to use for the transfer. The CTAR contains the timing information for when the CS line is controlled with respect to the clock and data.
The low 16 bits of the PUSHR contain the data.
Hope that helps.