TUKS MCU Introductory course / TUKS-COURSE-THERMOMETER

Fork of TUKS-COURSE-TIMER by TUKS MCU Introductory course

Embed: (wiki syntax)

« Back to documentation index

CRC Management

Functions

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

Function Documentation

__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 730 of file stm32l4xx_ll_spi.h.

__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 718 of file stm32l4xx_ll_spi.h.

__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 805 of file stm32l4xx_ll_spi.h.

__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 770 of file stm32l4xx_ll_spi.h.

__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 816 of file stm32l4xx_ll_spi.h.

__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 827 of file stm32l4xx_ll_spi.h.

__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 742 of file stm32l4xx_ll_spi.h.

__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 782 of file stm32l4xx_ll_spi.h.

__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 794 of file stm32l4xx_ll_spi.h.

__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 757 of file stm32l4xx_ll_spi.h.