Functions
Configuration functions
Peripheral Driver » LL Driver » SPI » Functions
Collaboration diagram for 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | SSI_EN | EN | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 1157 of file gr55xx_ll_spi.h.

## ◆ ll_spi_disable_micro_handshake()

__STATIC_INLINE void ll_spi_disable_micro_handshake | ( | ssi_regs_t * | SPIx | ) |

Disable Handshake in Microwire mode.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | MWC | MHS | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 1214 of file gr55xx_ll_spi.h.

## ◆ ll_spi_disable_salve_out()

__STATIC_INLINE void ll_spi_disable_salve_out | ( | ssi_regs_t * | SPIx | ) |

Disable slave output.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SLVOE | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 871 of file gr55xx_ll_spi.h.

## ◆ ll_spi_disable_ss()

__STATIC_INLINE void ll_spi_disable_ss | ( | ssi_regs_t * | SPIx,
|  | uint32_t | ss
| ) |  |

Disable slave select.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | SE | SLAVE1 | +-------------------—+--------------------------------—+ \endrst SE | SLAVE0

Parameters

  SPIx | SPI instance
  ss | This parameter can be one of the following values: LL_SSI_SLAVE1 LL_SSI_SLAVE0

Return values

  None |

Definition at line 1369 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SSTEN | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 539 of file gr55xx_ll_spi.h.

## ◆ ll_spi_disable_test_mode()

__STATIC_INLINE void ll_spi_disable_test_mode | ( | ssi_regs_t * | SPIx | ) |

Disable SPI test mode.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SRL | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 814 of file gr55xx_ll_spi.h.

## ◆ ll_spi_enable()

__STATIC_INLINE void ll_spi_enable | ( | ssi_regs_t * | SPIx | ) |

Enable SPI peripheral.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | SSI_EN | EN | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 1137 of file gr55xx_ll_spi.h.

## ◆ ll_spi_enable_micro_handshake()

__STATIC_INLINE void ll_spi_enable_micro_handshake | ( | ssi_regs_t * | SPIx | ) |

Enable Handshake in Microwire mode.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | MWC | MHS | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 1195 of file gr55xx_ll_spi.h.

## ◆ ll_spi_enable_slave_out()

__STATIC_INLINE void ll_spi_enable_slave_out | ( | ssi_regs_t * | SPIx | ) |

Enable slave output.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SLVOE | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 852 of file gr55xx_ll_spi.h.

## ◆ ll_spi_enable_ss()

__STATIC_INLINE void ll_spi_enable_ss | ( | ssi_regs_t * | SPIx,
|  | uint32_t | ss
| ) |  |

Enable slave select.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | SE | SLAVE1 | +-------------------—+--------------------------------—+ \endrst SE | SLAVE0

Parameters

  SPIx | SPI instance
  ss | This parameter can be one of the following values: LL_SSI_SLAVE1 LL_SSI_SLAVE0

Return values

  None |

Definition at line 1346 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SSTEN | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 519 of file gr55xx_ll_spi.h.

## ◆ ll_spi_enable_test_mode()

__STATIC_INLINE void ll_spi_enable_test_mode | ( | ssi_regs_t * | SPIx | ) |

Enable SPI test mode.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SRL | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  None |

Definition at line 795 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_baud_rate_prescaler()

__STATIC_INLINE uint32_t ll_spi_get_baud_rate_prescaler | ( | ssi_regs_t * | SPIx | ) |

Get baud rate prescaler.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | BAUD | SCKDIV | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one even value between 2 and 65534.

Definition at line 1432 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_clock_phase()

__STATIC_INLINE uint32_t ll_spi_get_clock_phase | ( | ssi_regs_t * | SPIx | ) |

Get clock phase.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SCPHA | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_SCPHA_1EDGE LL_SSI_SCPHA_2EDGE

Definition at line 1027 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_clock_polarity()

__STATIC_INLINE uint32_t ll_spi_get_clock_polarity | ( | ssi_regs_t * | SPIx | ) |

Get clock polarity.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SCPOL | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_SCPOL_LOW LL_SSI_SCPOL_HIGH

Definition at line 982 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | CFS | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_MW_CMDSIZE_1BIT LL_SSI_MW_CMDSIZE_2BIT LL_SSI_MW_CMDSIZE_3BIT LL_SSI_MW_CMDSIZE_4BIT LL_SSI_MW_CMDSIZE_5BIT LL_SSI_MW_CMDSIZE_6BIT LL_SSI_MW_CMDSIZE_7BIT LL_SSI_MW_CMDSIZE_8BIT LL_SSI_MW_CMDSIZE_9BIT LL_SSI_MW_CMDSIZE_10BIT LL_SSI_MW_CMDSIZE_11BIT LL_SSI_MW_CMDSIZE_12BIT LL_SSI_MW_CMDSIZE_13BIT LL_SSI_MW_CMDSIZE_14BIT LL_SSI_MW_CMDSIZE_15BIT LL_SSI_MW_CMDSIZE_16BIT

Definition at line 776 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_data_size()

