The master transmit and receive mode is programmable by the TRM bit of the SPI_CHCONF register. The channel access to the shift registers is based on its transmitter and receiver register state.
- The channel can be scheduled for transmission or reception only when enabled (EN bit of the SPI_CHCTRL register).
- An enabled channel can be scheduled if its transmitter register is not empty (TXS bit of the SPI_CHSTAT register) or its FIFO is not empty, or if the buffer is used (FFE bit of the MCSPI_CHSTAT register) and updated with new data at the time of shift register assignment. If the transmitter register or FIFO is empty at the time of shift register assignment, the TX_underflow event is activated.
- An enabled channel can be scheduled if its receive register is not full (RXS bit of the SPI_CHSTAT register), or its FIFO is not full if the buffer is used (FFF bit of the MCSPI_CHSTAT register) at the time of shift register assignment. Thus, the receiver register of FIFO cannot be overwritten. The RX_overflow bit in the SPI_IRQSTATUS register is never set in this mode.
The built-in FIFO is available in this mode, and can be configured in one or both data directions for transmit or receive. The FIFO is seen as a 64-byte buffer if configured for one data direction. If configured in both data directions (transmit and receive), the FIFO is split into two separate 32-byte buffers with their own address space management. In this case, the definition of the AEL and AFL levels is based on 32 bytes, and is the responsibility of the local host.