STM32F4xx_HAL_Driver  1.8.3
+ Collaboration diagram for Configuration:

Functions

__STATIC_INLINE void LL_SPI_Enable (SPI_TypeDef *SPIx)
 Enable SPI peripheral @rmtoll CR1 SPE LL_SPI_Enable. More...
 
__STATIC_INLINE void LL_SPI_Disable (SPI_TypeDef *SPIx)
 Disable SPI peripheral. More...
 
__STATIC_INLINE uint32_t LL_SPI_IsEnabled (const SPI_TypeDef *SPIx)
 Check if SPI peripheral is enabled @rmtoll CR1 SPE LL_SPI_IsEnabled. More...
 
__STATIC_INLINE void LL_SPI_SetMode (SPI_TypeDef *SPIx, uint32_t Mode)
 Set SPI operation mode to Master or Slave. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetMode (const SPI_TypeDef *SPIx)
 Get SPI operation mode (Master or Slave) @rmtoll CR1 MSTR LL_SPI_GetMode
CR1 SSI LL_SPI_GetMode. More...
 
__STATIC_INLINE void LL_SPI_SetStandard (SPI_TypeDef *SPIx, uint32_t Standard)
 Set serial protocol used. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetStandard (const SPI_TypeDef *SPIx)
 Get serial protocol used @rmtoll CR2 FRF LL_SPI_GetStandard. More...
 
__STATIC_INLINE void LL_SPI_SetClockPhase (SPI_TypeDef *SPIx, uint32_t ClockPhase)
 Set clock phase. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetClockPhase (const SPI_TypeDef *SPIx)
 Get clock phase @rmtoll CR1 CPHA LL_SPI_GetClockPhase. More...
 
__STATIC_INLINE void LL_SPI_SetClockPolarity (SPI_TypeDef *SPIx, uint32_t ClockPolarity)
 Set clock polarity. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetClockPolarity (const SPI_TypeDef *SPIx)
 Get clock polarity @rmtoll CR1 CPOL LL_SPI_GetClockPolarity. More...
 
__STATIC_INLINE void LL_SPI_SetBaudRatePrescaler (SPI_TypeDef *SPIx, uint32_t BaudRate)
 Set baud rate prescaler. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetBaudRatePrescaler (const SPI_TypeDef *SPIx)
 Get baud rate prescaler @rmtoll CR1 BR LL_SPI_GetBaudRatePrescaler. More...
 
__STATIC_INLINE void LL_SPI_SetTransferBitOrder (SPI_TypeDef *SPIx, uint32_t BitOrder)
 Set transfer bit order. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetTransferBitOrder (const SPI_TypeDef *SPIx)
 Get transfer bit order @rmtoll CR1 LSBFIRST LL_SPI_GetTransferBitOrder. More...
 
__STATIC_INLINE void LL_SPI_SetTransferDirection (SPI_TypeDef *SPIx, uint32_t TransferDirection)
 Set transfer direction mode. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetTransferDirection (const SPI_TypeDef *SPIx)
 Get transfer direction mode @rmtoll CR1 RXONLY LL_SPI_GetTransferDirection
CR1 BIDIMODE LL_SPI_GetTransferDirection
CR1 BIDIOE LL_SPI_GetTransferDirection. More...
 
__STATIC_INLINE void LL_SPI_SetDataWidth (SPI_TypeDef *SPIx, uint32_t DataWidth)
 Set frame data width @rmtoll CR1 DFF LL_SPI_SetDataWidth. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetDataWidth (const SPI_TypeDef *SPIx)
 Get frame data width @rmtoll CR1 DFF LL_SPI_GetDataWidth. More...
 

Detailed Description

Function Documentation

◆ LL_SPI_Disable()

__STATIC_INLINE void LL_SPI_Disable ( SPI_TypeDef *  SPIx)

Disable SPI peripheral.

Note
When disabling the SPI, follow the procedure described in the Reference Manual. @rmtoll CR1 SPE LL_SPI_Disable
Parameters
SPIxSPI Instance
Return values
None

Definition at line 309 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_Enable()

__STATIC_INLINE void LL_SPI_Enable ( SPI_TypeDef *  SPIx)

Enable SPI peripheral @rmtoll CR1 SPE LL_SPI_Enable.

Parameters
SPIxSPI Instance
Return values
None

Definition at line 297 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetBaudRatePrescaler()

__STATIC_INLINE uint32_t LL_SPI_GetBaudRatePrescaler ( const SPI_TypeDef *  SPIx)

