STM32F439xx HAL User Manual
Functions
Configuration
SPI Exported Functions

Functions

__STATIC_INLINE void LL_SPI_Enable (SPI_TypeDef *SPIx)
 Enable SPI peripheral.
__STATIC_INLINE void LL_SPI_Disable (SPI_TypeDef *SPIx)
 Disable SPI peripheral.
__STATIC_INLINE uint32_t LL_SPI_IsEnabled (SPI_TypeDef *SPIx)
 Check if SPI peripheral is enabled.
__STATIC_INLINE void LL_SPI_SetMode (SPI_TypeDef *SPIx, uint32_t Mode)
 Set SPI operation mode to Master or Slave.
__STATIC_INLINE uint32_t LL_SPI_GetMode (SPI_TypeDef *SPIx)
 Get SPI operation mode (Master or Slave)
__STATIC_INLINE void LL_SPI_SetStandard (SPI_TypeDef *SPIx, uint32_t Standard)
 Set serial protocol used.
__STATIC_INLINE uint32_t LL_SPI_GetStandard (SPI_TypeDef *SPIx)
 Get serial protocol used.
__STATIC_INLINE void LL_SPI_SetClockPhase (SPI_TypeDef *SPIx, uint32_t ClockPhase)
 Set clock phase.
__STATIC_INLINE uint32_t LL_SPI_GetClockPhase (SPI_TypeDef *SPIx)
 Get clock phase.
__STATIC_INLINE void LL_SPI_SetClockPolarity (SPI_TypeDef *SPIx, uint32_t ClockPolarity)
 Set clock polarity.
__STATIC_INLINE uint32_t LL_SPI_GetClockPolarity (SPI_TypeDef *SPIx)
 Get clock polarity.
__STATIC_INLINE void LL_SPI_SetBaudRatePrescaler (SPI_TypeDef *SPIx, uint32_t BaudRate)
 Set baud rate prescaler.
__STATIC_INLINE uint32_t LL_SPI_GetBaudRatePrescaler (SPI_TypeDef *SPIx)
 Get baud rate prescaler.
__STATIC_INLINE void LL_SPI_SetTransferBitOrder (SPI_TypeDef *SPIx, uint32_t BitOrder)
 Set transfer bit order.
__STATIC_INLINE uint32_t LL_SPI_GetTransferBitOrder (SPI_TypeDef *SPIx)
 Get transfer bit order.
__STATIC_INLINE void LL_SPI_SetTransferDirection (SPI_TypeDef *SPIx, uint32_t TransferDirection)
 Set transfer direction mode.
__STATIC_INLINE uint32_t LL_SPI_GetTransferDirection (SPI_TypeDef *SPIx)
 Get transfer direction mode.
__STATIC_INLINE void LL_SPI_SetDataWidth (SPI_TypeDef *SPIx, uint32_t DataWidth)
 Set frame data width.
__STATIC_INLINE uint32_t LL_SPI_GetDataWidth (SPI_TypeDef *SPIx)
 Get frame data width.

Function Documentation

__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.
Reference Manual to LL API cross reference:
CR1 SPE LL_SPI_Disable
Parameters:
SPIxSPI Instance
Return values:
None

Definition at line 326 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE void LL_SPI_Enable ( SPI_TypeDef *  SPIx)

Enable SPI peripheral.

Reference Manual to LL API cross reference:
CR1 SPE LL_SPI_Enable
Parameters:
SPIxSPI Instance
Return values:
None

Definition at line 314 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetBaudRatePrescaler ( SPI_TypeDef *  SPIx)

Get baud rate prescaler.

Reference Manual to LL API cross reference:
CR1 BR LL_SPI_GetBaudRatePrescaler
Parameters:
SPIxSPI Instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 493 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetClockPhase ( SPI_TypeDef *  SPIx)

Get clock phase.

Reference Manual to LL API cross reference:
CR1 CPHA LL_SPI_GetClockPhase
Parameters:
SPIxSPI Instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 424 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetClockPolarity ( SPI_TypeDef *  SPIx)

Get clock polarity.

