STM32L4xx_HAL_Driver  1.14.0

Functions

__STATIC_INLINE void LL_SPI_EnableCRC (SPI_TypeDef *SPIx)
 Enable CRC. More...
 
__STATIC_INLINE void LL_SPI_DisableCRC (SPI_TypeDef *SPIx)
 Disable CRC. More...
 
__STATIC_INLINE uint32_t LL_SPI_IsEnabledCRC (SPI_TypeDef *SPIx)
 Check if CRC is enabled. More...
 
__STATIC_INLINE void LL_SPI_SetCRCWidth (SPI_TypeDef *SPIx, uint32_t CRCLength)
 Set CRC Length. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetCRCWidth (SPI_TypeDef *SPIx)
 Get CRC Length CR1 CRCL LL_SPI_GetCRCWidth. More...
 
__STATIC_INLINE void LL_SPI_SetCRCNext (SPI_TypeDef *SPIx)
 Set CRCNext to transfer CRC on the line. More...
 
__STATIC_INLINE void LL_SPI_SetCRCPolynomial (SPI_TypeDef *SPIx, uint32_t CRCPoly)
 Set polynomial for CRC calculation CRCPR CRCPOLY LL_SPI_SetCRCPolynomial. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetCRCPolynomial (SPI_TypeDef *SPIx)
 Get polynomial for CRC calculation CRCPR CRCPOLY LL_SPI_GetCRCPolynomial. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetRxCRC (SPI_TypeDef *SPIx)
 Get Rx CRC RXCRCR RXCRC LL_SPI_GetRxCRC. More...
 
__STATIC_INLINE uint32_t LL_SPI_GetTxCRC (SPI_TypeDef *SPIx)
 Get Tx CRC TXCRCR TXCRC LL_SPI_GetTxCRC. More...
 

Detailed Description

Function Documentation

◆ LL_SPI_DisableCRC()

__STATIC_INLINE void LL_SPI_DisableCRC ( SPI_TypeDef *  SPIx)

Disable CRC.

Note
This bit should be written only when SPI is disabled (SPE = 0) for correct operation. CR1 CRCEN LL_SPI_DisableCRC
Parameters
SPIxSPI Instance
Return values
None

Definition at line 711 of file stm32l4xx_ll_spi.h.

712 {
713  CLEAR_BIT(SPIx->CR1, SPI_CR1_CRCEN);
714 }
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)

◆ LL_SPI_EnableCRC()

__STATIC_INLINE void LL_SPI_EnableCRC ( SPI_TypeDef *  SPIx)

Enable CRC.

Note
This bit should be written only when SPI is disabled (SPE = 0) for correct operation. CR1 CRCEN LL_SPI_EnableCRC
Parameters
SPIxSPI Instance
Return values
None

Definition at line 699 of file stm32l4xx_ll_spi.h.

700 {
701  SET_BIT(SPIx->CR1, SPI_CR1_CRCEN);
702 }

◆ LL_SPI_GetCRCPolynomial()

__STATIC_INLINE uint32_t LL_SPI_GetCRCPolynomial ( SPI_TypeDef *  SPIx)

Get polynomial for CRC calculation CRCPR CRCPOLY LL_SPI_GetCRCPolynomial.

Parameters
SPIxSPI Instance
Return values
Returnedvalue is a number between Min_Data = 0x00 and Max_Data = 0xFFFF

Definition at line 786 of file stm32l4xx_ll_spi.h.

787 {
788  return (uint32_t)(READ_REG(SPIx->CRCPR));
789 }

◆ LL_SPI_GetCRCWidth()

__STATIC_INLINE uint32_t LL_SPI_GetCRCWidth ( SPI_TypeDef *  SPIx)

Get CRC Length CR1 CRCL LL_SPI_GetCRCWidth.

Parameters
SPIxSPI Instance
Return values
Returnedvalue can be one of the following values:
  • LL_SPI_CRC_8BIT
  • LL_SPI_CRC_16BIT

