WS63 SDK 文档 7021f4f@fbb_ws63
ws63 和 ws63e 解决方案的 SDK 文档
载入中...
搜索中...
未找到
spi_ctra_data联合体 参考

This union represents the bit fields in the Control Register 0.
Read the register into the d32 member then set/clear the bits using the b elements. 更多...

#include <hal_spi_v151_regs_def.h>

成员变量

uint32_t d32
 
struct { 
 
   uint32_t   soe: 1 
 
   uint32_t   srlt: 1 
 
   uint32_t   ssn_te: 1 
 
   uint32_t   scph: 1 
 
   uint32_t   scpol: 1 
 
   uint32_t   cfs16: 4 
 
   uint32_t   dfs16: 4 
 
   uint32_t   dfs32: 5 
 
   uint32_t   trsm: 2 
 
   uint32_t   enhff: 2 
 
   uint32_t   prs: 2 
 
   uint32_t   reserved24_31: 6 
 
b 
 

详细描述

This union represents the bit fields in the Control Register 0.
Read the register into the d32 member then set/clear the bits using the b elements.

结构体成员变量说明

◆ [struct]

struct { ... } spi_ctra_data::b

Register bits.

◆ cfs16

uint32_t spi_ctra_data::cfs16

Control Frame Size.
Selects the length of the control word for the Microwire frame format.
Values:

  • 0x0 (SIZE_01_BIT): 1-bit Control Word
  • 0x1 (SIZE_02_BIT): 2-bit Control Word
  • 0x2 (SIZE_03_BIT): 3-bit Control Word
  • 0x3 (SIZE_04_BIT): 4-bit Control Word
  • 0x4 (SIZE_05_BIT): 5-bit Control Word
  • 0x5 (SIZE_06_BIT): 6-bit Control Word
  • 0x6 (SIZE_07_BIT): 7-bit Control Word
  • 0x7 (SIZE_08_BIT): 8-bit Control Word
  • 0x8 (SIZE_09_BIT): 9-bit Control Word
  • 0x9 (SIZE_10_BIT): 10-bit Control Word
  • 0xa (SIZE_11_BIT): 11-bit Control Word
  • 0xb (SIZE_12_BIT): 12-bit Control Word
  • 0xc (SIZE_13_BIT): 13-bit Control Word
  • 0xd (SIZE_14_BIT): 14-bit Control Word
  • 0xe (SIZE_15_BIT): 15-bit Control Word
  • 0xf (SIZE_16_BIT): 16-bit Control Word

◆ d32

uint32_t spi_ctra_data::d32

Raw register data.

◆ dfs16

uint32_t spi_ctra_data::dfs16

Data Frame Size.
This register field is only valid when SPI_MAX_XFER_SIZE is configured to 16. If SPI_MAX_XFER_SIZE is configured to 32, then writing to this field will not have any effect.
Selects the data frame length. When the data frame size is programmed to be less than 16 bits, the receive data are automatically right-justified by the receive logic, with the upper bits of the receive FIFO zero-padded.
You must right-justify transmit data before writing into the transmit FIFO. The transmit logic ignores the upper unused bits when transmitting the data.

注解
When SPI_SPI_MODE is either set to "Dual" or "Quad" or "Octal" mode and SPI_FRF is not set to 2'b00.
  • DFS value should be multiple of 2 if SPI_FRF = 01.
  • DFS value should be multiple of 4 if SPI_FRF = 10.
  • DFS value should be multiple of 8 if SPI_FRF = 11.
Values:
  • 0x3 (FRAME_04BITS): 4-bit spi_slenrial data transfer.
  • 0x4 (FRAME_05BITS): 5-bit spi_slenrial data transfer.
  • 0x5 (FRAME_06BITS): 6-bit spi_slenrial data transfer.
  • 0x6 (FRAME_07BITS): 7-bit spi_slenrial data transfer.
  • 0x7 (FRAME_08BITS): 8-bit spi_slenrial data transfer.
  • 0x8 (FRAME_09BITS): 9-bit spi_slenrial data transfer.
  • 0x9 (FRAME_10BITS): 10-bit spi_slenrial data transfer.
  • 0xa (FRAME_11BITS): 11-bit spi_slenrial data transfer.
  • 0xb (FRAME_12BITS): 12-bit spi_slenrial data transfer.
  • 0xc (FRAME_13BITS): 13-bit spi_slenrial data transfer.
  • 0xd (FRAME_14BITS): 14-bit spi_slenrial data transfer.
  • 0xe (FRAME_15BITS): 15-bit spi_slenrial data transfer.
  • 0xf (FRAME_16BITS): 16-bit spi_slenrial data transfer.

◆ dfs32

uint32_t spi_ctra_data::dfs32

Data Frame Size.
in 32-bit transfer size mode. Used to select the data frame size in 32-bit transfer mode. These bits are only valid when SPI_MAX_XFER_SIZE is configured to 32. When the data frame size is programmed to be less than 32 bits, the receive data are automatically right-justified by the receive logic, with the upper bits of the receive FIFO zeropadded. You are responsible for making sure that transmit data is right-justified before writing into the transmit FIFO. The transmit logic ignores the upper unused bits when transmitting the data.

注解
When SPI_SPI_MODE is either set to "Dual" or "Quad" or "Octal" mode and SPI_FRF is not set to 2'b00.
  • DFS value should be multiple of 2 if SPI_FRF = 0x01,
  • DFS value should be multiple of 4 if SPI_FRF = 0x10,
  • DFS value should be multiple of 8 if SPI_FRF = 0x11.
Values:
  • 0x3 (FRAME_04BITS): 4-bit spi_slenrial data transfer
  • 0x4 (FRAME_05BITS): 5-bit spi_slenrial data transfer
  • 0x5 (FRAME_06BITS): 6-bit spi_slenrial data transfer
  • 0x6 (FRAME_07BITS): 7-bit spi_slenrial data transfer
  • 0x7 (FRAME_08BITS): 8-bit spi_slenrial data transfer
  • 0x8 (FRAME_09BITS): 9-bit spi_slenrial data transfer
  • 0x9 (FRAME_10BITS): 10-bit spi_slenrial data transfer
  • 0xa (FRAME_11BITS): 11-bit spi_slenrial data transfer
  • 0xb (FRAME_12BITS): 12-bit spi_slenrial data transfer
  • 0xc (FRAME_13BITS): 13-bit spi_slenrial data transfer
  • 0xd (FRAME_14BITS): 14-bit spi_slenrial data transfer
  • 0xe (FRAME_15BITS): 15-bit spi_slenrial data transfer
  • 0xf (FRAME_16BITS): 16-bit spi_slenrial data transfer
  • 0x10 (FRAME_17BITS): 17-bit spi_slenrial data transfer
  • 0x11 (FRAME_18BITS): 18-bit spi_slenrial data transfer
  • 0x12 (FRAME_19BITS): 19-bit spi_slenrial data transfer
  • 0x13 (FRAME_20BITS): 20-bit spi_slenrial data transfer
  • 0x14 (FRAME_21BITS): 21-bit spi_slenrial data transfer
  • 0x15 (FRAME_22BITS): 22-bit spi_slenrial data transfer
  • 0x16 (FRAME_23BITS): 23-bit spi_slenrial data transfer
  • 0x17 (FRAME_24BITS): 24-bit spi_slenrial data transfer
  • 0x18 (FRAME_25BITS): 25-bit spi_slenrial data transfer
  • 0x19 (FRAME_26BITS): 26-bit spi_slenrial data transfer
  • 0x1a (FRAME_27BITS): 27-bit spi_slenrial data transfer
  • 0x1b (FRAME_28BITS): 28-bit spi_slenrial data transfer
  • 0x1c (FRAME_29BITS): 29-bit spi_slenrial data transfer
  • 0x1d (FRAME_30BITS): 30-bit spi_slenrial data transfer
  • 0x1e (FRAME_31BITS): 31-bit spi_slenrial data transfer
  • 0x1f (FRAME_32BITS): 32-bit spi_slenrial data transfer

◆ enhff

uint32_t spi_ctra_data::enhff

SPI Frame Format.
Selects data frame format for Transmitting/Receiving the data Bits only valid when SPI_SPI_MODE is either set to "Dual" or "Quad" or "Octal" mode.
When SPI_SPI_MODE is configured for "Dual Mode", 10/11 combination is reserved.
When SPI_SPI_MODE is configured for "Quad Mode", 11 combination is reserved.
Values:

  • 0x0 (STD_SPI_FRF): Standard SPI Frame Format
  • 0x1 (DUAL_SPI_FRF): Dual SPI Frame Format
  • 0x2 (QUAD_SPI_FRF): Quad SPI Frame Format
  • 0x3 (OCTAL_SPI_FRF): Octal SPI Frame Format

◆ prs

uint32_t spi_ctra_data::prs

Frame Format.
Selects which spi_slenrial protocol transfers the data.
Values:

  • 0x0 (MOTOROLA_SPI): Motorolla SPI Frame Format.
  • 0x1 (TEXAS_SSP): Texas Instruments SSP FrameFormat.
  • 0x2 (NS_MICROWIRE): National Microwire FrameFormat.
  • 0x3 (RESERVED): reserved value.

◆ reserved24_31

uint32_t spi_ctra_data::reserved24_31

◆ scph

uint32_t spi_ctra_data::scph

Serial Clock Phase. Valid when the frame format (FRF) is set to Motorola SPI. The spi_slenrial clock phase selects the relationship of the spi_slenrial clock with the slave select signal.
When SCPH = 0, data are captured on the first edge of the spi_slenrial clock. When SCPH = 1, the spi_slenrial clock starts toggling one cycle after the slave select line is activated, and data are captured on the second edge of the spi_slenrial clock.
Values:

  • 0x0 (SCPH_MIDDLE): Serial clock toggles in middle of first data bit.
  • 0x1 (SCPH_START): Serial clock toggles at start of first data bit.

◆ scpol

uint32_t spi_ctra_data::scpol

Serial Clock Polarity.
Valid when the frame format (FRF) is set to Motorola SPI. Used to select the polarity of the inactive spi_slenrial clock, which is held inactive when the spi master is not actively transferring data on the spi_slenrial bus.
Values:

  • 0x0 (SCLK_LOW): Inactive state of spi_slenrial clock is low
  • 0x1 (SCLK_HIGH): Inactive state of spi_slenrial clock is high

◆ soe

uint32_t spi_ctra_data::soe

Slave Output Enable.
Relevant only when the spi is configured as a spi_slenrial-slave device. When configured as a spi_slenrial master, this bit field has no functionality. This bit enables or disables the setting of the ssi_oe_n output from the spi spi_slenrial slave. When SLV_OE = 1, the ssi_oe_n output can never be active. When the ssi_oe_n output controls the tri-state buffer on the txd output from the slave, a high impedance state is always present on the slave txd output when SLV_OE = 1.
This is useful when the master transmits in broadcast mode (master transmits data to all slave devices). Only one slave may respond with data on the master rxd line. This bit is enabled after reset and must be disabled by software (when broadcast mode is used), if you do not want this device to respond with data.
Values:

  • 0x1 (DISABLED): Slave Output is disabled
  • 0x0 (ENABLED): Slave Output is enabled

◆ srlt

uint32_t spi_ctra_data::srlt

Shift Register Loop.
Used for testing purposes only. When internally active, connects the transmit shift register output to the receive shift register input.
Can be used in both spi_slenrial-slave and spi_slenrial-master modes. When the spi is configured as a slave in loopback mode, the ss_in_n and ssi_clk signals must be provided by an external source. In this mode, the slave cannot generate these signals because there is nothing to which to loop back
Values:

  • 0x1 (TESTING_MODE): Test mode: Tx & Rx shift reg connected
  • 0x0 (NORMAL_MODE): Normal mode operation

◆ ssn_te

uint32_t spi_ctra_data::ssn_te

Slave Select Toggle Enable.
When operating in SPI mode with clock phase (SCPH) set to 0, this register controls the behavior of the slave select line (ss_*_n) between data frames. If this register field is set to 1 the ss_*_n line will toggle between consecutive data frames, with the spi_slenrial clock (sclk) being held to its default value while ss_*_n is high; if this register field is set to 0 the ss_*_n will stay low and sclk will run continuously for the duration of the transfer.

注解
This register is only valid when SPI_SCPH0_SSTOGGLE is set to 1.

◆ trsm

uint32_t spi_ctra_data::trsm

Transfer Mode.
Selects the mode of transfer for spi_slenrial communication. This field does not affect the transfer duplicity. Only indicates whether the receive or transmit data are valid.
In transmit-only mode, data received from the external device is not valid and is not stored in the receive FIFO memory; it is overwritten on the next transfer.
In receive-only mode, transmitted data are not valid. After the first write to the transmit FIFO, the same word is retransmitted for the duration of the transfer.
In transmit-and-receive mode, both transmit and receive data are valid. The transfer continues until the transmit FIFO is empty. Data received from the external device are stored into the receive FIFO memory, where it can be accessed by the host processor.
In eeprom-read mode, receive data is not valid while control data is being transmitted. When all control data is sent to the EEPROM, receive data becomes valid and transmit data becomes invalid. All data in the transmit FIFO is considered control data in this mode. This transfer mode is only valid when the spi is configured as master device.

  • 00 - Transmit & Receive
  • 01 - Transmit Only
  • 10 - Receive Only
  • 11 - EEPROM Read When SPI_SPI_MODE is either set to "Dual" or "Quad" or "Octal" mode and SPI_FRF is not set to 2'b00. There are only two valid combinations:
  • 10 - Read
  • 01 - Write
    Values:
  • 0x0 (TX_AND_RX): Transmit & receive
  • 0x1 (TX_ONLY): Transmit only mode or Write (SPI_FRF != 2'b00)
  • 0x2 (RX_ONLY): Receive only mode or Read (SPI_FRF != 2'b00)
  • 0x3 (EEPROM_READ): EEPROM Read mode

该联合体的文档由以下文件生成: