Configuration functions

Functions

__STATIC_INLINE void ll_spi_enable_ss_toggle (ssi_regs_t *SPIx)
 Enable slave select toggle. More...
 
__STATIC_INLINE void ll_spi_disable_ss_toggle (ssi_regs_t *SPIx)
 Disable slave select toggle. More...
 
__STATIC_INLINE uint32_t ll_spi_is_enabled_ss_toggle (ssi_regs_t *SPIx)
 Check if slave select toggle is enabled. More...
 
__STATIC_INLINE void ll_spi_set_frame_format (ssi_regs_t *SPIx, uint32_t frf)
 Set data frame format for transmitting/receiving the data. More...
 
__STATIC_INLINE uint32_t ll_spi_get_frame_format (ssi_regs_t *SPIx)
 Get data frame format for transmitting/receiving the data. More...
 
__STATIC_INLINE void ll_spi_set_data_size (ssi_regs_t *SPIx, uint32_t size)
 Set frame data size. More...
 
__STATIC_INLINE uint32_t ll_spi_get_data_size (ssi_regs_t *SPIx)
 Get frame data size. More...
 
__STATIC_INLINE void ll_spi_set_control_frame_size (ssi_regs_t *SPIx, uint32_t size)
 Set the length of the control word for the Microwire frame format. More...
 
__STATIC_INLINE uint32_t ll_spi_get_control_frame_size (ssi_regs_t *SPIx)
 Get the length of the control word for the Microwire frame format. More...
 
__STATIC_INLINE void ll_spi_enable_test_mode (ssi_regs_t *SPIx)
 Enable SPI test mode. More...
 
__STATIC_INLINE void ll_spi_disable_test_mode (ssi_regs_t *SPIx)
 Disable SPI test mode. More...
 
__STATIC_INLINE uint32_t ll_spi_is_enabled_test_mode (ssi_regs_t *SPIx)
 Check if SPI test mode is enabled. More...
 
__STATIC_INLINE void ll_spi_enable_slave_out (ssi_regs_t *SPIx)
 Enable slave output. More...
 
__STATIC_INLINE void ll_spi_disable_salve_out (ssi_regs_t *SPIx)
 Disable slave output. More...
 
__STATIC_INLINE uint32_t ll_spi_is_enabled_slave_out (ssi_regs_t *SPIx)
 Check if slave output is enabled. More...
 
__STATIC_INLINE void ll_spi_set_transfer_direction (ssi_regs_t *SPIx, uint32_t transfer_direction)
 Set transfer direction mode. More...
 
__STATIC_INLINE uint32_t ll_spi_get_transfer_direction (ssi_regs_t *SPIx)
 Get transfer direction mode. More...
 
__STATIC_INLINE void ll_spi_set_clock_polarity (ssi_regs_t *SPIx, uint32_t clock_polarity)
 Set clock polarity. More...
 
__STATIC_INLINE uint32_t ll_spi_get_clock_polarity (ssi_regs_t *SPIx)
 Get clock polarity. More...
 
__STATIC_INLINE void ll_spi_set_clock_phase (ssi_regs_t *SPIx, uint32_t clock_phase)
 Set clock phase. More...
 
__STATIC_INLINE uint32_t ll_spi_get_clock_phase (ssi_regs_t *SPIx)
 Get clock phase. More...
 
__STATIC_INLINE void ll_spi_set_standard (ssi_regs_t *SPIx, uint32_t standard)
 Set serial protocol used. More...
 
__STATIC_INLINE uint32_t ll_spi_get_standard (ssi_regs_t *SPIx)
 Get serial protocol used. More...
 
__STATIC_INLINE void ll_spi_set_receive_size (ssi_regs_t *SPIx, uint32_t size)
 Set the number of data frames to be continuously received. More...
 
__STATIC_INLINE uint32_t ll_spi_get_receive_size (ssi_regs_t *SPIx)
 Get the number of data frames to be continuously received. More...
 
__STATIC_INLINE void ll_spi_enable (ssi_regs_t *SPIx)
 Enable SPI peripheral. More...
 
__STATIC_INLINE void ll_spi_disable (ssi_regs_t *SPIx)
 Disable SPI peripheral. More...
 
__STATIC_INLINE uint32_t ll_spi_is_enabled (ssi_regs_t *SPIx)
 Check if SPI peripheral is enabled. More...
 
__STATIC_INLINE void ll_spi_enable_micro_handshake (ssi_regs_t *SPIx)
 Enable Handshake in Microwire mode. More...
 