Definition at line 751 of file stm32l4xx_ll_spi.h.

752 {
753  return (uint32_t)(READ_BIT(SPIx->CR1, SPI_CR1_CRCL));
754 }

◆ LL_SPI_GetRxCRC()

__STATIC_INLINE uint32_t LL_SPI_GetRxCRC ( SPI_TypeDef *  SPIx)

Get Rx CRC RXCRCR RXCRC LL_SPI_GetRxCRC.

Parameters
SPIxSPI Instance
Return values
Returnedvalue is a number between Min_Data = 0x00 and Max_Data = 0xFFFF

Definition at line 797 of file stm32l4xx_ll_spi.h.

798 {
799  return (uint32_t)(READ_REG(SPIx->RXCRCR));
800 }

◆ LL_SPI_GetTxCRC()

__STATIC_INLINE uint32_t LL_SPI_GetTxCRC ( SPI_TypeDef *  SPIx)

Get Tx CRC TXCRCR TXCRC LL_SPI_GetTxCRC.

Parameters
SPIxSPI Instance
Return values
Returnedvalue is a number between Min_Data = 0x00 and Max_Data = 0xFFFF

Definition at line 808 of file stm32l4xx_ll_spi.h.

809 {
810  return (uint32_t)(READ_REG(SPIx->TXCRCR));
811 }

◆ LL_SPI_IsEnabledCRC()

__STATIC_INLINE uint32_t LL_SPI_IsEnabledCRC ( SPI_TypeDef *  SPIx)

Check if CRC is enabled.

Note
This bit should be written only when SPI is disabled (SPE = 0) for correct operation. CR1 CRCEN LL_SPI_IsEnabledCRC
Parameters
SPIxSPI Instance
Return values
Stateof bit (1 or 0).

Definition at line 723 of file stm32l4xx_ll_spi.h.

724 {
725  return ((READ_BIT(SPIx->CR1, SPI_CR1_CRCEN) == (SPI_CR1_CRCEN)) ? 1UL : 0UL);
726 }

◆ LL_SPI_SetCRCNext()

__STATIC_INLINE void LL_SPI_SetCRCNext ( SPI_TypeDef *  SPIx)

Set CRCNext to transfer CRC on the line.

Note
This bit has to be written as soon as the last data is written in the SPIx_DR register. CR1 CRCNEXT LL_SPI_SetCRCNext
Parameters
SPIxSPI Instance
Return values
None

Definition at line 763 of file stm32l4xx_ll_spi.h.

764 {
765  SET_BIT(SPIx->CR1, SPI_CR1_CRCNEXT);
766 }

◆ LL_SPI_SetCRCPolynomial()

__STATIC_INLINE void LL_SPI_SetCRCPolynomial ( SPI_TypeDef *  SPIx,
uint32_t  CRCPoly 
)

Set polynomial for CRC calculation CRCPR CRCPOLY LL_SPI_SetCRCPolynomial.

Parameters
SPIxSPI Instance
CRCPolyThis parameter must be a number between Min_Data = 0x00 and Max_Data = 0xFFFF
Return values
None

Definition at line 775 of file stm32l4xx_ll_spi.h.

776 {
777  WRITE_REG(SPIx->CRCPR, (uint16_t)CRCPoly);
778 }

◆ LL_SPI_SetCRCWidth()

__STATIC_INLINE void LL_SPI_SetCRCWidth ( SPI_TypeDef *  SPIx,
uint32_t  CRCLength 
)

Set CRC Length.

Note
This bit should be written only when SPI is disabled (SPE = 0) for correct operation. CR1 CRCL LL_SPI_SetCRCWidth
Parameters
SPIxSPI Instance
CRCLengthThis parameter can be one of the following values:
  • LL_SPI_CRC_8BIT
  • LL_SPI_CRC_16BIT
Return values
None

Definition at line 738 of file stm32l4xx_ll_spi.h.

739 {
740  MODIFY_REG(SPIx->CR1, SPI_CR1_CRCL, CRCLength);
741 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)