__STATIC_INLINE uint32_t ll_spi_get_data_size | ( | ssi_regs_t * | SPIx | ) |

Get frame data size.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | DFS32 | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_DATASIZE_4BIT LL_SSI_DATASIZE_5BIT LL_SSI_DATASIZE_6BIT LL_SSI_DATASIZE_7BIT LL_SSI_DATASIZE_8BIT LL_SSI_DATASIZE_9BIT LL_SSI_DATASIZE_10BIT LL_SSI_DATASIZE_11BIT LL_SSI_DATASIZE_12BIT LL_SSI_DATASIZE_13BIT LL_SSI_DATASIZE_14BIT LL_SSI_DATASIZE_15BIT LL_SSI_DATASIZE_16BIT LL_SSI_DATASIZE_17BIT LL_SSI_DATASIZE_18BIT LL_SSI_DATASIZE_19BIT LL_SSI_DATASIZE_20BIT LL_SSI_DATASIZE_21BIT LL_SSI_DATASIZE_22BIT LL_SSI_DATASIZE_23BIT LL_SSI_DATASIZE_24BIT LL_SSI_DATASIZE_25BIT LL_SSI_DATASIZE_26BIT LL_SSI_DATASIZE_27BIT LL_SSI_DATASIZE_28BIT LL_SSI_DATASIZE_29BIT LL_SSI_DATASIZE_30BIT LL_SSI_DATASIZE_31BIT LL_SSI_DATASIZE_32BIT

Definition at line 703 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SPIFRF | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_FRF_SPI LL_SSI_FRF_DUALSPI LL_SSI_FRF_QUADSPI

Definition at line 606 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_id_code()

__STATIC_INLINE uint32_t ll_spi_get_id_code | ( | ssi_regs_t * | SPIx | ) |

Get ID code.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | IDCODE | ID | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value is const.

Definition at line 1567 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | MWC | MDD | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_MICROWIRE_RX LL_SSI_MICROWIRE_TX

Definition at line 1278 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | MWC | MWMOD | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_MICROWIRE_NON_SEQUENTIAL LL_SSI_MICROWIRE_SEQUENTIAL

Definition at line 1323 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL1 | NDF | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: 0 ~ 65535

Definition at line 1118 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_rx_fifo_level()

__STATIC_INLINE uint32_t ll_spi_get_rx_fifo_level | ( | ssi_regs_t * | SPIx | ) |

Get FIFO reception Level.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | RXFL | RXTFL | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: 0 ~ 8

Definition at line 1548 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | RXFTL | RFT | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: 0 ~ 7

Definition at line 1510 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_standard()

__STATIC_INLINE uint32_t ll_spi_get_standard | ( | ssi_regs_t * | SPIx | ) |

Get serial protocol used.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | FRF | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_PROTOCOL_MOTOROLA LL_SSI_PROTOCOL_TI LL_SSI_PROTOCOL_MICROWIRE

Definition at line 1073 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_transfer_direction()

__STATIC_INLINE uint32_t ll_spi_get_transfer_direction | ( | ssi_regs_t * | SPIx | ) |

Get transfer direction mode.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | TMOD | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: LL_SSI_FULL_DUPLEX LL_SSI_SIMPLEX_TX LL_SSI_SIMPLEX_RX LL_SSI_READ_EEPROM

Definition at line 937 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_tx_fifo_level()

__STATIC_INLINE uint32_t ll_spi_get_tx_fifo_level | ( | ssi_regs_t * | SPIx | ) |

Get FIFO Transmission Level.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | TXFL | TXTFL | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: 0 ~ 8

Definition at line 1529 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | TXFTL | TFT | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value can be one of the following values: 0 ~ 7

Definition at line 1471 of file gr55xx_ll_spi.h.

## ◆ ll_spi_get_version()

__STATIC_INLINE uint32_t ll_spi_get_version | ( | ssi_regs_t * | SPIx | ) |

Get IP version.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | COMP | VERSION | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  Returned | value is const.

Definition at line 1586 of file gr55xx_ll_spi.h.

## ◆ ll_spi_is_enabled()

__STATIC_INLINE uint32_t ll_spi_is_enabled | ( | ssi_regs_t * | SPIx | ) |

Check if SPI peripheral is enabled.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | SSI_EN | EN | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  State | of bit (1 or 0).

Definition at line 1176 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | MWC | MHS | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  State | of bit (1 or 0).

Definition at line 1233 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SLVOE | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  State | of bit (1 or 0).

Definition at line 890 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | SE | SLAVE1 | +-------------------—+--------------------------------—+ \endrst SE | SLAVE0

Parameters

  SPIx | SPI instance
  ss | This parameter can be one of the following values: LL_SSI_SLAVE1 LL_SSI_SLAVE0

Return values

  State | of bit (1 or 0).

Definition at line 1392 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SSTEN | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  State | of bit (1 or 0).

Definition at line 559 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SRL | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance

Return values

  State | of bit (1 or 0).

Definition at line 833 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | BAUD | SCKDIV | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  baud_rate | This parameter can be one even value between 2 and 65534, if the value is 0, the SCLK is disable.

