\n

SPI

Peripheral Memory Blocks

address_offset : 0x0 Bytes (0x0)
size : 0x400 byte (0x0)
mem_usage : registers
protection :

Registers

SPI_CR1

SPI_IER

SPI_SR

SPI_IFCR

SPI_AUTOCR

SPI_TXDR

SPI_RXDR

SPI_CR2

SPI_CRCPOLY

SPI_TXCRC

SPI_RXCRC

SPI_UDRDR

SPI_CFG1

SPI_CFG2


SPI_CR1


address_offset : 0x0 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_CR1 SPI_CR1 read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 SPE MASRX CSTART CSUSP HDDIR SSI CRC33_17 RCRCINI TCRCINI IOLOCK

SPE : serial peripheral enable This bit is set by and cleared by software. When SPE=1, SPI data transfer is enabled, SPI_CFG1 and SPI_CFG2 configuration registers, CRCPOLY, UDRDR, part of SPI_AUTOCR register and IOLOCK bit in the SPI_CR1 register are write protected. They can be changed only when SPE=0. When SPE=0 any SPI operation is stopped and disabled, all the pending requests of the events with enabled interrupt are blocked except the MODF interrupt request (but their pending still propagates the request of the spi_plck clock), the SS output is deactivated at master, the RDY signal keeps not ready status at slave, the internal state machine is reseted, all the FIFOs content is flushed, CRC calculation initialized, receive data register is read zero. SPE is cleared and cannot be set when MODF error flag is active.
bits : 0 - 0 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

Serial peripheral disabled.

0x1 : B_0x1

Serial peripheral enabled

End of enumeration elements list.

MASRX : master automatic suspension in Receive mode This bit is set and cleared by software to control continuous SPI transfer in master receiver mode and automatic management in order to avoid overrun condition. When SPI communication is suspended by hardware automatically, it could happen that few bits of next frame are already clocked out due to internal synchronization delay. This is why, the automatic suspension is not quite reliable when size of data drops below 8 bits. In this case, a safe suspension can be achieved by combination with delay inserted between data frames applied when MIDI parameter keeps a non zero value sum of data size and the interleaved SPI cycles should always produce interval at length of 8 SPI clock periods at minimum. After software clearing of the SUSP bit, the communication resumes and continues by subsequent bits transaction without any next constraint. Prior the SUSP bit is cleared, the user must release the RxFIFO space as much as possible by reading out all the data packets available at RxFIFO based on the RXP flag indication to prevent any subsequent suspension.
bits : 8 - 8 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SPI flow/clock generation is continuous, regardless of overrun condition. (data are lost)

0x1 : B_0x1

SPI flow is suspended temporary on RxFIFO full condition, before reaching overrun condition. The SUSP flag is set when the SPI communication is suspended.

End of enumeration elements list.

CSTART : master transfer start This bit can be set by software if SPI is enabled only to start an SPI communication. it is cleared by hardware when end of transfer (EOT) flag is set or when a transaction suspend request is accepted. In SPI mode, the bit is taken into account at master mode only. If transmission is enabled, communication starts or continues only if any data is available in the transmission FIFO.
bits : 9 - 9 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

master transfer is at idle

0x1 : B_0x1

master transfer is on-going or temporary suspended by automatic suspend

End of enumeration elements list.

CSUSP : master SUSPend request This bit reads as zero. In Master mode, when this bit is set by software, the CSTART bit is reset at the end of the current frame and SPI communication is suspended. The user has to check SUSP flag to check end of the frame transaction. The Master mode communication must be suspended (using this bit or keeping TXDR empty) before disabling the SPI or going to Low-power mode. After software suspension, SUSP flag has to be cleared and SPI disabled and re-enabled before the next transaction starts.
bits : 10 - 10 (1 bit)
access : write-only

HDDIR : Rx/Tx direction at Half-duplex mode In Half-Duplex configuration the HDDIR bit establishes the Rx/Tx direction of the data transfer. This bit is ignored in Full-Duplex or any Simplex configuration.
bits : 11 - 11 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SPI is Receiver

0x1 : B_0x1

SPI is transmitter

End of enumeration elements list.

