The M480 SPI supports full-duplex mode and half-duplex mode. When an external SPI device is connected only for one-way reception or transmission, the half-duplex mode can be used, so that another unused SPI pin can be used for other functions. This allows for more flexible pin assignment.
User can set HALFDPX (SPIx_CTL ) register to enable half-duplex mode. The SPI transfer direction can be set via the DATDIR (SPIx_CTL ) register. In addition, when half-duplex mode is enabled or disabled, the data in the TX and RX FIFO will be automatically cleared.