__STATIC_INLINE void ll_spi_disable_micro_handshake (ssi_regs_t *SPIx)
 Disable Handshake in Microwire mode. More...
 
__STATIC_INLINE uint32_t ll_spi_is_enabled_micro_handshake (ssi_regs_t *SPIx)
 Check if Handshake in Microwire mode is enabled. More...
 
__STATIC_INLINE void ll_spi_set_micro_transfer_direction (ssi_regs_t *SPIx, uint32_t transfer_direction)
 Set transfer direction mode in Microwire mode. More...
 
__STATIC_INLINE uint32_t ll_spi_get_micro_transfer_direction (ssi_regs_t *SPIx)
 Get transfer direction mode in Microwire mode. More...
 
__STATIC_INLINE void ll_spi_set_micro_transfer_mode (ssi_regs_t *SPIx, uint32_t transfer_mode)
 Set transfer mode in Microwire mode. More...
 
__STATIC_INLINE uint32_t ll_spi_get_micro_transfer_mode (ssi_regs_t *SPIx)
 Get transfer mode in Microwire mode. More...
 
__STATIC_INLINE void ll_spi_enable_ss (ssi_regs_t *SPIx, uint32_t ss)
 Enable slave select. More...
 
__STATIC_INLINE void ll_spi_disable_ss (ssi_regs_t *SPIx, uint32_t ss)
 Disable slave select. More...
 
__STATIC_INLINE uint32_t ll_spi_is_enabled_ss (ssi_regs_t *SPIx, uint32_t ss)
 Check if slave select is enabled. More...
 
__STATIC_INLINE void ll_spi_set_baud_rate_prescaler (ssi_regs_t *SPIx, uint32_t baud_rate)
 Set baud rate prescaler. More...
 
__STATIC_INLINE uint32_t ll_spi_get_baud_rate_prescaler (ssi_regs_t *SPIx)
 Get baud rate prescaler. More...
 
__STATIC_INLINE void ll_spi_set_tx_fifo_threshold (ssi_regs_t *SPIx, uint32_t threshold)
 Set threshold of TXFIFO that triggers an TXE event. More...
 
__STATIC_INLINE uint32_t ll_spi_get_tx_fifo_threshold (ssi_regs_t *SPIx)
 Get threshold of TXFIFO that triggers an TXE event. More...
 
__STATIC_INLINE void ll_spi_set_rx_fifo_threshold (ssi_regs_t *SPIx, uint32_t threshold)
 Set threshold of RXFIFO that triggers an RXNE event. More...
 
__STATIC_INLINE uint32_t ll_spi_get_rx_fifo_threshold (ssi_regs_t *SPIx)
 Get threshold of RXFIFO that triggers an RXNE event. More...
 
__STATIC_INLINE uint32_t ll_spi_get_tx_fifo_level (ssi_regs_t *SPIx)
 Get FIFO Transmission Level. More...
 
__STATIC_INLINE uint32_t ll_spi_get_rx_fifo_level (ssi_regs_t *SPIx)
 Get FIFO reception Level. More...
 
__STATIC_INLINE uint32_t ll_spi_get_id_code (ssi_regs_t *SPIx)
 Get ID code. More...
 
__STATIC_INLINE uint32_t ll_spi_get_version (ssi_regs_t *SPIx)
 Get IP version. More...
 

Detailed Description

Function Documentation

◆ ll_spi_disable()

__STATIC_INLINE void ll_spi_disable ( ssi_regs_t *  SPIx)

Disable SPI peripheral.

Note
When disabling the SPI, follow the procedure described in the Reference Manual.
Register BitsName
SSI_EN EN
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_disable_micro_handshake()

__STATIC_INLINE void ll_spi_disable_micro_handshake ( ssi_regs_t *  SPIx)

Disable Handshake in Microwire mode.

Register BitsName
MWC MHS
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_disable_salve_out()

__STATIC_INLINE void ll_spi_disable_salve_out ( ssi_regs_t *  SPIx)

Disable slave output.

Register BitsName
CTRL0 SLVOE
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_disable_ss()

__STATIC_INLINE void ll_spi_disable_ss ( ssi_regs_t *  SPIx,
uint32_t  ss 
)

Disable slave select.

Register BitsName
SE SLAVE1
SE SLAVE0
Parameters
SPIxSPI instance
ssThis parameter can be one of the following values:
Return values
None

◆ ll_spi_disable_ss_toggle()

__STATIC_INLINE void ll_spi_disable_ss_toggle ( ssi_regs_t *  SPIx)

