\n

SPI

Peripheral Memory Blocks

address_offset : 0x0 Bytes (0x0)
size : 0xC byte (0x0)
mem_usage : registers
protection : not protected

address_offset : 0x20 Bytes (0x0)
size : 0x8 byte (0x0)
mem_usage : registers
protection : not protected

address_offset : 0x10 Bytes (0x0)
size : 0x8 byte (0x0)
mem_usage : registers
protection : not protected

address_offset : 0x34 Bytes (0x0)
size : 0xC byte (0x0)
mem_usage : registers
protection : not protected

Registers

SPI_CNTRL

SPI_RX0

SPI_RX1

SPI_TX0

SPI_TX1

SPI_VARCLK

SPI_DMA

SPI_CNTRL2

SPI_DIVIDER

SPI_SSR


SPI_CNTRL

Control and Status Register
address_offset : 0x0 Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_CNTRL SPI_CNTRL 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 GO_BUSY RX_NEG TX_NEG TX_BIT_LEN TX_NUM LSB CLKP SP_CYCLE IF IE SLAVE REORDER TWOB VARCLK_EN

GO_BUSY : Go and Busy Status\nDuring the data transfer, this bit keeps the value of 1. As the transfer is finished, this bit will be cleared automatically.\nNote: All registers should be set before writing 1 to this GO_BUSY bit.
bits : 0 - 0 (1 bit)
access : read-write

Enumeration:

#0 : 0

Stop data transfer if SPI is transferring

#1 : 1

In Master mode, writing 1 to this bit to start the SPI data transfer in Slave mode, writing 1 to this bit indicates that the slave is ready to communicate with a master

End of enumeration elements list.

RX_NEG : Receive At Negative Edge\n
bits : 1 - 1 (1 bit)
access : read-write

Enumeration:

#0 : 0

The received data input signal is latched at the rising edge of SPICLK

#1 : 1

The received data input signal is latched at the falling edge of SPICLK

End of enumeration elements list.

TX_NEG : Transmit At Negative Edge\n
bits : 2 - 2 (1 bit)
access : read-write

Enumeration:

#0 : 0

The transmitted data output signal is changed at the rising edge of SPICLK

#1 : 1

The transmitted data output signal is changed at the falling edge of SPICLK

End of enumeration elements list.

TX_BIT_LEN : Transmit Bit Length\nThis field specifies how many bits can be transmitted / received in one transaction. The minimum bit length is 8 bits and can up to 32 bits.\n
bits : 3 - 7 (5 bit)
access : read-write

TX_NUM : Numbers of Transmit/Receive Word\nThis field specifies how many transmit/receive word numbers should be executed in one transfer.\nNote: in Slave mode with level-trigger configuration, if TX_NUM is set to 01, the slave select pin must be kept at active state during the successive data transfer.
bits : 8 - 9 (2 bit)
access : read-write

Enumeration:

#00 : 0

Only one transmit/receive word will be executed in one transfer

#01 : 1

Two successive transmit/receive words will be executed in one transfer. (Burst mode)

#10 : 2

Reserved

#11 : 3

Reserved

End of enumeration elements list.

LSB : LSB First\n
bits : 10 - 10 (1 bit)
access : read-write

Enumeration:

#0 : 0

MSB is transmitted/received first (which bit in SPI_TX0/1 and SPI_RX0/1 register that is depends on the TX_BIT_LEN field)

#1 : 1

LSB is sent first on the line (bit 0 of SPI_TX0/1), and the first bit received from the line will be put in the LSB position in the RX register (bit 0 of SPI_RX0/1)

End of enumeration elements list.

CLKP : Clock Polarity\n
bits : 11 - 11 (1 bit)
access : read-write

Enumeration:

#0 : 0

SPICLK idle low

#1 : 1

SPICLK idle high

End of enumeration elements list.

SP_CYCLE : Suspend Interval (Master Only)\n\nIf the SPI clock rate equals system clock rate, that is to say, the DIV_ONE feature is enabled, the Burst mode suspend interval period is\n(SP_CYCLE[3:0] * 2 + 3.5) * period of system clock
bits : 12 - 15 (4 bit)
access : read-write

IF : Interrupt Flag\nNote: This bit will be cleared by writing 1 to itself.
bits : 16 - 16 (1 bit)
access : read-write

Enumeration:

