Hal Drivers for L4
Dependents: BSP OneHopeOnePrayer FINAL_AUDIO_RECORD AudioDemo
Fork of STM32L4xx_HAL_Driver by
Configuration
[SPI Exported Functions]
Functions | |
__STATIC_INLINE void | LL_SPI_Enable (SPI_TypeDef *SPIx) |
Enable SPI peripheral CR1 SPE LL_SPI_Enable. | |
__STATIC_INLINE void | LL_SPI_Disable (SPI_TypeDef *SPIx) |
Disable SPI peripheral. | |
__STATIC_INLINE void | LL_SPI_IsEnabled (SPI_TypeDef *SPIx) |
Check if SPI peripheral is enabled CR1 SPE LL_SPI_IsEnabled. | |
__STATIC_INLINE void | LL_SPI_SetMode (SPI_TypeDef *SPIx, uint32_t Mode) |
Set SPI Mode to Master or Slave. | |
__STATIC_INLINE uint32_t | LL_SPI_GetMode (SPI_TypeDef *SPIx) |
Get SPI Mode (Master or Slave) CR1 MSTR LL_SPI_GetMode CR1 SSI LL_SPI_GetMode. | |
__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) |
Set Serial protocol used CR2 FRF LL_SPI_GetStandard. | |
__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 CR1 CPHA LL_SPI_GetClockPhase. | |
__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 CR1 CPOL LL_SPI_GetClockPolarity. | |
__STATIC_INLINE void | LL_SPI_SetBaudRatePrescaler (SPI_TypeDef *SPIx, uint32_t Baudrate) |
Set Baudrate Prescaler. | |
__STATIC_INLINE uint32_t | LL_SPI_GetBaudRatePrescaler (SPI_TypeDef *SPIx) |
Get Baudrate Prescaler CR1 BR LL_SPI_GetBaudRatePrescaler. | |
__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 CR1 LSBFIRST LL_SPI_GetTransferBitOrder. | |
__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 CR1 RXONLY LL_SPI_GetTransferDirection CR1 BIDIMODE LL_SPI_GetTransferDirection. | |
__STATIC_INLINE void | LL_SPI_SetHalfDuplexDirection (SPI_TypeDef *SPIx, uint32_t HalfDuplexDirection) |
Set direction for Half-Duplex Mode. | |
__STATIC_INLINE uint32_t | LL_SPI_GetHalfDuplexDirection (SPI_TypeDef *SPIx) |
Get direction for Half-Duplex Mode. | |
__STATIC_INLINE void | LL_SPI_SetDataWidth (SPI_TypeDef *SPIx, uint32_t DataWidth) |
Set Frame Data Size CR2 DS LL_SPI_SetDataWidth. | |
__STATIC_INLINE uint32_t | LL_SPI_GetDataWidth (SPI_TypeDef *SPIx) |
Get Frame Data Size CR2 DS LL_SPI_GetDataWidth. | |
__STATIC_INLINE void | LL_SPI_SetRxFIFOThreshold (SPI_TypeDef *SPIx, uint32_t Threshold) |
Set threshold of RXFIFO that triggers an RXNE event CR2 FRXTH LL_SPI_SetRxFIFOThreshold. | |
__STATIC_INLINE uint32_t | LL_SPI_GetRxFIFOThreshold (SPI_TypeDef *SPIx) |
Get threshold of RXFIFO that triggers an RXNE event CR2 FRXTH LL_SPI_GetRxFIFOThreshold. |
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. CR1 SPE LL_SPI_Disable
- Parameters:
-
SPIx SPI Instance
- Return values:
-
None
Definition at line 322 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE void LL_SPI_Enable | ( | SPI_TypeDef * | SPIx ) |
Enable SPI peripheral CR1 SPE LL_SPI_Enable.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
None
Definition at line 310 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetBaudRatePrescaler | ( | SPI_TypeDef * | SPIx ) |
Get Baudrate Prescaler CR1 BR LL_SPI_GetBaudRatePrescaler.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value 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 488 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetClockPhase | ( | SPI_TypeDef * | SPIx ) |
Get Clock phase CR1 CPHA LL_SPI_GetClockPhase.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_PHASE_1EDGE
- LL_SPI_PHASE_2EDGE
Definition at line 419 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetClockPolarity | ( | SPI_TypeDef * | SPIx ) |
Get Clock polarity CR1 CPOL LL_SPI_GetClockPolarity.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_POLARITY_LOW
- LL_SPI_POLARITY_HIGH
Definition at line 448 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetDataWidth | ( | SPI_TypeDef * | SPIx ) |
Get Frame Data Size CR2 DS LL_SPI_GetDataWidth.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_DATAWIDTH_4BIT
- LL_SPI_DATAWIDTH_5BIT
- LL_SPI_DATAWIDTH_6BIT
- LL_SPI_DATAWIDTH_7BIT
- LL_SPI_DATAWIDTH_8BIT
- LL_SPI_DATAWIDTH_9BIT
- LL_SPI_DATAWIDTH_10BIT
- LL_SPI_DATAWIDTH_11BIT
- LL_SPI_DATAWIDTH_12BIT
- LL_SPI_DATAWIDTH_13BIT
- LL_SPI_DATAWIDTH_14BIT
- LL_SPI_DATAWIDTH_15BIT
- LL_SPI_DATAWIDTH_16BIT
Definition at line 627 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetHalfDuplexDirection | ( | SPI_TypeDef * | SPIx ) |
Get direction for Half-Duplex Mode.
- Note:
- In master mode, the MOSI pin is used and in slave mode, the MISO pin is used for Half-Duplex. CR1 BIDIOE LL_SPI_GetHalfDuplexDirection
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_DIRECTION_HALF_DUPLEX_TX
- LL_SPI_DIRECTION_HALF_DUPLEX_RX
Definition at line 578 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetMode | ( | SPI_TypeDef * | SPIx ) |
Get SPI Mode (Master or Slave) CR1 MSTR LL_SPI_GetMode
CR1 SSI LL_SPI_GetMode.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_MODE_MASTER
- LL_SPI_MODE_SLAVE
Definition at line 362 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetRxFIFOThreshold | ( | SPI_TypeDef * | SPIx ) |
Get threshold of RXFIFO that triggers an RXNE event CR2 FRXTH LL_SPI_GetRxFIFOThreshold.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_RX_FIFO_TH_HALF
- LL_SPI_RX_FIFO_TH_QUARTER
Definition at line 654 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetStandard | ( | SPI_TypeDef * | SPIx ) |
Set Serial protocol used CR2 FRF LL_SPI_GetStandard.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_PROTOCOL_MOTOROLA
- LL_SPI_PROTOCOL_TI
Definition at line 390 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetTransferBitOrder | ( | SPI_TypeDef * | SPIx ) |
Get Transfer Bit Order CR1 LSBFIRST LL_SPI_GetTransferBitOrder.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_LSB_FIRST
- LL_SPI_MSB_FIRST
Definition at line 516 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE uint32_t LL_SPI_GetTransferDirection | ( | SPI_TypeDef * | SPIx ) |
Get Transfer Direction Mode CR1 RXONLY LL_SPI_GetTransferDirection
CR1 BIDIMODE LL_SPI_GetTransferDirection.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
Returned value can be one of the following values: - LL_SPI_FULL_DUPLEX
- LL_SPI_SIMPLEX_RX
- LL_SPI_HALF_DUPLEX
Definition at line 549 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE void LL_SPI_IsEnabled | ( | SPI_TypeDef * | SPIx ) |
Check if SPI peripheral is enabled CR1 SPE LL_SPI_IsEnabled.
- Parameters:
-
SPIx SPI Instance
- Return values:
-
None
Definition at line 333 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE void LL_SPI_SetBaudRatePrescaler | ( | SPI_TypeDef * | SPIx, |
uint32_t | Baudrate | ||
) |
Set Baudrate Prescaler.
- Note:
- These bits should not be changed when communication is ongoing. SPI BaudRate = fPCLK/Pescaler. CR1 BR LL_SPI_SetBaudRatePrescaler
- Parameters:
-
SPIx SPI Instance Baudrate This 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 469 of file stm32l4xx_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. CR1 CPHA LL_SPI_SetClockPhase
- Parameters:
-
SPIx SPI Instance ClockPhase This parameter can be one of the following values: - LL_SPI_PHASE_1EDGE
- LL_SPI_PHASE_2EDGE
- Return values:
-
None
Definition at line 406 of file stm32l4xx_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. CR1 CPOL LL_SPI_SetClockPolarity
- Parameters:
-
SPIx SPI Instance ClockPolarity This parameter can be one of the following values: - LL_SPI_POLARITY_LOW
- LL_SPI_POLARITY_HIGH
- Return values:
-
None
Definition at line 435 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE void LL_SPI_SetDataWidth | ( | SPI_TypeDef * | SPIx, |
uint32_t | DataWidth | ||
) |
Set Frame Data Size CR2 DS LL_SPI_SetDataWidth.
- Parameters:
-
SPIx SPI Instance DataWidth This parameter can be one of the following values: - LL_SPI_DATAWIDTH_4BIT
- LL_SPI_DATAWIDTH_5BIT
- LL_SPI_DATAWIDTH_6BIT
- LL_SPI_DATAWIDTH_7BIT
- LL_SPI_DATAWIDTH_8BIT
- LL_SPI_DATAWIDTH_9BIT
- LL_SPI_DATAWIDTH_10BIT
- LL_SPI_DATAWIDTH_11BIT
- LL_SPI_DATAWIDTH_12BIT
- LL_SPI_DATAWIDTH_13BIT
- LL_SPI_DATAWIDTH_14BIT
- LL_SPI_DATAWIDTH_15BIT
- LL_SPI_DATAWIDTH_16BIT
- Return values:
-
None
Definition at line 603 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE void LL_SPI_SetHalfDuplexDirection | ( | SPI_TypeDef * | SPIx, |
uint32_t | HalfDuplexDirection | ||
) |
Set direction for Half-Duplex Mode.
- Note:
- In master mode, the MOSI pin is used and in slave mode, the MISO pin is used for Half-Duplex. CR1 BIDIOE LL_SPI_SetHalfDuplexDirection
- Parameters:
-
SPIx SPI Instance HalfDuplexDirection This parameter can be one of the following values: - LL_SPI_DIRECTION_HALF_DUPLEX_TX
- LL_SPI_DIRECTION_HALF_DUPLEX_RX
- Return values:
-
None
Definition at line 564 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE void LL_SPI_SetMode | ( | SPI_TypeDef * | SPIx, |
uint32_t | Mode | ||
) |
Set SPI Mode to Master or Slave.
- Note:
- This bit should not be changed when communication is ongoing. CR1 MSTR LL_SPI_SetMode
CR1 SSI LL_SPI_SetMode
- Parameters:
-
SPIx SPI Instance Mode This parameter can be one of the following values: - LL_SPI_MODE_MASTER
- LL_SPI_MODE_SLAVE
- Return values:
-
None
Definition at line 348 of file stm32l4xx_ll_spi.h.
__STATIC_INLINE void LL_SPI_SetRxFIFOThreshold | ( | SPI_TypeDef * | SPIx, |
uint32_t | Threshold | ||
) |
Set threshold of RXFIFO that triggers an RXNE event CR2 FRXTH LL_SPI_SetRxFIFOThreshold.
- Parameters:
-
SPIx SPI Instance Threshold This parameter can be one of the following values: - LL_SPI_RX_FIFO_TH_HALF
- LL_SPI_RX_FIFO_TH_QUARTER
- Return values:
-
None
Definition at line 641 of file stm32l4xx_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. CR2 FRF LL_SPI_SetStandard
- Parameters:
-
SPIx SPI Instance Standard This parameter can be one of the following values: - LL_SPI_PROTOCOL_MOTOROLA
- LL_SPI_PROTOCOL_TI
- Return values:
-
None
Definition at line 377 of file stm32l4xx_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. CR1 LSBFIRST LL_SPI_SetTransferBitOrder
- Parameters:
-
SPIx SPI Instance BitOrder This parameter can be one of the following values: - LL_SPI_LSB_FIRST
- LL_SPI_MSB_FIRST
- Return values:
-
None
Definition at line 503 of file stm32l4xx_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. CR1 RXONLY LL_SPI_SetTransferDirection
CR1 BIDIMODE LL_SPI_SetTransferDirection
- Parameters:
-
SPIx SPI Instance TransferDirection This parameter can be one of the following values: - LL_SPI_FULL_DUPLEX
- LL_SPI_SIMPLEX_RX
- LL_SPI_HALF_DUPLEX
- Return values:
-
None
Definition at line 534 of file stm32l4xx_ll_spi.h.
Generated on Tue Jul 12 2022 11:35:26 by