Disable slave select toggle.

Note
This bit should not be changed when communication is ongoing.
Register BitsName
CTRL0 SSTEN
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_disable_test_mode()

__STATIC_INLINE void ll_spi_disable_test_mode ( ssi_regs_t *  SPIx)

Disable SPI test mode.

Register BitsName
CTRL0 SRL
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_enable()

__STATIC_INLINE void ll_spi_enable ( ssi_regs_t *  SPIx)

Enable SPI peripheral.

Register BitsName
SSI_EN EN
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_enable_micro_handshake()

__STATIC_INLINE void ll_spi_enable_micro_handshake ( ssi_regs_t *  SPIx)

Enable Handshake in Microwire mode.

Register BitsName
MWC MHS
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_enable_slave_out()

__STATIC_INLINE void ll_spi_enable_slave_out ( ssi_regs_t *  SPIx)

Enable slave output.

Register BitsName
CTRL0 SLVOE
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_enable_ss()

__STATIC_INLINE void ll_spi_enable_ss ( ssi_regs_t *  SPIx,
uint32_t  ss 
)

Enable slave select.

Register BitsName
SE SLAVE1
SE SLAVE0
Parameters
SPIxSPI instance
ssThis parameter can be one of the following values:
Return values
None

◆ ll_spi_enable_ss_toggle()

__STATIC_INLINE void ll_spi_enable_ss_toggle ( ssi_regs_t *  SPIx)

Enable slave select toggle.

Note
This bit should not be changed when communication is ongoing.
Register BitsName
CTRL0 SSTEN
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_enable_test_mode()

__STATIC_INLINE void ll_spi_enable_test_mode ( ssi_regs_t *  SPIx)

Enable SPI test mode.

Register BitsName
CTRL0 SRL
Parameters
SPIxSPI instance
Return values
None

◆ ll_spi_get_baud_rate_prescaler()

__STATIC_INLINE uint32_t ll_spi_get_baud_rate_prescaler ( ssi_regs_t *  SPIx)

Get baud rate prescaler.

Register BitsName
BAUD SCKDIV
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one even value between 2 and 65534.

◆ ll_spi_get_clock_phase()

__STATIC_INLINE uint32_t ll_spi_get_clock_phase ( ssi_regs_t *  SPIx)

Get clock phase.

Register BitsName
CTRL0 SCPHA
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_clock_polarity()

__STATIC_INLINE uint32_t ll_spi_get_clock_polarity ( ssi_regs_t *  SPIx)

Get clock polarity.

Register BitsName
CTRL0 SCPOL
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_control_frame_size()

__STATIC_INLINE uint32_t ll_spi_get_control_frame_size ( ssi_regs_t *  SPIx)

Get the length of the control word for the Microwire frame format.

Note
This bit should be written only when SPI is disabled (SSI_EN = 0) for correct operation.
Register BitsName
CTRL0 CFS
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_data_size()

◆ ll_spi_get_frame_format()

__STATIC_INLINE uint32_t ll_spi_get_frame_format ( ssi_regs_t *  SPIx)

Get data frame format for transmitting/receiving the data.

Note
This bit should be written only when SPI is disabled (SSI_EN = 0) for correct operation.
Register BitsName
CTRL0 SPIFRF
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_id_code()

__STATIC_INLINE uint32_t ll_spi_get_id_code ( ssi_regs_t *  SPIx)

Get ID code.

Register BitsName
IDCODE ID
Parameters
SPIxSPI instance
Return values
Returnedvalue is const.

◆ ll_spi_get_micro_transfer_direction()

__STATIC_INLINE uint32_t ll_spi_get_micro_transfer_direction ( ssi_regs_t *  SPIx)

Get transfer direction mode in Microwire mode.

Note
This bit should not be changed when communication is ongoing.
Register BitsName
MWC MDD
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_micro_transfer_mode()

__STATIC_INLINE uint32_t ll_spi_get_micro_transfer_mode ( ssi_regs_t *  SPIx)

Get transfer mode in Microwire mode.

Note
This bit should not be changed when communication is ongoing.
Register BitsName
MWC MWMOD
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_receive_size()

__STATIC_INLINE uint32_t ll_spi_get_receive_size ( ssi_regs_t *  SPIx)

Get the number of data frames to be continuously received.

Note
These bits should not be changed when communication is ongoing. This bits are effect when TMOD = 2b10 or 2b11. This bits are not effect in SPIS.
Register BitsName
CTRL1 NDF
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values: 0 ~ 65535

