STM32F1 SPI

Started by tha, December 16, 2020, 01:16:43 PM

Previous topic - Next topic

tha



Bits 15:0 RXCRC[15:0]: Rx CRC register
เมื่อ CRC calculation ถูกเปิดการใช้งาน, the RxCRC[15:0] bits บรรจุ the computed CRC value ของ the subsequently received bytes. register นี้ถูก reset เมื่อ the CRCEN bit ใน SPI_CR1 register ถูกเขียนให้เป็น 1. The CRC ถูกคำนวณแบบอนุกรมโดยใช้ the polynomial ที่โปรแกรมใน the SPI_CRCPR register

เฉพาะ the 8 LSB bits ถูกพิจารณาเมื่อ the data frame format ถูกเซ็ตเป็น 8-bit data (DFF bit of SPI_CR1 ถูกเคลียร์). CRC calculation ถูกทำบนฐานของ CRC8 standard ใดๆ.

The entire 16-bits ของ register นี้ถูกพิจารณาเมื่อ a 16-bit data frame format ถูกเลือก (DFF bit of the SPI_CR1 register ถูกเซ็ต). CRC calculation ถูกทำบนฐานของ CRC16 standard ใดๆ.

Note: การอ่านไปยัง register นี้เมื่อ the BSY Flag ถูกเซ็ตอาจส่งคืนกลับ an incorrect value.
           บิตเหล่านี้ไม่ถูกใช้สำหรับ the I2S mode.

tha



Bits 15:0 TXCRC[15:0]: Tx CRC register
เมื่อ CRC calculation ถูกเปิดการใช้งาน, the TxCRC[7:0] bits บรรจุ the computed CRC value ของ the subsequently received bytes. register นี้ถูก reset เมื่อ the CRCEN bit ใน SPI_CR1 register ถูกเขียนให้เป็น 1. The CRC ถูกคำนวณแบบอนุกรมโดยใช้ the polynomial ที่โปรแกรมใน the SPI_CRCPR register

เฉพาะ the 8 LSB bits ถูกพิจารณาเมื่อ the data frame format ถูกเซ็ตเป็น 8-bit data (DFF bit of SPI_CR1 ถูกเคลียร์). CRC calculation ถูกทำบนฐานของ CRC8 standard ใดๆ.

The entire 16-bits ของ register นี้ถูกพิจารณาเมื่อ a 16-bit data frame format ถูกเลือก (DFF bit of the SPI_CR1 register ถูกเซ็ต). CRC calculation ถูกทำบนฐานของ CRC16 standard ใดๆ.

Note: การอ่านไปยัง register นี้เมื่อ the BSY Flag ถูกเซ็ตอาจส่งคืนกลับ an incorrect value.
           บิตเหล่านี้ไม่ถูกใช้สำหรับ the I2S mode.

tha



Bits 15:12 Reserved, must be kept at reset value.

Bit 11 I2SMOD: I2S mode selection
     0: SPI mode ถูกเลือก
     1: I2S mode ถูกเลือก
Note: บิตนี้ควรถูกกำหนดค่าเมื่อ the SPI or I2S ปิดการใช้งาน

Bit 10 I2SE: I2S Enable
     0: I2S peripheral ถูกปิดการใช้งาน
     1: I2S peripheral ถูกเปิดการใช้งาน
Note: บิตนี้ไม่ถูกใช้ใน SPI mode.

Bits 9:8 I2SCFG: I2S configuration mode
     00: Slave - transmit
     01: Slave - receive
     10: Master - transmit
     11: Master - receive
Note: บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน
           มันไม่ถูกใช้ใน SPI mode.

Bit 7 PCMSYNC: PCM frame synchronization
     0: Short frame synchronization
     1: Long frame synchronization
Note: บิตนี้มีความหมายเพียงถ้า I2SSTD = 11 (PCM standard ถูกใช้)
           มันไม่ถูกใช้ใน SPI mode.

Bit 6 Reserved: forced at 0 by hardware

Bits 5:4 I2SSTD: I2S standard selection
     00: I2S Philips standard.
     01: MSB justified standard (left justified)
     10: LSB justified standard (right justified)
     11: PCM standard
สำหรับรายละเอียดที่มากขึ้นบน I2S standards, อ้างอิงถึง to Section 25.4.2. ไม่ถูกใช้ใน SPI mode.
Note: สำหรับการทำงานที่ถูกต้อง, บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน

Bit 3 CKPOL: Steady state clock polarity
     0: I2S clock steady state เป็น low level
     1: I2S clock steady state เป็น high level
Note: สำหรับการทำงานที่ถูกต้อง, บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน
           บิตนี้ไม่ถูกใช้ใน SPI mode.

Bits 2:1 DATLEN: Data length to be transferred
     00: 16-bit data length
     01: 24-bit data length
     10: 32-bit data length
     11: Not allowed
Note: สำหรับการทำงานที่ถูกต้อง, บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน
           บิตนี้ไม่ถูกใช้ใน SPI mode.

Bit 0 CHLEN: Channel length (number of bits per audio channel)
     0: 16-bit wide
     1: 32-bit wide
The bit write operation มีความหมายเพียงถ้า DATLEN = 00 มิฉะนั้น the channel length ถูกคงที่ไว้ที่ 32-bit โดย hardware ไม่ว่าจะใส่ค่าใดก็ตาม. ไม่ถูกใช้ใน SPI mode.
Note: สำหรับการทำงานที่ถูกต้อง, บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน


tha



Bits 15:10 Reserved, must be kept at reset value.

Bit 9 MCKOE: Master clock output enable
     0: Master clock output ถูกปิดการใช้งาน
     1: Master clock output ถูกเปิดการใช้งาน
Note: บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน. มันถูกใช้เพียงเมื่อ the I2S อยู่ใน master mode.
           บิตนี้ไม่ถูกใช้ใน SPI mode.

Bit 8 ODD: Odd factor for the prescaler
     0: real divider value คือ = I2SDIV *2
     1: real divider value คือ = (I2SDIV * 2)+1
อ้างอิงถึง Section 25.4.3: Clock generator. ไม่ถูกใช้ใน SPI mode.
Note: บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน. มันถูกใช้เพียงเมื่อ the I2S อยู่ใน master mode.

Bits 7:0 I2SDIV: I2S Linear prescaler
     I2SDIV [7:0] = 0 หรือ I2SDIV [7:0] = 1 เป็นค่าต้องห้าม.
อ้างอิงถึง Section 25.4.3. ไม่ถูกใช้ใน SPI mode.
Note: บิตนี้ควรถูกกำหนดค่าเมื่อ the I2S ปิดการใช้งาน. มันถูกใช้เพียงเมื่อ the I2S อยู่ใน master mode.

tha


tha