SPI FullDuplex_SoftNSS Example ,需要注意这个例程的NSS是使用软件,不是硬件方式管理。
Example description =================== This example provides a description of how to set a communication between the two SPIs in full-duplex mode and performs a transfer from Master to Slave and then Slave to Master in the same application with software NSS management.
Both SPIs are configured with 8bit data frame and a 9Mbit/s communication speed. In the first phase, the master SPI1 starts the SPI1_Buffer_Tx transfer while the slave SPI2 transmit SPI2_Buffer_Tx. Once the transfer is completed a comparison is done and TransferStatus1 and TransferStatus2 gives the data transfer status for each data transfer direction where it is PASSED if transmitted and received data are the same otherwise it is FAILED.
As the NSS pin is managed by software, this permit to SPI1 to become slave and SPI2 to become master whithout hardware modification。
In the second step, the slave SPI1 starts the SPI1_Buffer_Tx transfer while the master SPI2 transmit SPI2_Buffer_Tx. Once the transfer is completed a comparison is done and TransferStatus3 and TransferStatus4 gives the data transfer status for each data transfer direction where it is PASSED if transmitted and received data are the same otherwise it is FAILED.