◆ ll_spi_get_rx_fifo_level()

__STATIC_INLINE uint32_t ll_spi_get_rx_fifo_level ( ssi_regs_t *  SPIx)

Get FIFO reception Level.

Register BitsName
RXFL RXTFL
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values: 0 ~ 8

◆ ll_spi_get_rx_fifo_threshold()

__STATIC_INLINE uint32_t ll_spi_get_rx_fifo_threshold ( ssi_regs_t *  SPIx)

Get threshold of RXFIFO that triggers an RXNE event.

Register BitsName
RXFTL RFT
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values: 0 ~ 7

◆ ll_spi_get_standard()

__STATIC_INLINE uint32_t ll_spi_get_standard ( ssi_regs_t *  SPIx)

Get serial protocol used.

Register BitsName
CTRL0 FRF
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_transfer_direction()

__STATIC_INLINE uint32_t ll_spi_get_transfer_direction ( ssi_regs_t *  SPIx)

Get transfer direction mode.

Register BitsName
CTRL0 TMOD
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values:

◆ ll_spi_get_tx_fifo_level()

__STATIC_INLINE uint32_t ll_spi_get_tx_fifo_level ( ssi_regs_t *  SPIx)

Get FIFO Transmission Level.

Register BitsName
TXFL TXTFL
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values: 0 ~ 8

◆ ll_spi_get_tx_fifo_threshold()

__STATIC_INLINE uint32_t ll_spi_get_tx_fifo_threshold ( ssi_regs_t *  SPIx)

Get threshold of TXFIFO that triggers an TXE event.

Register BitsName
TXFTL TFT
Parameters
SPIxSPI instance
Return values
Returnedvalue can be one of the following values: 0 ~ 7

◆ ll_spi_get_version()

__STATIC_INLINE uint32_t ll_spi_get_version ( ssi_regs_t *  SPIx)

Get IP version.

Register BitsName
COMP VERSION
Parameters
SPIxSPI instance
Return values
Returnedvalue is const.

◆ ll_spi_is_enabled()

__STATIC_INLINE uint32_t ll_spi_is_enabled ( ssi_regs_t *  SPIx)

Check if SPI peripheral is enabled.

Register BitsName
SSI_EN EN
Parameters
SPIxSPI instance
Return values
Stateof bit (1 or 0).

◆ ll_spi_is_enabled_micro_handshake()

__STATIC_INLINE uint32_t ll_spi_is_enabled_micro_handshake ( ssi_regs_t *  SPIx)

Check if Handshake in Microwire mode is enabled.

Register BitsName
MWC MHS
Parameters
SPIxSPI instance
Return values
Stateof bit (1 or 0).

◆ ll_spi_is_enabled_slave_out()

__STATIC_INLINE uint32_t ll_spi_is_enabled_slave_out ( ssi_regs_t *  SPIx)

Check if slave output is enabled.

Register BitsName
CTRL0 SLVOE
Parameters
SPIxSPI instance
Return values
Stateof bit (1 or 0).

◆ ll_spi_is_enabled_ss()

__STATIC_INLINE uint32_t ll_spi_is_enabled_ss ( ssi_regs_t *  SPIx,
uint32_t  ss 
)

Check if slave select is enabled.

Register BitsName
SE SLAVE1
SE SLAVE0
Parameters
SPIxSPI instance
ssThis parameter can be one of the following values:
Return values
Stateof bit (1 or 0).

◆ ll_spi_is_enabled_ss_toggle()

__STATIC_INLINE uint32_t ll_spi_is_enabled_ss_toggle ( ssi_regs_t *  SPIx)

Check if slave select toggle is enabled.

Note
This bit should not be changed when communication is ongoing.
Register BitsName
CTRL0 SSTEN
Parameters
SPIxSPI instance
Return values
Stateof bit (1 or 0).

◆ ll_spi_is_enabled_test_mode()

__STATIC_INLINE uint32_t ll_spi_is_enabled_test_mode ( ssi_regs_t *  SPIx)

Check if SPI test mode is enabled.

Register BitsName
CTRL0 SRL
Parameters
SPIxSPI instance
Return values
Stateof bit (1 or 0).

◆ ll_spi_set_baud_rate_prescaler()

__STATIC_INLINE void ll_spi_set_baud_rate_prescaler ( ssi_regs_t *  SPIx,
uint32_t  baud_rate 
)

Set baud rate prescaler.