SSI : internal SS signal input level This bit has an effect only when the SSM bit is set. The value of this bit is forced onto the peripheral SS input internally and the I/O value of the SS pin is ignored.
bits : 12 - 12 (1 bit)
access : read-write

CRC33_17 : 32-bit CRC polynomial configuration
bits : 13 - 13 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

Full size (33-bit or 17-bit) CRC polynomial is not used

0x1 : B_0x1

Full size (33-bit or 17-bit) CRC polynomial is used

End of enumeration elements list.

RCRCINI : CRC calculation initialization pattern control for receiver
bits : 14 - 14 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

All zero pattern is applied

0x1 : B_0x1

All ones pattern is applied

End of enumeration elements list.

TCRCINI : CRC calculation initialization pattern control for transmitter
bits : 15 - 15 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

all zero pattern is applied

0x1 : B_0x1

all ones pattern is applied

End of enumeration elements list.

IOLOCK : locking the AF configuration of associated IOs This bit is set by software and cleared by hardware whenever the SPE bit is changed from 1 to 0. When this bit is set, SPI_CFG2 register content cannot be modified. This bit can be set when SPI is disabled only else it is write protected. It is cleared and cannot be set when MODF bit is set.
bits : 16 - 16 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

AF configuration is not locked

0x1 : B_0x1

AF configuration is locked

End of enumeration elements list.


SPI_IER


address_offset : 0x10 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_IER SPI_IER read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RXPIE TXPIE DXPIE EOTIE TXTFIE UDRIE OVRIE CRCEIE TIFREIE MODFIE

RXPIE : RXP interrupt enable
bits : 0 - 0 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

RXP interrupt disabled

0x1 : B_0x1

RXP interrupt enabled

End of enumeration elements list.

TXPIE : TXP interrupt enable TXPIE is set by software and cleared by TXTF flag set event.
bits : 1 - 1 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

TXP interrupt disabled

0x1 : B_0x1

TXP interrupt enabled

End of enumeration elements list.

DXPIE : DXP interrupt enabled DXPIE is set by software and cleared by TXTF flag set event.
bits : 2 - 2 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

DXP interrupt disabled

0x1 : B_0x1

DXP interrupt enabled

End of enumeration elements list.

EOTIE : EOT, SUSP and TXC interrupt enable
bits : 3 - 3 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

EOT/SUSP/TXC interrupt disabled

0x1 : B_0x1

EOT/SUSP/TXC interrupt enabled

End of enumeration elements list.

TXTFIE : TXTFIE interrupt enable
bits : 4 - 4 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

TXTF interrupt disabled

0x1 : B_0x1

TXTF interrupt enabled

End of enumeration elements list.

UDRIE : UDR interrupt enable
bits : 5 - 5 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

UDR interrupt disabled

0x1 : B_0x1

UDR interrupt enabled

End of enumeration elements list.

OVRIE : OVR interrupt enable
bits : 6 - 6 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

OVR interrupt disabled

0x1 : B_0x1

OVR interrupt enabled

End of enumeration elements list.

CRCEIE : CRC error interrupt enable
bits : 7 - 7 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

CRC interrupt disabled

0x1 : B_0x1

CRC interrupt enabled

End of enumeration elements list.

TIFREIE : TIFRE interrupt enable
bits : 8 - 8 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

TIFRE interrupt disabled

0x1 : B_0x1

TIFRE interrupt enabled

End of enumeration elements list.

MODFIE : mode Fault interrupt enable
bits : 9 - 9 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

MODF interrupt disabled

0x1 : B_0x1

MODF interrupt enabled

End of enumeration elements list.


SPI_SR


address_offset : 0x14 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_SR SPI_SR read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RXP TXP DXP EOT TXTF UDR OVR CRCE TIFRE MODF SUSP TXC RXPLVL RXWNE CTSIZE

RXP : Rx-Packet available RXP flag is changed by hardware. It monitors number of overall data currently available at RxFIFO if SPI is enabled. It has to be checked once a data packet is completely read out from RxFIFO.
bits : 0 - 0 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

RxFIFO is empty or a not complete data packet is received

0x1 : B_0x1

RxFIFO contains at least 1 data packet

End of enumeration elements list.