#0 : 0

Transfer is not finished yet

#1 : 1

Transfer is done

End of enumeration elements list.

IE : Interrupt Enable\n
bits : 17 - 17 (1 bit)
access : read-write

Enumeration:

#0 : 0

SPI Interrupt Disabled

#1 : 1

SPI Interrupt Enabled

End of enumeration elements list.

SLAVE : Slave Mode Enable Bit\n
bits : 18 - 18 (1 bit)
access : read-write

Enumeration:

#0 : 0

Master mode

#1 : 1

Slave mode

End of enumeration elements list.

REORDER : Reorder Mode Selection\nNote:\nByte reorder function is only available if TX_BIT_LEN is defined as 16, 24, and 32 bits.\nIn Slave mode with level-trigger configuration, if the byte suspend function is enabled, the slave select pin must be kept at active state during the successive four bytes transfer.
bits : 19 - 20 (2 bit)
access : read-write

Enumeration:

#00 : 0

Both byte reorder and byte suspend functions Disabled

#01 : 1

Byte reorder function Enabled and a byte suspend interval (2~17 SPICLK cycles) inserted among each byte. The setting of TX_BIT_LEN must be configured as 0x00. (32 bits/word)

#10 : 2

Byte reorder function Enabled, but byte suspend function Disabled

#11 : 3

byte reorder function Disabled, but a suspend interval (2~17 SPICLK cycles) inserted among each byte. The setting of TX_BIT_LEN must be configured as 0x00. (32 bits/word)

End of enumeration elements list.

TWOB : Two Bits Transfer Mode Active\nNote1: When TWOB is enabled, the serial transmitted 2-bit data output are from SPI_TX1/0, and the received 2-bit data input are put in SPI_RX1/0.\nNote2: When TWOB is enabled, the setting of TX_NUM must be programmed as 0x00
bits : 22 - 22 (1 bit)
access : read-write

Enumeration:

#0 : 0

Two-bit transfer mode Disabled

#1 : 1

Two-bit transfer mode Enabled

End of enumeration elements list.

VARCLK_EN : Variable Clock Enable (Master Only)\nNote: When this VARCLK_EN bit is enabled, the setting of TX_BIT_LEN must be programmed as 0x10 (16-bit mode)
bits : 23 - 23 (1 bit)
access : read-write

Enumeration:

#0 : 0

The serial clock output frequency is fixed and decided only by the value of DIVIDER

#1 : 1

The serial clock output frequency is variable. The output frequency is decided by the value of VARCLK, DIVIDER, and DIVIDER2

End of enumeration elements list.


SPI_RX0

Data Receive Register 0
address_offset : 0x10 Bytes (0x0)
access : read-only
reset_value : 0x0
reset_Mask : 0x0

SPI_RX0 SPI_RX0 read-only 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 RX

RX : Data Receive Register\nThe Data Receive Registers hold the value of received data of the last executed transfer. Valid bits depend on the transmit bit length field in the SPI_CNTRL register.\nFor example, if TX_BIT_LEN is set to 0x08 and TX_NUM is set to 0x0, bit RX0[7:0] holds the received data. The values of the other bits are unknown.\nNote: These bits are read only.
bits : 0 - 31 (32 bit)
access : read-only


SPI_RX1

Data Receive Register 1
address_offset : 0x14 Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_RX1 SPI_RX1 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

SPI_TX0

Data Transmit Register 0
address_offset : 0x20 Bytes (0x0)
access : write-only
reset_value : 0x0
reset_Mask : 0x0

SPI_TX0 SPI_TX0 write-only 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 TX

TX : Data Transmit Register\nThe Data Transmit Registers hold the data to be transmitted in the next transfer. Valid bits depend on the transmit bit length field in the CNTRL register.\nFor example, if TX_BIT_LEN is set to 0x08 and the TX_NUM is set to 0x0, the bit TX0[7:0] will be transmitted in next transfer. If TX_BIT_LEN is set to 0x00 and TX_NUM is set to 0x1, the SPI controller will perform two 32-bit transmit/receive successive using the same setting. The transmission sequence is TX0[31:0] first and then TX1[31:0].
bits : 0 - 31 (32 bit)
access : write-only


SPI_TX1

Data Transmit Register 1
address_offset : 0x24 Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_TX1 SPI_TX1 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