Get baud rate prescaler @rmtoll CR1 BR LL_SPI_GetBaudRatePrescaler.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_BAUDRATEPRESCALER_DIV2
  • LL_SPI_BAUDRATEPRESCALER_DIV4
  • LL_SPI_BAUDRATEPRESCALER_DIV8
  • LL_SPI_BAUDRATEPRESCALER_DIV16
  • LL_SPI_BAUDRATEPRESCALER_DIV32
  • LL_SPI_BAUDRATEPRESCALER_DIV64
  • LL_SPI_BAUDRATEPRESCALER_DIV128
  • LL_SPI_BAUDRATEPRESCALER_DIV256

Definition at line 476 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetClockPhase()

__STATIC_INLINE uint32_t LL_SPI_GetClockPhase ( const SPI_TypeDef *  SPIx)

Get clock phase @rmtoll CR1 CPHA LL_SPI_GetClockPhase.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_PHASE_1EDGE
  • LL_SPI_PHASE_2EDGE

Definition at line 407 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetClockPolarity()

__STATIC_INLINE uint32_t LL_SPI_GetClockPolarity ( const SPI_TypeDef *  SPIx)

Get clock polarity @rmtoll CR1 CPOL LL_SPI_GetClockPolarity.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_POLARITY_LOW
  • LL_SPI_POLARITY_HIGH

Definition at line 436 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetDataWidth()

__STATIC_INLINE uint32_t LL_SPI_GetDataWidth ( const SPI_TypeDef *  SPIx)

Get frame data width @rmtoll CR1 DFF LL_SPI_GetDataWidth.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_DATAWIDTH_8BIT
  • LL_SPI_DATAWIDTH_16BIT

Definition at line 568 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetMode()

__STATIC_INLINE uint32_t LL_SPI_GetMode ( const SPI_TypeDef *  SPIx)

Get SPI operation mode (Master or Slave) @rmtoll CR1 MSTR LL_SPI_GetMode
CR1 SSI LL_SPI_GetMode.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_MODE_MASTER
  • LL_SPI_MODE_SLAVE

Definition at line 350 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetStandard()

__STATIC_INLINE uint32_t LL_SPI_GetStandard ( const SPI_TypeDef *  SPIx)

Get serial protocol used @rmtoll CR2 FRF LL_SPI_GetStandard.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_PROTOCOL_MOTOROLA
  • LL_SPI_PROTOCOL_TI

Definition at line 378 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetTransferBitOrder()

__STATIC_INLINE uint32_t LL_SPI_GetTransferBitOrder ( const SPI_TypeDef *  SPIx)

Get transfer bit order @rmtoll CR1 LSBFIRST LL_SPI_GetTransferBitOrder.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_LSB_FIRST
  • LL_SPI_MSB_FIRST

Definition at line 504 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_GetTransferDirection()

__STATIC_INLINE uint32_t LL_SPI_GetTransferDirection ( const SPI_TypeDef *  SPIx)

Get transfer direction mode @rmtoll CR1 RXONLY LL_SPI_GetTransferDirection
CR1 BIDIMODE LL_SPI_GetTransferDirection
CR1 BIDIOE LL_SPI_GetTransferDirection.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_FULL_DUPLEX
  • LL_SPI_SIMPLEX_RX
  • LL_SPI_HALF_DUPLEX_RX
  • LL_SPI_HALF_DUPLEX_TX

Definition at line 541 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_IsEnabled()

__STATIC_INLINE uint32_t LL_SPI_IsEnabled ( const SPI_TypeDef *  SPIx)

Check if SPI peripheral is enabled @rmtoll CR1 SPE LL_SPI_IsEnabled.

Parameters
SPIxSPI Instance
Return values
Stateof bit (1 or 0).

Definition at line 320 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetBaudRatePrescaler()

__STATIC_INLINE void LL_SPI_SetBaudRatePrescaler ( SPI_TypeDef *  SPIx,
uint32_t  BaudRate 
)

Set baud rate prescaler.

Note
These bits should not be changed when communication is ongoing. SPI BaudRate = fPCLK/Prescaler. @rmtoll CR1 BR LL_SPI_SetBaudRatePrescaler
Parameters
SPIxSPI Instance
BaudRateThis parameter can be one of the following values:
  • LL_SPI_BAUDRATEPRESCALER_DIV2
  • LL_SPI_BAUDRATEPRESCALER_DIV4
  • LL_SPI_BAUDRATEPRESCALER_DIV8
  • LL_SPI_BAUDRATEPRESCALER_DIV16
  • LL_SPI_BAUDRATEPRESCALER_DIV32
  • LL_SPI_BAUDRATEPRESCALER_DIV64
  • LL_SPI_BAUDRATEPRESCALER_DIV128
  • LL_SPI_BAUDRATEPRESCALER_DIV256
