Komunikacja
SPI2 0x40003800
10 rejestrów/klastrów w tym peryferium.
Rejestr: CR1: 0x40003800
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | CPHA | `rw` | Clock phase Note: This bit should not be changed when communication is ongoing. This bit is not used in I2S mode and SPI TI mode except the case when CRC is applied at TI mode. |
| 1 | 1 | CPOL | `rw` | Clock polarity Note: This bit should not be changed when communication is ongoing. This bit is not used in I2S mode and SPI TI mode except the case when CRC is applied at TI mode. |
| 2 | 1 | MSTR | `rw` | Master selection Note: This bit should not be changed when communication is ongoing. This bit is not used in I2S mode. |
| 3–5 | 3 | BR | `rw` | Baud rate control Note: These bits should not be changed when communication is ongoing. These bits are not used in I2S mode. |
| 6 | 1 | SPE | `rw` | SPI enable Note: When disabling the SPI, follow the procedure described in SPI on page1020. This bit is not used in I2S mode. |
| 7 | 1 | LSBFIRST | `rw` | Frame format Note: 1. This bit should not be changed when communication is ongoing. 2. This bit is not used in I2S mode and SPI TI mode. |
| 8 | 1 | SSI | `rw` | Internal slave select This bit has an effect only when the SSM bit is set. The value of this bit is forced onto the NSS pin and the I/O value of the NSS pin is ignored. Note: This bit is not used in I2S mode and SPI TI mode. |
| 9 | 1 | SSM | `rw` | Software slave management When the SSM bit is set, the NSS pin input is replaced with the value from the SSI bit. Note: This bit is not used in I2S mode and SPI TI mode. |
| 10 | 1 | RXONLY | `rw` | Receive only mode enabled. This bit enables simplex communication using a single unidirectional line to receive data exclusively. Keep BIDIMODE bit clear when receive only mode is active.This bit is also useful in a multislave system in which this particular slave is not accessed, the output from the accessed slave is not corrupted. Note: This bit is not used in I2S mode. |
| 11 | 1 | CRCL | `rw` | CRC length This bit is set and cleared by software to select the CRC length. Note: This bit should be written only when SPI is disabled (SPE = '0') for correct operation. This bit is not used in I2S mode. |
| 12 | 1 | CRCNEXT | `rw` | Transmit CRC next Note: This bit has to be written as soon as the last data is written in the SPIx_DR register. This bit is not used in I2S mode. |
| 13 | 1 | CRCEN | `rw` | Hardware CRC calculation enable Note: This bit should be written only when SPI is disabled (SPE = '0') for correct operation. This bit is not used in I2S mode. |
| 14 | 1 | BIDIOE | `rw` | Output enable in bidirectional mode This bit combined with the BIDIMODE bit selects the direction of transfer in bidirectional mode. Note: In master mode, the MOSI pin is used and in slave mode, the MISO pin is used. This bit is not used in I2S mode. |
| 15 | 1 | BIDIMODE | `rw` | Bidirectional data mode enable. This bit enables half-duplex communication using common single bidirectional data line. Keep RXONLY bit clear when bidirectional mode is active. Note: This bit is not used in I2S mode. |
Rejestr: CR2: 0x40003804
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | RXDMAEN | `rw` | Rx buffer DMA enable When this bit is set, a DMA request is generated whenever the RXNE flag is set. |
| 1 | 1 | TXDMAEN | `rw` | Tx buffer DMA enable When this bit is set, a DMA request is generated whenever the TXE flag is set. |
| 2 | 1 | SSOE | `rw` | SS output enable Note: This bit is not used in I2S mode and SPI TI mode. |
| 3 | 1 | NSSP | `rw` | NSS pulse management This bit is used in master mode only. it allows the SPI to generate an NSS pulse between two consecutive data when doing continuous transfers. In the case of a single data transfer, it forces the NSS pin high level after the transfer. It has no meaning if CPHA = '1', or FRF = '1'. Note: 1. This bit must be written only when the SPI is disabled (SPE=0). 2. This bit is not used in I2S mode and SPI TI mode. |
| 4 | 1 | FRF | `rw` | Frame format 1 SPI TI mode Note: This bit must be written only when the SPI is disabled (SPE=0). This bit is not used in I2S mode. |
| 5 | 1 | ERRIE | `rw` | Error interrupt enable This bit controls the generation of an interrupt when an error condition occurs (CRCERR, OVR, MODF in SPI mode, FRE at TI mode and UDR, OVR, and FRE in I2S mode). |
| 6 | 1 | RXNEIE | `rw` | RX buffer not empty interrupt enable |
| 7 | 1 | TXEIE | `rw` | Tx buffer empty interrupt enable |
| 8–11 | 4 | DS | `rw` | Data size These bits configure the data length for SPI transfers. If software attempts to write one of the 'Not used' values, they are forced to the value '0111' (8-bit) Note: These bits are not used in I2S mode. |
| 12 | 1 | FRXTH | `rw` | FIFO reception threshold This bit is used to set the threshold of the RXFIFO that triggers an RXNE event Note: This bit is not used in I2S mode. |
| 13 | 1 | LDMA_RX | `rw` | Last DMA transfer for reception |
| 14 | 1 | LDMA_TX | `rw` | Last DMA transfer for transmission |
Rejestr: SR: 0x40003808
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | RXNE | `ro` | Receive buffer not empty |
| 1 | 1 | TXE | `ro` | Transmit buffer empty |
| 2 | 1 | CHSIDE | `ro` | Channel side Note: This bit is not used in SPI mode. It has no significance in PCM mode. |
| 3 | 1 | UDR | `ro` | Underrun flag This flag is set by hardware and reset by a software sequence. Refer to page1056 for the software sequence. Note: This bit is not used in SPI mode. |
| 4 | 1 | CRCERR | `rw` | CRC error flag Note: This flag is set by hardware and cleared by software writing 0. This bit is not used in I2S mode. |
| 5 | 1 | MODF | `ro` | Mode fault This flag is set by hardware and reset by a software sequence. Refer to (MODF) on page1030 for the software sequence. Note: This bit is not used in I2S mode. |
| 6 | 1 | OVR | `ro` | Overrun flag This flag is set by hardware and reset by a software sequence. Refer to page1056 for the software sequence. |
| 7 | 1 | BSY | `ro` | Busy flag This flag is set and cleared by hardware. Note: The BSY flag must be used with caution: refer to and . |
| 8 | 1 | FRE | `ro` | Frame format error This flag is used for SPI in TI slave mode and I2S slave mode. Refer to error flags and . This flag is set by hardware and reset when SPIx_SR is read by software. |
| 9–10 | 2 | FRLVL | `ro` | FIFO reception level |
| 11–12 | 2 | FTLVL | `ro` | FIFO transmission level These bits are set and cleared by hardware. Note: This bit is not used in I2S mode. |
Rejestr: DR8 0x4000380C
rw
Direct 8-bit access to data register
Brak zdefiniowanych pól bitowych.
Rejestr: DR: 0x4000380C
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–7 | 8 | DR: | — | Data register |
| 0–15 | 16 | DR | `rw` | Data register Data received or to be transmitted The data register serves as an interface between the Rx and Tx FIFOs. When the data register is read, RxFIFO is accessed while the write to data register accesses TxFIFO (See ). Note: Data is always right-aligned. Unused bits are ignored when writing to the register, and read as zero when the register is read. The Rx threshold setting must always correspond with the read access currently used. |
Rejestr: CRCPR: 0x40003810
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | CRCPOLY | `rw` | CRC polynomial register This register contains the polynomial for the CRC calculation. The CRC polynomial (0x0007) is the reset value of this register. Another polynomial can be configured as required. |
Rejestr: RXCRCR: 0x40003814
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | RXCRC | `ro` | Rx CRC register When CRC calculation is enabled, the RXCRC[15:0] bits contain the computed CRC value of the subsequently received bytes. This register is reset when the CRCEN bit in SPIx_CR1 register is written to 1. The CRC is calculated serially using the polynomial programmed in the SPIx_CRCPR register. Only the 8 LSB bits are considered when the CRC frame format is set to be 8-bit length (CRCL bit in the SPIx_CR1 is cleared). CRC calculation is done based on any CRC8 standard. The entire 16-bits of this register are considered when a 16-bit CRC frame format is selected (CRCL bit in the SPIx_CR1 register is set). CRC calculation is done based on any CRC16 standard. Note: A read to this register when the BSY Flag is set could return an incorrect value. These bits are not used in I2S mode. |
Rejestr: TXCRCR: 0x40003818
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–15 | 16 | TXCRC | `ro` | Tx CRC register When CRC calculation is enabled, the TXCRC[7:0] bits contain the computed CRC value of the subsequently transmitted bytes. This register is reset when the CRCEN bit of SPIx_CR1 is written to 1. The CRC is calculated serially using the polynomial programmed in the SPIx_CRCPR register. Only the 8 LSB bits are considered when the CRC frame format is set to be 8-bit length (CRCL bit in the SPIx_CR1 is cleared). CRC calculation is done based on any CRC8 standard. The entire 16-bits of this register are considered when a 16-bit CRC frame format is selected (CRCL bit in the SPIx_CR1 register is set). CRC calculation is done based on any CRC16 standard. Note: A read to this register when the BSY flag is set could return an incorrect value. These bits are not used in I2S mode. |
Rejestr: I2SCFGR: 0x4000381C
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0 | 1 | CHLEN | `rw` | Channel length (number of bits per audio channel) The bit write operation has a meaning only if DATLEN = 00 otherwise the channel length is fixed to 32-bit by hardware whatever the value filled in. Note: For correct operation, this bit should be configured when the I2S is disabled. It is not used in SPI mode. |
| 1–2 | 2 | DATLEN | `rw` | Data length to be transferred Note: For correct operation, these bits should be configured when the I2S is disabled. They are not used in SPI mode. |
| 3 | 1 | CKPOL | `rw` | Inactive state clock polarity Note: For correct operation, this bit should be configured when the I2S is disabled. It is not used in SPI mode. The bit CKPOL does not affect the CK edge sensitivity used to receive or transmit the SD and WS signals. |
| 4–5 | 2 | I2SSTD | `rw` | I2S standard selection For more details on I2S standards, refer to Note: For correct operation, these bits should be configured when the I2S is disabled. They are not used in SPI mode. |
| 7 | 1 | PCMSYNC | `rw` | PCM frame synchronization Note: This bit has a meaning only if I2SSTD = 11 (PCM standard is used). It is not used in SPI mode. |
| 8–9 | 2 | I2SCFG | `rw` | I2S configuration mode Note: These bits should be configured when the I2S is disabled. They are not used in SPI mode. |
| 10 | 1 | I2SE | `rw` | I2S enable Note: This bit is not used in SPI mode. |
| 11 | 1 | I2SMOD | `rw` | I2S mode selection Note: This bit should be configured when the SPI is disabled. |
| 12 | 1 | ASTRTEN | `rw` | Asynchronous start enable. When the I2S is enabled in slave mode, the hardware starts the transfer when the I2S clock is received and an appropriate transition is detected on the WS signal. When the I2S is enabled in slave mode, the hardware starts the transfer when the I2S clock is received and the appropriate level is detected on the WS signal. Note: The appropriate transition is a falling edge on WS signal when I2S Philips Standard is used, or a rising edge for other standards. The appropriate level is a low level on WS signal when I2S Philips Standard is used, or a high level for other standards. Please refer to for additional information. |
Rejestr: I2SPR: 0x40003820
| Bit | Szer. | Pole | Dostęp | Opis |
|---|---|---|---|---|
| 0–7 | 8 | I2SDIV | `rw` | I2S linear prescaler I2SDIV [7:0] = 0 or I2SDIV [7:0] = 1 are forbidden values. Refer to . Note: These bits should be configured when the I2S is disabled. They are used only when the I2S is in master mode. They are not used in SPI mode. |
| 8 | 1 | ODD | `rw` | Odd factor for the prescaler Refer to . Note: This bit should be configured when the I2S is disabled. It is used only when the I2S is in master mode. It is not used in SPI mode. |
| 9 | 1 | MCKOE | `rw` | Master clock output enable Note: This bit should be configured when the I2S is disabled. It is used only when the I2S is in master mode. It is not used in SPI mode. |