Return values

  None |

Definition at line 1413 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SCPHA | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  clock_phase | This parameter can be one of the following values: LL_SSI_SCPHA_1EDGE LL_SSI_SCPHA_2EDGE

Return values

  None |

Definition at line 1006 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SCPOL | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  clock_polarity | This parameter can be one of the following values: LL_SSI_SCPOL_LOW LL_SSI_SCPOL_HIGH

Return values

  None |

Definition at line 961 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | CFS | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  size | This parameter can be one of the following values: LL_SSI_MW_CMDSIZE_1BIT LL_SSI_MW_CMDSIZE_2BIT LL_SSI_MW_CMDSIZE_3BIT LL_SSI_MW_CMDSIZE_4BIT LL_SSI_MW_CMDSIZE_5BIT LL_SSI_MW_CMDSIZE_6BIT LL_SSI_MW_CMDSIZE_7BIT LL_SSI_MW_CMDSIZE_8BIT LL_SSI_MW_CMDSIZE_9BIT LL_SSI_MW_CMDSIZE_10BIT LL_SSI_MW_CMDSIZE_11BIT LL_SSI_MW_CMDSIZE_12BIT LL_SSI_MW_CMDSIZE_13BIT LL_SSI_MW_CMDSIZE_14BIT LL_SSI_MW_CMDSIZE_15BIT LL_SSI_MW_CMDSIZE_16BIT

Return values

  None |

Definition at line 740 of file gr55xx_ll_spi.h.

## ◆ ll_spi_set_data_size()

__STATIC_INLINE void ll_spi_set_data_size | ( | ssi_regs_t * | SPIx,
|  | uint32_t | size
| ) |  |

Set frame data size.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | DFS32 | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  size | This parameter can be one of the following values: LL_SSI_DATASIZE_4BIT LL_SSI_DATASIZE_5BIT LL_SSI_DATASIZE_6BIT LL_SSI_DATASIZE_7BIT LL_SSI_DATASIZE_8BIT LL_SSI_DATASIZE_9BIT LL_SSI_DATASIZE_10BIT LL_SSI_DATASIZE_11BIT LL_SSI_DATASIZE_12BIT LL_SSI_DATASIZE_13BIT LL_SSI_DATASIZE_14BIT LL_SSI_DATASIZE_15BIT LL_SSI_DATASIZE_16BIT LL_SSI_DATASIZE_17BIT LL_SSI_DATASIZE_18BIT LL_SSI_DATASIZE_19BIT LL_SSI_DATASIZE_20BIT LL_SSI_DATASIZE_21BIT LL_SSI_DATASIZE_22BIT LL_SSI_DATASIZE_23BIT LL_SSI_DATASIZE_24BIT LL_SSI_DATASIZE_25BIT LL_SSI_DATASIZE_26BIT LL_SSI_DATASIZE_27BIT LL_SSI_DATASIZE_28BIT LL_SSI_DATASIZE_29BIT LL_SSI_DATASIZE_30BIT LL_SSI_DATASIZE_31BIT LL_SSI_DATASIZE_32BIT

Return values

  None |

Definition at line 655 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | SPIFRF | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  frf | This parameter can be one of the following values: LL_SSI_FRF_SPI LL_SSI_FRF_DUALSPI LL_SSI_FRF_QUADSPI

Return values

  None |

Definition at line 583 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | MWC | MDD | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  transfer_direction | This parameter can be one of the following values: LL_SSI_MICROWIRE_RX LL_SSI_MICROWIRE_TX

Return values

  None |

Definition at line 1256 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | MWC | MWMOD | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  transfer_mode | This parameter can be one of the following values: LL_SSI_MICROWIRE_NON_SEQUENTIAL LL_SSI_MICROWIRE_SEQUENTIAL

Return values

  None |

Definition at line 1301 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL1 | NDF | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  size | This parameter can be one of the following values: 0 ~ 65535

Return values

  None |

Definition at line 1096 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | RXFTL | RFT | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  threshold | This parameter can be one of the following values: 0 ~ 7

Return values

  None |

Definition at line 1491 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | FRF | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  standard | This parameter can be one of the following values: LL_SSI_PROTOCOL_MOTOROLA LL_SSI_PROTOCOL_TI LL_SSI_PROTOCOL_MICROWIRE

Return values

  None |

Definition at line 1051 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | CTRL0 | TMOD | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  transfer_direction | This parameter can be one of the following values: LL_SSI_FULL_DUPLEX LL_SSI_SIMPLEX_TX LL_SSI_SIMPLEX_RX LL_SSI_READ_EEPROM

Return values

  None |

Definition at line 914 of file gr55xx_ll_spi.h.

## ◆ 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.

\rst +-------------------—+--------------------------------—+ | Register | BitsName | +======================+===================================+ | TXFTL | TFT | +-------------------—+--------------------------------—+ \endrst

Parameters

  SPIx | SPI instance
  threshold | This parameter can be one of the following values: 0 ~ 7

Return values

  None |

Definition at line 1452 of file gr55xx_ll_spi.h.