Note
These bits should not be changed when communication is ongoing. SPI BaudRate = fPCLK/Prescaler.
Register BitsName
BAUD SCKDIV
Parameters
SPIxSPI instance
baud_rateThis parameter can be one even value between 2 and 65534, if the value is 0, the SCLK is disable.
Return values
None

◆ ll_spi_set_clock_phase()

__STATIC_INLINE void ll_spi_set_clock_phase ( ssi_regs_t *  SPIx,
uint32_t  clock_phase 
)

Set clock phase.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode.
Register BitsName
CTRL0 SCPHA
Parameters
SPIxSPI instance
clock_phaseThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_clock_polarity()

__STATIC_INLINE void ll_spi_set_clock_polarity ( ssi_regs_t *  SPIx,
uint32_t  clock_polarity 
)

Set clock polarity.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode.
Register BitsName
CTRL0 SCPOL
Parameters
SPIxSPI instance
clock_polarityThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_control_frame_size()

__STATIC_INLINE void ll_spi_set_control_frame_size ( ssi_regs_t *  SPIx,
uint32_t  size 
)

Set the length of the control word for the Microwire frame format.

Note
This bit should be written only when SPI is disabled (SSI_EN = 0) for correct operation.
Register BitsName
CTRL0 CFS
Parameters
SPIxSPI instance
sizeThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_data_size()

◆ ll_spi_set_frame_format()

__STATIC_INLINE void ll_spi_set_frame_format ( ssi_regs_t *  SPIx,
uint32_t  frf 
)

Set data frame format for transmitting/receiving the data.

Note
This bit should be written only when SPI is disabled (SSI_EN = 0) for correct operation.
Register BitsName
CTRL0 SPIFRF
Parameters
SPIxSPI instance
frfThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_micro_transfer_direction()

__STATIC_INLINE void ll_spi_set_micro_transfer_direction ( ssi_regs_t *  SPIx,
uint32_t  transfer_direction 
)

Set transfer direction mode in Microwire mode.

Note
This bit should not be changed when communication is ongoing.
Register BitsName
MWC MDD
Parameters
SPIxSPI instance
transfer_directionThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_micro_transfer_mode()

__STATIC_INLINE void ll_spi_set_micro_transfer_mode ( ssi_regs_t *  SPIx,
uint32_t  transfer_mode 
)

Set transfer mode in Microwire mode.

Note
This bit should not be changed when communication is ongoing.
Register BitsName
MWC MWMOD
Parameters
SPIxSPI instance
transfer_modeThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_receive_size()

__STATIC_INLINE void ll_spi_set_receive_size ( ssi_regs_t *  SPIx,
uint32_t  size 
)

Set the number of data frames to be continuously received.

Note
These bits should not be changed when communication is ongoing. This bits are effect when TMOD = 2b10 or 2b11. This bits are not effect in SPIS.
Register BitsName
CTRL1 NDF
Parameters
SPIxSPI instance
sizeThis parameter can be one of the following values: 0 ~ 65535
Return values
None

◆ ll_spi_set_rx_fifo_threshold()

__STATIC_INLINE void ll_spi_set_rx_fifo_threshold ( ssi_regs_t *  SPIx,
uint32_t  threshold 
)

Set threshold of RXFIFO that triggers an RXNE event.

Register BitsName
RXFTL RFT
Parameters
SPIxSPI instance
thresholdThis parameter can be one of the following values: 0 ~ 7
Return values
None

◆ ll_spi_set_standard()

__STATIC_INLINE void ll_spi_set_standard ( ssi_regs_t *  SPIx,
uint32_t  standard 
)

Set serial protocol used.

Note
This bit should be written only when SPI is disabled (SSI_EN = 0) for correct operation.
Register BitsName
CTRL0 FRF
Parameters
SPIxSPI instance
standardThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_transfer_direction()

__STATIC_INLINE void ll_spi_set_transfer_direction ( ssi_regs_t *  SPIx,
uint32_t  transfer_direction 
)

Set transfer direction mode.

Register BitsName
CTRL0 TMOD
Parameters
SPIxSPI instance
transfer_directionThis parameter can be one of the following values:
Return values
None

◆ ll_spi_set_tx_fifo_threshold()

__STATIC_INLINE void ll_spi_set_tx_fifo_threshold ( ssi_regs_t *  SPIx,
uint32_t  threshold 
)

Set threshold of TXFIFO that triggers an TXE event.

Register BitsName
TXFTL TFT
Parameters
SPIxSPI instance
thresholdThis parameter can be one of the following values: 0 ~ 7
Return values
None