TXP : Tx-Packet space available TXP flag is changed by hardware. It monitors overall space currently available at TxFIFO no matter if SPI is enabled or not. It has to be checked once a complete data packet is stored at TxFIFO.
bits : 1 - 1 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

there is not enough space to locate next data packet at TxFIFO

0x1 : B_0x1

TxFIFO has enough free location to host 1 data packet

End of enumeration elements list.

DXP : duplex packet DXP flag is set whenever both TXP and RXP flags are set regardless SPI mode.
bits : 2 - 2 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

TxFIFO is Full and/or RxFIFO is Empty

0x1 : B_0x1

both TxFIFO has space for write and RxFIFO contains for read a single packet at least

End of enumeration elements list.

EOT : end of transfer EOT is set by hardware as soon as a full transfer is complete, that is when TSIZE number of data have been transmitted and/or received on the SPI. EOT is cleared by software write 1 to EOTC bit at SPI_IFCR. EOT flag triggers an interrupt if EOTIE bit is set. If DXP flag is used until TXTF flag is set and DXPIE is cleared, EOT can be used to download the last packets contained into RxFIFO in one-shot. In master, EOT event terminates the data transaction and handles SS output optionally. When CRC is applied, the EOT event is extended over the CRC frame transaction. To restart the internal state machine properly, SPI is strongly suggested to be disabled and re-enabled before next transaction starts despite its setting is not changed.
bits : 3 - 3 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

transfer is on-going or not started

0x1 : B_0x1

transfer complete

End of enumeration elements list.

TXTF : transmission transfer filled TXTF is set by hardware as soon as all of the data packets in a transfer have been submitted for transmission by application software or DMA, that is when TSIZE number of data have been pushed into the TxFIFO. This bit is cleared by software write 1 to TXTFC bit at SPI_IFCR TXTF flag triggers an interrupt if TXTFIE bit is set. TXTF setting clears the TXPIE and DXPIE masks so to off-load application software from calculating when to disable TXP and DXP interrupts.
bits : 4 - 4 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

upload of TxFIFO is on-going or not started

0x1 : B_0x1

TxFIFO upload is finished

End of enumeration elements list.

UDR : underrun at slave transmission mode This bit is cleared by writing 1 to UDRC bit at SPI_IFCR Note: UDR flag applies to Slave mode only
bits : 5 - 5 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

no underrun

0x1 : B_0x1

underrun detected

End of enumeration elements list.

OVR : overrun This bit is cleared by writing 1 to OVRC bit at SPI_IFCR
bits : 6 - 6 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

no overrun

0x1 : B_0x1

overrun detected

End of enumeration elements list.

CRCE : CRC error This bit is cleared by writing 1 to CRCEC bit at SPI_IFCR
bits : 7 - 7 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

no CRC error

0x1 : B_0x1

CRC error detected

End of enumeration elements list.

TIFRE : TI frame format error This bit is cleared by writing 1 to TIFREC bit at SPI_IFCR
bits : 8 - 8 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

no TI Frame Error

0x1 : B_0x1

TI frame error detected

End of enumeration elements list.

MODF : mode fault This bit is cleared by writing 1 to MODFC bit at SPI_IFCR
bits : 9 - 9 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

no mode fault

0x1 : B_0x1

mode fault detected. When MODF is set, SPE and IOLOCK bits at SPI_CR1 register are reset and their setting is blocked.

End of enumeration elements list.

SUSP : suspension status In Master mode, SUSP is set by hardware either as soon as the current frame is completed after CSUSP request is done or at master automatic suspend receive mode (MASRX bit is set at SPI_CR1 register) on RxFIFO full condition. SUSP generates an interrupt when EOTIE is set. This bit has to be cleared prior SPI is disabled by writing 1 to SUSPC bit at SPI_IFCR.
bits : 11 - 11 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

SPI not suspended (Master mode active or other mode).

0x1 : B_0x1

Master mode is suspended (current frame completed).

End of enumeration elements list.

TXC : TxFIFO transmission complete The flag behavior depends on TSIZE setting. When TSIZE=0 the TXC is changed by hardware exclusively and it raises each time the TxFIFO becomes empty and there is no activity on the bus. If TSIZE <>0 there is no specific reason to monitor TXC as it just copies the EOT flag value including its software clearing. The TXC generates an interrupt when EOTIE is set.
bits : 12 - 12 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

