49.7.7.9 FIFO Thresholds

Each Transmit and Receive FIFO includes a threshold feature used to set a flag and an interrupt when a FIFO threshold is crossed. Thresholds are defined as a number of data in the FIFO, and the FIFO state (TXFL or RXFL) represents the number of data currently in the FIFO.

The Transmit FIFO threshold can be set using SPI_FMR.TXFTHRES. Each time the Transmit FIFO goes from the ‘above threshold’ to the ‘equal or below threshold’ state, SPI_SR.TXFTHF is set. The application is warned that the Transmit FIFO has reached the defined threshold and that it can be reloaded.

The Receive FIFO threshold can be set using SPI_FMR.RXFTHRES. Each time the Receive FIFO goes from the ‘below threshold’ to the ‘equal or above threshold’ state, SPI_SR.RXFTHF is set. The application is warned that the Receive FIFO has reached the defined threshold and that it can be read to prevent an underflow.

The TXFTHF and RXFTHF flags can be configured to generate an interrupt using SPI_IER and SPI_IDR.