SPI_VARCLK

Variable Clock Pattern Register
address_offset : 0x34 Bytes (0x0)
size : -1 bit
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_VARCLK SPI_VARCLK 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 VARCLK

VARCLK : Variable Clock Pattern\nThe value in this field is the frequency patterns of the SPI clock. If the bit pattern of VARCLK is '0', the output frequency of SPICLK is according the value of DIVIDER. If the bit patterns of VARCLK are '1', the output frequency of SPICLK is according the value of DIVIDER2. Refer to register SPI_DIVIDER.\nRefer to the Variable Serial Clock Frequency paragraph for more detailed description.
bits : 0 - 31 (32 bit)
access : read-write


SPI_DMA

SPI DMA Mode Control Register
address_offset : 0x38 Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_DMA SPI_DMA 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 TX_DMA_GO RX_DMA_GO

TX_DMA_GO : Transmit DMA Start\nSet this bit to 1 will start the transmit PDMA process. SPI controller will issue request to PDMA controller automatically.\nIf using PDMA mode to transfer data, remember not to set GO_BUSY bit of SPI_CNTRL register. The DMA controller inside SPI controller will set it automatically whenever necessary.\nHardware will clear this bit to 0 automatically after PDMA transfer done.\nNote: In DMA mode, the Burst mode is not supported.
bits : 0 - 0 (1 bit)
access : read-write

RX_DMA_GO : Receive DMA Start\nSet this bit to 1 will start the receive PDMA process. SPI controller will issue request to PDMA controller automatically.\nHardware will clear this bit to 0 automatically after PDMA transfer done.
bits : 1 - 1 (1 bit)
access : read-write


SPI_CNTRL2

Control and Status Register 2
address_offset : 0x3C Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_CNTRL2 SPI_CNTRL2 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 DIV_ONE NOSLVSEL SLV_ABORT SSTA_INTEN SLV_START_INTSTS

DIV_ONE : SPI Clock Divider Control Note: 1. When this bit is set as 1, both the REORDER field and the VARCLK_EN field must be configured as 0. In other words, the byte-reorder function, byte suspend function and variable clock function must be disabled. 2. When this bit is set as 1, the TX_BIT_LEN cannot be set as 1.
bits : 0 - 0 (1 bit)
access : read-write

Enumeration:

#0 : 0

The SPI clock rate is determined by the setting of SPI_DIVIDER register

#1 : 1

DIV_ONE feature Enabled. The SPI clock rate equals the system clock rate

End of enumeration elements list.

NOSLVSEL : Slave 3-Wire Mode Enable Bit\nThis is used to ignore the slave select signal in Slave mode. The SPI controller can work on 3 wire interface including SPICLK, SPI_MISO, and SPI_MOSI when it is set as a slave device.\nNote: In no slave select signal mode, the SS_LTRIG, SPI_SSR[4], shall be set as 1.
bits : 8 - 8 (1 bit)
access : read-write

Enumeration:

#0 : 0

The controller is 4-wire bi-direction interface

#1 : 1

The controller is 3-wire bi-direction interface in Slave mode. When this bit is set as 1, the controller start to transmit/receive data after the GO_BUSY bit active and the serial clock input

End of enumeration elements list.

SLV_ABORT : Slave 3-Wire Mode Abort Control Bit\nIn normal operation, there is interrupt event when the received data meet the required bits which define in TX_BIT_LEN and TX_NUM.\nIf the received bits are less than the requirement and there is no more serial clock input over the one transfer time in Slave mode with no slave select, the user can set this bit to force the current transfer done and then the user can get a transfer done interrupt event. \nNote: It is auto cleared to 0 by hardware when the abort event is active.
bits : 9 - 9 (1 bit)
access : read-write

SSTA_INTEN : Slave 3-Wire Mode Start Interrupt Enable\nIt is used to enable interrupt when the transfer has start in Slave mode with no slave select. If there is no transfer done interrupt over the time period which is defined by user after the transfer start, the user can set the SLV_ABORT bit to force the transfer done.\n
bits : 10 - 10 (1 bit)
access : read-write

Enumeration:

#0 : 0

Transfer start interrupt Disabled

#1 : 1

Transaction start interrupt Enabled. It is clear by the current transfer done or the SLV_START_INTSTS bit be clear (write one clear)

End of enumeration elements list.