current data transaction is still ongoing, data is available in TxFIFO or last frame transmission is on going.

0x1 : B_0x1

last TxFIFO frame transmission complete

End of enumeration elements list.

RXPLVL : RxFIFO packing level When RXWNE=0 and data size is set up to 16-bit, the value gives number of remaining data frames persisting at RxFIFO. Note: (*): Optional value when data size is set up to 8-bit only. When data size is greater than 16-bit, these bits are always read as 00. In that consequence, the single data frame received at the FIFO cannot be detected neither by RWNE nor by RXPLVL bits if data size is set from 17 to 24 bits. The user then must apply other methods like TSIZE>0 or FTHLV=0.
bits : 13 - 14 (2 bit)
access : read-only

Enumeration:

0x0 : B_0x0

no next frame is available at RxFIFO

0x1 : B_0x1

1 frame is available

0x2 : B_0x2

2 frames are available*

0x3 : B_0x3

3 frames are available*

End of enumeration elements list.

RXWNE : RxFIFO word not empty Note: This bit value does not depend on DSIZE setting and keeps together with RXPLVL[1:0] information about RxFIFO occupancy by residual data.
bits : 15 - 15 (1 bit)
access : read-only

Enumeration:

0x0 : B_0x0

less than four bytes of RxFIFO space is occupied by data

0x1 : B_0x1

at least four bytes of RxFIFO space is occupied by data

End of enumeration elements list.

CTSIZE : number of data frames remaining in current TSIZE session The value is not quite reliable when traffic is ongoing on bus or during autonomous operation at low-power mode. Note: CTSIZE[15:0] bits are not available at instances with limited set of features
bits : 16 - 31 (16 bit)
access : read-only


SPI_IFCR


address_offset : 0x18 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_IFCR SPI_IFCR read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 EOTC TXTFC UDRC OVRC CRCEC TIFREC MODFC SUSPC

EOTC : end of transfer flag clear Writing a 1 into this bit clears EOT flag in the SPI_SR register
bits : 3 - 3 (1 bit)
access : write-only

TXTFC : transmission transfer filled flag clear Writing a 1 into this bit clears TXTF flag in the SPI_SR register
bits : 4 - 4 (1 bit)
access : write-only

UDRC : underrun flag clear Writing a 1 into this bit clears UDR flag in the SPI_SR register
bits : 5 - 5 (1 bit)
access : write-only

OVRC : overrun flag clear Writing a 1 into this bit clears OVR flag in the SPI_SR register
bits : 6 - 6 (1 bit)
access : write-only

CRCEC : CRC error flag clear Writing a 1 into this bit clears CRCE flag in the SPI_SR register
bits : 7 - 7 (1 bit)
access : write-only

TIFREC : TI frame format error flag clear Writing a 1 into this bit clears TIFRE flag in the SPI_SR register
bits : 8 - 8 (1 bit)
access : write-only

MODFC : mode fault flag clear Writing a 1 into this bit clears MODF flag in the SPI_SR register
bits : 9 - 9 (1 bit)
access : write-only

SUSPC : SUSPend flag clear Writing a 1 into this bit clears SUSP flag in the SPI_SR register
bits : 11 - 11 (1 bit)
access : write-only


SPI_AUTOCR


address_offset : 0x1C Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_AUTOCR SPI_AUTOCR read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 TRIGSEL TRIGPOL TRIGEN

TRIGSEL : trigger selection (refer ). ... Note: these bits can be written only when SPE = 0.
bits : 16 - 19 (4 bit)
access : read-write

Enumeration:

0x0 : B_0x0

spi_trg0 is selected

0x1 : B_0x1

spi_trg1 is selected

0xF : B_0xF

spi_trg15 is selected

End of enumeration elements list.

TRIGPOL : trigger polarity Note: This bit can be written only when SPE = 0.
bits : 20 - 20 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

trigger is active on raising edge

0x1 : B_0x1

trigger is active on falling edge

End of enumeration elements list.

