SPI0_S field descriptions
Field
Description
7
SPRF
SPI Read Buffer Full Flag
SPRF is set at the completion of an SPI transfer to indicate that received data may be read from the SPI
data (D) register. SPRF is cleared by reading SPRF while it is set and then reading the SPI data register.
0
No data available in the receive data buffer
1
Data available in the receive data buffer
6
SPMF
SPI Match Flag
SPMF is set after SPRF is 1 when the value in the receive data buffer matches the value in the M register.
To clear the flag, read SPMF when it is set and then write a 1 to it.
0
Value in the receive data buffer does not match the value in the M register
1
Value in the receive data buffer matches the value in the M register
5
SPTEF
SPI Transmit Buffer Empty Flag
This bit is set when the transmit data buffer is empty. SPTEF is cleared by reading the S register with
SPTEF set and then writing a data value to the transmit buffer at D. The S register must be read with
SPTEF set to 1 before writing data to the D register; otherwise, the D write is ignored. SPTEF is
automatically set when all data from the transmit buffer transfers into the transmit shift register. For an idle
SPI, data written to D is transferred to the shifter almost immediately so that SPTEF is set within two bus
cycles, allowing a second set of data to be queued into the transmit buffer. After completion of the transfer
of the data in the shift register, the queued data from the transmit buffer automatically moves to the shifter,
and SPTEF is set to indicate that room exists for new data in the transmit buffer. If no new data is waiting
in the transmit buffer, SPTEF simply remains set and no data moves from the buffer to the shifter.
If a transfer does not stop, the last data that was transmitted is sent out again.
0
SPI transmit buffer not empty
1
SPI transmit buffer empty
4
MODF
Master Mode Fault Flag
MODF is set if the SPI is configured as a master and the slave select input goes low, indicating some
other SPI device is also configured as a master. The SS pin acts as a mode fault error input only when
C1[MSTR] is 1, C2[MODFEN] is 1, and C1[SSOE] is 0; otherwise, MODF will never be set. MODF is
cleared by reading MODF while it is 1 and then writing to the SPI Control Register 1 (C1).
0
No mode fault error
1
Mode fault error detected
Reserved
This field is reserved.
This read-only field is reserved and always has the value 0.
29.3.5 SPI Data Register (SPIx_D)
This register is both the input and output register for SPI data. A write to the register
writes to the transmit data buffer, allowing data to be queued and transmitted.
When the SPI is configured as a master, data queued in the transmit data buffer is
transmitted immediately after the previous transmission has completed.
Chapter 29 Serial Peripheral Interface (SPI)
KL02 Sub-Family Reference Manual, Rev. 2.1, July 2013
Freescale Semiconductor, Inc.
453