SLV_START_INTSTS : Slave 3-Wire Mode Start Interrupt Status\nIt is used to dedicate that the transfer has start in Slave mode with no slave select.\n
bits : 11 - 11 (1 bit)
access : read-write

Enumeration:

#0 : 0

It indicates that the slave start transfer no active

#1 : 1

It indicates that the transfer start in Slave mode with no slave select. It is auto clear by transfer done or writing one clear

End of enumeration elements list.


SPI_DIVIDER

Clock Divider Register (Master Only)
address_offset : 0x4 Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_DIVIDER SPI_DIVIDER 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 DIVIDER DIVIDER2

DIVIDER : Clock Divider 1 (master only)\nThe value in this field is the frequency divider for generating the serial clock on the output SPICLK. The desired frequency is obtained according to the following equation:\n\nIn Slave mode, the period of SPI clock driven by a master shall equal or over 5 times the period of PCLK. In other words, the maximum frequency of SPI clock is the fifth of the frequency of slave's PCLK.
bits : 0 - 15 (16 bit)
access : read-write

DIVIDER2 : Clock Divider 2 (Master Only)\nThe value in this field is the 2nd frequency divider for generating the serial clock on the output SPICLK. The desired frequency is obtained according to the following equation:\n\nIf VARCLK_EN is cleared to 0, this setting is unmeaning.
bits : 16 - 31 (16 bit)
access : read-write


SPI_SSR

Slave Select Register
address_offset : 0x8 Bytes (0x0)
access : read-write
reset_value : 0x0
reset_Mask : 0x0

SPI_SSR SPI_SSR 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 SSR SS_LVL AUTOSS SS_LTRIG LTRIG_FLAG

SSR : Slave Select Control Bits (Master Only) If AUTOSS bit is cleared, writing 1 to any bit location of this field sets the proper SPISSx0/1 line to an active state and writing 0 sets the line back to inactive state. If AUTOSS bit is set, writing 0 to any bit location of this field will keep the corresponding SPISSx0/1 line at inactive state writing 1 to any bit location of this field will select the corresponding SPISSx0/1 line to be automatically driven to active state for the duration of the transmit/receive, and will be driven to inactive state for the rest of the time. The active state of SPISSx0/1 is specified in SS_LVL. Note: SPISSx0 is also defined as slave select input in Slave mode.
bits : 0 - 1 (2 bit)
access : read-write

SS_LVL : Slave Select Active Level\nIt defines the active status of slave select signal (SPISSx0/1).\n
bits : 2 - 2 (1 bit)
access : read-write

Enumeration:

#0 : 0

The slave select signal SPISSx0/1 is active at low-level/falling-edge

#1 : 1

The slave select signal SPISSx0/1 is active at high-level/rising-edge

End of enumeration elements list.

AUTOSS : Automatic Slave Select Enable Bit (Master only)\n
bits : 3 - 3 (1 bit)
access : read-write

Enumeration:

#0 : 0

If this bit is cleared, slave select signals will be asserted/de-asserted by setting /clearing related bits in SSR[1:0]

#1 : 1

If this bit is set, SPISSx0/1 signals will be generated automatically. It means that device/slave select signal, which is set in SSR[1:0], will be asserted by the SPI controller when transmit/receive is started by setting GO_BUSY, and will be de-asserted after each transmit/receive is finished

End of enumeration elements list.

SS_LTRIG : Slave Select Level Trigger Enable Bit (Slave Only)\n
bits : 4 - 4 (1 bit)
access : read-write

Enumeration:

#0 : 0

The input slave select signal is edge-trigger. This is the default value. It depends on SS_LVL to decide the signal is active at falling-edge or rising-edge

#1 : 1

The slave select signal will be level-trigger. It depends on SS_LVL to decide the signal is active low or active high

End of enumeration elements list.

LTRIG_FLAG : Level Trigger Accomplish Flag\nWhen the SS_LTRIG bit is set in Slave mode, this bit can be read to indicate the received bit number is met the requirement or not.\nNote: This bit is READ only
bits : 5 - 5 (1 bit)
access : read-write

Enumeration:

#0 : 0

The transaction number or the transferred bit length of one transaction doesn't meet the specified requirements

#1 : 1

The transaction number and the transferred bit length met the specified requirements which defined in TX_NUM and TX_BIT_LEN

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.