TRIGEN : trigger of CSTART control enable Note: if user can't prevent trigger event during write, the TRIGEN has to be changed when SPI is disabled
bits : 21 - 21 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

trigger of CSTART control disabled

0x1 : B_0x1

trigger of CSTART control enabled

End of enumeration elements list.


SPI_TXDR


address_offset : 0x20 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_TXDR SPI_TXDR read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 TXDR

TXDR : transmit data register The register serves as an interface with TxFIFO. A write to it accesses TxFIFO. Note: data is always right-aligned. Unused bits are ignored when writing to the register, and read as zero when the register is read. Note: DR can be accessed byte-wise (8-bit access): in this case only one data-byte is written by single access. halfword-wise (16 bit access) in this case 2 data-bytes or 1 halfword-data can be written by single access. word-wise (32 bit access). In this case 4 data-bytes or 2 halfword-data or word-data can be written by single access. Write access of this register less than the configured data size is forbidden.
bits : 0 - 31 (32 bit)
access : write-only


SPI_RXDR


address_offset : 0x30 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_RXDR SPI_RXDR read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RXDR

RXDR : receive data register The register serves as an interface with RxFIFO. When it is read, RxFIFO is accessed. Note: data is always right-aligned. Unused bits are read as zero when the register is read. Writing to the register is ignored. Note: DR can be accessed byte-wise (8-bit access): in this case only one data-byte is read by single access halfword-wise (16 bit access) in this case 2 data-bytes or 1 halfword-data can be read by single access word-wise (32 bit access). In this case 4 data-bytes or 2 halfword-data or word-data can be read by single access. Read access of this register less than the configured data size is forbidden.
bits : 0 - 31 (32 bit)
access : read-only


SPI_CR2


address_offset : 0x4 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_CR2 SPI_CR2 read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 TSIZE

TSIZE : number of data at current transfer When these bits are changed by software, the SPI has to be disabled. Endless transaction is initialized when CSTART is set while zero value is stored at TSIZE. TSIZE cannot be set to 0xFFFF respective 0x3FFF value when CRC is enabled. Note: TSIZE[15:10] bits are reserved at limited feature set instances and must be kept at reset value.
bits : 0 - 15 (16 bit)
access : read-write


SPI_CRCPOLY

SPI polynomial register
address_offset : 0x40 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_CRCPOLY SPI_CRCPOLY read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 CRCPOLY

CRCPOLY : CRC polynomial register This register contains the polynomial for the CRC calculation. The default 9-bit polynomial setting 0x107 corresponds to default 8-bit setting of DSIZE. It is compatible with setting 0x07 used at some other ST products with fixed length of the polynomial string where the most significant bit of the string is always kept hidden. Length of the polynomial is given by the most significant bit of the value stored at this register. It has to be set greater than DSIZE. CRC33_17 bit has to be set additionally with CRCPOLY register when DSIZE is configured to maximum 32-bit or 16-bit size and CRC is enabled (to keep polynomial length grater than data size). Note: CRCPOLY[31:16] bits are reserved at instances with data size limited to 16-bit. There is no constrain when 32-bit access is applied at these addresses. Reserved bits 31-16 are always read zero while any write to them is ignored.
bits : 0 - 31 (32 bit)
access : read-write


SPI_TXCRC


address_offset : 0x44 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_TXCRC SPI_TXCRC read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 TXCRC

TXCRC : CRC register for transmitter When CRC calculation is enabled, the TXCRC[31:0] bits contain the computed CRC value of the subsequently transmitted bytes. CRC calculation is initialized when the CRCEN bit of SPI_CR1 is written to 1 or when a data block is transacted completely. The CRC is calculated serially using the polynomial programmed in the SPI_CRCPOLY register. The number of bits considered at calculation depends on SPI_CRCPOLY register and CRCSIZE bits settings at SPI_CFG1 register. Note: a read to this register when the communication is ongoing could return an incorrect value. Note: TXCRC[31-16] bits are reserved at instances with data size limited to 16-bit. There is no constrain when 32-bit access is applied at these addresses. Reserved bits 31-16 are always read zero while any write to them is ignored. Note: The configuration of CRCSIZE bit field is not taken into account when the content of this register is read by software. No masking is applied for unused bits at this case.
bits : 0 - 31 (32 bit)
access : read-only


