SPI_CR

SPI Control Register

This register can only be written if the WPCREN bit is cleared in the SPI Write Protection Mode Register.

  0x00 32 Write-only –  

SPI Control Register

Bit  31 30 29 28 27 26 25 24  
                LASTXFER  
Access                W  
Reset                 
Bit  23 22 21 20 19 18 17 16  
                   
Access                   
Reset                   
Bit  15 14 13 12 11 10 9 8  
        REQCLR          
Access        W          
Reset                 
Bit  7 6 5 4 3 2 1 0  
  SWRST           SPIDIS SPIEN  
Access  W           W W  
Reset             

Bit 0 – SPIEN: SPI Enable

SPI Enable

ValueDescription
0

No effect.

1

Enables the SPI to transfer and receive data.

Bit 1 – SPIDIS: SPI Disable

SPI Disable

All pins are set in Input mode after completion of the transmission in progress, if any.

If a transfer is in progress when SPIDIS is set, the SPI completes the transmission of the shifter register and does not start any new transfer, even if SPI_THR is loaded.

If both SPIEN and SPIDIS are equal to one when SPI_CR is written, the SPI is disabled.

ValueDescription
0

No effect.

1

Disables the SPI.

Bit 7 – SWRST: SPI Software Reset

SPI Software Reset

The SPI is in Slave mode after software reset.

ValueDescription
0

No effect.

1

Reset the SPI. A software-triggered hardware reset of the SPI interface is performed.

Bit 12 – REQCLR: Request to Clear the Comparison Trigger

Request to Clear the Comparison Trigger

0: No effect.

1: Restarts the comparison trigger to enable SPI_RDR loading.

Bit 24 – LASTXFER: Last Transfer

Last Transfer

Refer to section Peripheral Selection for more details.

ValueDescription
0

No effect.

1

The current NPCS is deasserted after the character written in TD has been transferred. When SPI_CSRx.CSAAT is set, the communication with the current serial peripheral can be closed by raising the corresponding NPCS line as soon as TD transfer is completed.