Reference Manual to LL API cross reference:
CR1 CPOL LL_SPI_GetClockPolarity
Parameters:
SPIxSPI Instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 453 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetDataWidth ( SPI_TypeDef *  SPIx)

Get frame data width.

Reference Manual to LL API cross reference:
CR1 DFF LL_SPI_GetDataWidth
Parameters:
SPIxSPI Instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 585 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetMode ( SPI_TypeDef *  SPIx)

Get SPI operation mode (Master or Slave)

Reference Manual to LL API cross reference:
CR1 MSTR LL_SPI_GetMode
CR1 SSI LL_SPI_GetMode
Parameters:
SPIxSPI Instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 367 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetStandard ( SPI_TypeDef *  SPIx)

Get serial protocol used.

Reference Manual to LL API cross reference:
CR2 FRF LL_SPI_GetStandard
Parameters:
SPIxSPI Instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 395 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetTransferBitOrder ( SPI_TypeDef *  SPIx)

Get transfer bit order.

Reference Manual to LL API cross reference:
CR1 LSBFIRST LL_SPI_GetTransferBitOrder
Parameters:
SPIxSPI Instance
Return values:
Returnedvalue can be one of the following values:

Definition at line 521 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_GetTransferDirection ( SPI_TypeDef *  SPIx)

Get transfer direction mode.

Reference Manual to LL API cross reference:
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:

Definition at line 558 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE uint32_t LL_SPI_IsEnabled ( SPI_TypeDef *  SPIx)

Check if SPI peripheral is enabled.

Reference Manual to LL API cross reference:
CR1 SPE LL_SPI_IsEnabled
Parameters:
SPIxSPI Instance
Return values:
Stateof bit (1 or 0).

Definition at line 337 of file stm32f4xx_ll_spi.h.

Referenced by LL_SPI_Init().

__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.
Reference Manual to LL API cross reference:
CR1 BR LL_SPI_SetBaudRatePrescaler
Parameters:
SPIxSPI Instance
BaudRateThis parameter can be one of the following values:
Return values:
None

Definition at line 474 of file stm32f4xx_ll_spi.h.

__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.
Reference Manual to LL API cross reference:
CR1 CPHA LL_SPI_SetClockPhase
Parameters:
SPIxSPI Instance
ClockPhaseThis parameter can be one of the following values:
Return values:
None

Definition at line 411 of file stm32f4xx_ll_spi.h.

__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.
Reference Manual to LL API cross reference:
CR1 CPOL LL_SPI_SetClockPolarity
Parameters:
SPIxSPI Instance
ClockPolarityThis parameter can be one of the following values:
Return values:
None

Definition at line 440 of file stm32f4xx_ll_spi.h.

__STATIC_INLINE void LL_SPI_SetDataWidth ( SPI_TypeDef *  SPIx,
uint32_t  DataWidth 
)

Set frame data width.

Reference Manual to LL API cross reference:
CR1 DFF LL_SPI_SetDataWidth
Parameters:
SPIxSPI Instance
DataWidthThis parameter can be one of the following values:
Return values:
None

Definition at line 572 of file stm32f4xx_ll_spi.h.

__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.
Reference Manual to LL API cross reference:
CR1 MSTR LL_SPI_SetMode
CR1 SSI LL_SPI_SetMode
Parameters:
SPIxSPI Instance
ModeThis parameter can be one of the following values:
Return values:
None

Definition at line 353 of file stm32f4xx_ll_spi.h.

__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.
Reference Manual to LL API cross reference:
CR2 FRF LL_SPI_SetStandard
Parameters:
SPIxSPI Instance
StandardThis parameter can be one of the following values:
Return values:
None

Definition at line 382 of file stm32f4xx_ll_spi.h.

__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.
Reference Manual to LL API cross reference:
CR1 LSBFIRST LL_SPI_SetTransferBitOrder
Parameters:
SPIxSPI Instance
BitOrderThis parameter can be one of the following values:
Return values:
None

Definition at line 508 of file stm32f4xx_ll_spi.h.

__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.
Reference Manual to LL API cross reference:
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:
Return values:
None

Definition at line 541 of file stm32f4xx_ll_spi.h.