SPI_RXCRC


address_offset : 0x48 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_RXCRC SPI_RXCRC read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 RXCRC

RXCRC : CRC register for receiver When CRC calculation is enabled, the RXCRC[31:0] bits contain the computed CRC value of the subsequently received bytes. CRC calculation is initialized when the CRCEN bit of SPI_CR1 is written to 1 or when a data block is transacted completely. The CRC is calculated serially using the polynomial programmed in the SPI_CRCPOLY register. The number of bits considered at calculation depends on SPI_CRCPOLY register and CRCSIZE bits settings at SPI_CFG1 register. Note: a read to this register when the communication is ongoing could return an incorrect value. RXCRC[31-16] bits are reserved at the peripheral instances with data size limited to 16-bit. There is no constrain when 32-bit access is applied at these addresses. Reserved bits 31-16 are always read zero while any write to them is ignored. Note: The configuration of CRCSIZE bit field is not taken into account when the content of this register is read by software. No masking is applied for unused bits at this case.
bits : 0 - 31 (32 bit)
access : read-only


SPI_UDRDR

SPI underrun data register
address_offset : 0x4C Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_UDRDR SPI_UDRDR read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 UDRDR

UDRDR : data at slave underrun condition The register is taken into account in Slave mode and at underrun condition only. The number of bits considered depends on DSIZE bit settings of the SPI_CFG1 register. Underrun condition handling depends on setting UDRCFG bit at SPI_CFG1 register. Note: UDRDR[31-16] bits are reserved at the peripheral instances with data size limited to 16-bit. There is no constraint when 32-bit access is applied at these addresses. Reserved bits 31-16 are always read zero while any write to them is ignored.
bits : 0 - 31 (32 bit)
access : read-write


SPI_CFG1

SPI configuration register 1
address_offset : 0x8 Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_CFG1 SPI_CFG1 read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 DSIZE FTHLV UDRCFG RXDMAEN TXDMAEN CRCSIZE CRCEN MBR BPASS

DSIZE : number of bits in at single SPI data frame ..... Note: Maximum data size can be limited up to 16-bits at some instances. At instances with limited set of features, DSIZE2:0] bits are reserved and must be kept at reset state. DSIZE[4:3] bits then control next settings of data size: 00xxx: 8-bits 01xxx: 16-bits 10xxx: 24-bits 11xxx: 32-bits.
bits : 0 - 4 (5 bit)
access : read-write

Enumeration:

0x0 : B_0x0

not used

0x1 : B_0x1

not used

0x2 : B_0x2

not used

0x3 : B_0x3

4-bits

0x4 : B_0x4

5-bits

0x5 : B_0x5

6-bits

0x6 : B_0x6

7-bits

0x7 : B_0x7

8-bits

0x1D : B_0x1D

30-bits

0x1E : B_0x1E

31-bits

0x1F : B_0x1F

32-bits

End of enumeration elements list.

FTHLV : FIFO threshold level Defines number of data frames at single data packet. Size of the packet should not exceed 1/2 of FIFO space. SPI interface is more efficient if configured packet sizes are aligned with data register access parallelism: If SPI data register is accessed as a 16-bit register and DSIZE ‰¤ 8 bit, better to select FTHLV = 2, 4, 6. If SPI data register is accessed as a 32-bit register and DSIZE> 8 bit, better to select FTHLV = 2, 4, 6, while if DSIZE ‰¤ 8bit, better to select FTHLV = 4, 8, 12. Note: FTHLV[3:2] bits are reserved at instances with limited set of features
bits : 5 - 8 (4 bit)
access : read-write

Enumeration:

0x0 : B_0x0

1-data

0x1 : B_0x1

2-data

0x2 : B_0x2

3-data

0x3 : B_0x3

4-data

0x4 : B_0x4

5-data

0x5 : B_0x5

6-data

0x6 : B_0x6

7-data

0x7 : B_0x7

8-data

0x8 : B_0x8

9-data

0x9 : B_0x9

10-data

0xA : B_0xA

11-data

0xB : B_0xB

12-data

0xC : B_0xC