Return values
None

Definition at line 457 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetClockPhase()

__STATIC_INLINE void LL_SPI_SetClockPhase ( SPI_TypeDef *  SPIx,
uint32_t  ClockPhase 
)

Set clock phase.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode. @rmtoll CR1 CPHA LL_SPI_SetClockPhase
Parameters
SPIxSPI Instance
ClockPhaseThis parameter can be one of the following values:
  • LL_SPI_PHASE_1EDGE
  • LL_SPI_PHASE_2EDGE
Return values
None

Definition at line 394 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetClockPolarity()

__STATIC_INLINE void LL_SPI_SetClockPolarity ( SPI_TypeDef *  SPIx,
uint32_t  ClockPolarity 
)

Set clock polarity.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode. @rmtoll CR1 CPOL LL_SPI_SetClockPolarity
Parameters
SPIxSPI Instance
ClockPolarityThis parameter can be one of the following values:
  • LL_SPI_POLARITY_LOW
  • LL_SPI_POLARITY_HIGH
Return values
None

Definition at line 423 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetDataWidth()

__STATIC_INLINE void LL_SPI_SetDataWidth ( SPI_TypeDef *  SPIx,
uint32_t  DataWidth 
)

Set frame data width @rmtoll CR1 DFF LL_SPI_SetDataWidth.

Parameters
SPIxSPI Instance
DataWidthThis parameter can be one of the following values:
  • LL_SPI_DATAWIDTH_8BIT
  • LL_SPI_DATAWIDTH_16BIT
Return values
None

Definition at line 555 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetMode()

__STATIC_INLINE void LL_SPI_SetMode ( SPI_TypeDef *  SPIx,
uint32_t  Mode 
)

Set SPI operation mode to Master or Slave.

Note
This bit should not be changed when communication is ongoing. @rmtoll CR1 MSTR LL_SPI_SetMode
CR1 SSI LL_SPI_SetMode
Parameters
SPIxSPI Instance
ModeThis parameter can be one of the following values:
  • LL_SPI_MODE_MASTER
  • LL_SPI_MODE_SLAVE
Return values
None

Definition at line 336 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetStandard()

__STATIC_INLINE void LL_SPI_SetStandard ( SPI_TypeDef *  SPIx,
uint32_t  Standard 
)

Set serial protocol used.

Note
This bit should be written only when SPI is disabled (SPE = 0) for correct operation. @rmtoll CR2 FRF LL_SPI_SetStandard
Parameters
SPIxSPI Instance
StandardThis parameter can be one of the following values:
  • LL_SPI_PROTOCOL_MOTOROLA
  • LL_SPI_PROTOCOL_TI
Return values
None

Definition at line 365 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetTransferBitOrder()

__STATIC_INLINE void LL_SPI_SetTransferBitOrder ( SPI_TypeDef *  SPIx,
uint32_t  BitOrder 
)

Set transfer bit order.

Note
This bit should not be changed when communication is ongoing. This bit is not used in SPI TI mode. @rmtoll CR1 LSBFIRST LL_SPI_SetTransferBitOrder
Parameters
SPIxSPI Instance
BitOrderThis parameter can be one of the following values:
  • LL_SPI_LSB_FIRST
  • LL_SPI_MSB_FIRST
Return values
None

Definition at line 491 of file stm32f4xx_ll_spi.h.

◆ LL_SPI_SetTransferDirection()

__STATIC_INLINE void LL_SPI_SetTransferDirection ( SPI_TypeDef *  SPIx,
uint32_t  TransferDirection 
)

Set transfer direction mode.

Note
For Half-Duplex mode, Rx Direction is set by default. In master mode, the MOSI pin is used and in slave mode, the MISO pin is used for Half-Duplex. @rmtoll CR1 RXONLY LL_SPI_SetTransferDirection
CR1 BIDIMODE LL_SPI_SetTransferDirection
CR1 BIDIOE LL_SPI_SetTransferDirection
Parameters
SPIxSPI Instance
TransferDirectionThis parameter can be one of the following values:
  • LL_SPI_FULL_DUPLEX
  • LL_SPI_SIMPLEX_RX
  • LL_SPI_HALF_DUPLEX_RX
  • LL_SPI_HALF_DUPLEX_TX
Return values
None

Definition at line 524 of file stm32f4xx_ll_spi.h.