13-data

0xD : B_0xD

14-data

0xE : B_0xE

15-data

0xF : B_0xF

16-data

End of enumeration elements list.

UDRCFG : behavior of slave transmitter at underrun condition For more details see underrun condition.
bits : 9 - 9 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

slave sends a constant pattern defined by the user at the SPI_UDRDR register

0x1 : B_0x1

Slave repeats lastly received data from master. When slave is configured at transmit only mode (COMM[1:0]=01), all zeros pattern is repeated.

End of enumeration elements list.

RXDMAEN : Rx DMA stream enable
bits : 14 - 14 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

Rx-DMA disabled

0x1 : B_0x1

Rx-DMA enabled

End of enumeration elements list.

TXDMAEN : Tx DMA stream enable
bits : 15 - 15 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

Tx DMA disabled

0x1 : B_0x1

Tx DMA enabled

End of enumeration elements list.

CRCSIZE : length of CRC frame to be transacted and compared Most significant bits are taken into account from polynomial calculation when CRC result is transacted or compared. The length of the polynomial is not affected by this setting. ..... The value must be set equal or multiply of data size (DSIZE[4:0]). Its maximum size corresponds to DSIZE maximum at the instance. Note: The most significant bit at CRCSIZE bit field is reserved at the peripheral instances where data size is limited to 16-bit.
bits : 16 - 20 (5 bit)
access : read-write

Enumeration:

0x3 : B_0x3

4-bits

0x4 : B_0x4

5-bits

0x5 : B_0x5

6-bits

0x6 : B_0x6

7-bits

0x7 : B_0x7

8-bits

0x1D : B_0x1D

30-bits

0x1E : B_0x1E

31-bits

0x1F : B_0x1F

32-bits

End of enumeration elements list.

CRCEN : hardware CRC computation enable
bits : 22 - 22 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

CRC calculation disabled

0x1 : B_0x1

CRC calculation enabled

End of enumeration elements list.

MBR : master baud rate prescaler setting Note: MBR setting is considered at slave working at TI mode, too (see mode).
bits : 28 - 30 (3 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SPI master clock/2

0x1 : B_0x1

SPI master clock/4

0x2 : B_0x2

SPI master clock/8

0x3 : B_0x3

SPI master clock/16

0x4 : B_0x4

SPI master clock/32

0x5 : B_0x5

SPI master clock/64

0x6 : B_0x6

SPI master clock/128

0x7 : B_0x7

SPI master clock/256

End of enumeration elements list.

BPASS : bypass of the prescaler at master baud rate clock generator
bits : 31 - 31 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

bypass is disabled

0x1 : B_0x1

bypass is enabled

End of enumeration elements list.


SPI_CFG2

SPI configuration register 2
address_offset : 0xC Bytes (0x0)
size : 32 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_CFG2 SPI_CFG2 read-write 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Resets to Resets to 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 MSSI MIDI RDIOM RDIOP IOSWP COMM SP MASTER LSBFRST CPHA CPOL SSM SSIOP SSOE SSOM AFCNTR

MSSI : Master SS Idleness Specifies an extra delay, expressed in number of SPI clock cycle periods, inserted additionally between active edge of SS opening a session and the beginning of the first data frame of the session in Master mode when SSOE is enabled. ... Note: This feature is not supported in TI mode. To include the delay, the SPI must be disabled and re-enabled between sessions.
bits : 0 - 3 (4 bit)
access : read-write

Enumeration:

0x0 : B_0x0

no extra delay

0x1 : B_0x1

1 clock cycle period delay added

0xF : B_0xF

15 clock cycle periods delay added

End of enumeration elements list.

MIDI : master Inter-Data Idleness Specifies minimum time delay (expressed in SPI clock cycles periods) inserted between two consecutive data frames in Master mode. ... Note: This feature is not supported in TI mode.
bits : 4 - 7 (4 bit)
access : read-write

Enumeration:

0x0 : B_0x0

no delay

0x1 : B_0x1

1 clock cycle period delay

0xF : B_0xF

15 clock cycle periods delay

End of enumeration elements list.

RDIOM : RDY signal input/output management Note: When DSIZE at the SPI_CFG1 register is configured shorter than 8-bit, the RDIOM bit has to be kept at zero.
bits : 13 - 13 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

RDY signal is defined internally fixed as permanently active (RDIOP setting has no effect)

0x1 : B_0x1

RDY signal is overtaken from alternate function input (at master case) or output (at slave case) of the dedicated pin (RDIOP setting takes effect)

End of enumeration elements list.

RDIOP : RDY signal input/output polarity
bits : 14 - 14 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

high level of the signal means the slave is ready for communication

0x1 : B_0x1

low level of the signal means the slave is ready for communication

End of enumeration elements list.

IOSWP : swap functionality of MISO and MOSI pins When this bit is set, the function of MISO and MOSI pins alternate functions are inverted. Original MISO pin becomes MOSI and original MOSI pin becomes MISO.
bits : 15 - 15 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

no swap

0x1 : B_0x1

MOSI and MISO are swapped

End of enumeration elements list.

COMM : SPI Communication Mode
bits : 17 - 18 (2 bit)
access : read-write

Enumeration:

0x0 : B_0x0

full-duplex

0x1 : B_0x1

simplex transmitter

0x2 : B_0x2

simplex receiver

0x3 : B_0x3

half-duplex

End of enumeration elements list.

SP : serial protocol others: reserved, must not be used
bits : 19 - 21 (3 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SPI Motorola

0x1 : B_0x1

SPI TI

End of enumeration elements list.

MASTER : SPI Master
bits : 22 - 22 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SPI Slave

0x1 : B_0x1

SPI Master

End of enumeration elements list.

LSBFRST : data frame format
bits : 23 - 23 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

MSB transmitted first

0x1 : B_0x1

LSB transmitted first

End of enumeration elements list.

CPHA : clock phase
bits : 24 - 24 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

the first clock transition is the first data capture edge

0x1 : B_0x1

the second clock transition is the first data capture edge

End of enumeration elements list.

CPOL : clock polarity
bits : 25 - 25 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SCK signal is at 0 when idle

0x1 : B_0x1

SCK signal is at 1 when idle

End of enumeration elements list.

SSM : software management of SS signal input When master uses hardware SS output (SSM=0 and SSOE=1) the SS signal input is forced to not active state internally to prevent master mode fault error.
bits : 26 - 26 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SS input value is determined by the SS PAD

0x1 : B_0x1

SS input value is determined by the SSI bit

End of enumeration elements list.

SSIOP : SS input/output polarity
bits : 28 - 28 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

low level is active for SS signal

0x1 : B_0x1

high level is active for SS signal

End of enumeration elements list.

SSOE : SS output enable This bit is taken into account in Master mode only
bits : 29 - 29 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SS output is disabled and the SPI can work in multi-master configuration

0x1 : B_0x1

SS output is enabled. The SPI cannot work in a multi-master environment. It forces the SS pin at inactive level after the transfer is completed or SPI is disabled with respect to SSOM, MIDI, MSSI, SSIOP bits setting

End of enumeration elements list.

SSOM : SS output management in Master mode This bit is taken into account in Master mode when SSOE is enabled. It allows the SS output to be configured between two consecutive data transfers.
bits : 30 - 30 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

SS is kept at active level till data transfer is completed, it becomes inactive with EOT flag

0x1 : B_0x1

SPI data frames are interleaved with SS non active pulses when MIDI[3:0]>1

End of enumeration elements list.

AFCNTR : alternate function GPIOs control This bit is taken into account when SPE=0 only When SPI has to be disabled temporary for a specific configuration reason (e.g. CRC reset, CPHA or HDDIR change) setting this bit prevents any glitches on the associated outputs configured at alternate function mode by keeping them forced at state corresponding the current SPI configuration.
bits : 31 - 31 (1 bit)
access : read-write

Enumeration:

0x0 : B_0x0

The peripheral takes no control of GPIOs while it is disabled

0x1 : B_0x1

The peripheral keeps always control of all associated GPIOs

End of enumeration elements list.



Is something missing? Is something wrong? can you help correct it ? Please contact us at info@chipselect.org !

This website is sponsored by EmbeetleEmbeetle, an IDE designed from scratch for embedded software developers.