STM32L4xx_HAL_Driver  1.14.0
CRC Configuration functions

Functions

__STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit (CRC_TypeDef *CRCx)
 Reset the CRC calculation unit. More...
 
__STATIC_INLINE void LL_CRC_SetPolynomialSize (CRC_TypeDef *CRCx, uint32_t PolySize)
 Configure size of the polynomial. CR POLYSIZE LL_CRC_SetPolynomialSize. More...
 
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialSize (CRC_TypeDef *CRCx)
 Return size of the polynomial. CR POLYSIZE LL_CRC_GetPolynomialSize. More...
 
__STATIC_INLINE void LL_CRC_SetInputDataReverseMode (CRC_TypeDef *CRCx, uint32_t ReverseMode)
 Configure the reversal of the bit order of the input data CR REV_IN LL_CRC_SetInputDataReverseMode. More...
 
__STATIC_INLINE uint32_t LL_CRC_GetInputDataReverseMode (CRC_TypeDef *CRCx)
 Return type of reversal for input data bit order CR REV_IN LL_CRC_GetInputDataReverseMode. More...
 
__STATIC_INLINE void LL_CRC_SetOutputDataReverseMode (CRC_TypeDef *CRCx, uint32_t ReverseMode)
 Configure the reversal of the bit order of the Output data CR REV_OUT LL_CRC_SetOutputDataReverseMode. More...
 
__STATIC_INLINE uint32_t LL_CRC_GetOutputDataReverseMode (CRC_TypeDef *CRCx)
 Configure the reversal of the bit order of the Output data CR REV_OUT LL_CRC_GetOutputDataReverseMode. More...
 
__STATIC_INLINE void LL_CRC_SetInitialData (CRC_TypeDef *CRCx, uint32_t InitCrc)
 Initialize the Programmable initial CRC value. More...
 
__STATIC_INLINE uint32_t LL_CRC_GetInitialData (CRC_TypeDef *CRCx)
 Return current Initial CRC value. More...
 
__STATIC_INLINE void LL_CRC_SetPolynomialCoef (CRC_TypeDef *CRCx, uint32_t PolynomCoef)
 Initialize the Programmable polynomial value (coefficients of the polynomial to be used for CRC calculation). More...
 
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialCoef (CRC_TypeDef *CRCx)
 Return current Programmable polynomial value. More...
 

Detailed Description

Function Documentation

◆ LL_CRC_GetInitialData()

__STATIC_INLINE uint32_t LL_CRC_GetInitialData ( CRC_TypeDef *  CRCx)

Return current Initial CRC value.

Note
If the CRC size is less than 32 bits, the least significant bits are used to read the correct value INIT INIT LL_CRC_GetInitialData
Parameters
CRCxCRC Instance
Return values
Valueprogrammed in Programmable initial CRC value register

Definition at line 274 of file stm32l4xx_ll_crc.h.

275 {
276  return (uint32_t)(READ_REG(CRCx->INIT));
277 }

◆ LL_CRC_GetInputDataReverseMode()

__STATIC_INLINE uint32_t LL_CRC_GetInputDataReverseMode ( CRC_TypeDef *  CRCx)

Return type of reversal for input data bit order CR REV_IN LL_CRC_GetInputDataReverseMode.

Parameters
CRCxCRC Instance
Return values
Returnedvalue can be one of the following values:
  • LL_CRC_INDATA_REVERSE_NONE
  • LL_CRC_INDATA_REVERSE_BYTE
  • LL_CRC_INDATA_REVERSE_HALFWORD
  • LL_CRC_INDATA_REVERSE_WORD

Definition at line 219 of file stm32l4xx_ll_crc.h.

220 {
221  return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_IN));
222 }

◆ LL_CRC_GetOutputDataReverseMode()

__STATIC_INLINE uint32_t LL_CRC_GetOutputDataReverseMode ( CRC_TypeDef *  CRCx)

Configure the reversal of the bit order of the Output data CR REV_OUT LL_CRC_GetOutputDataReverseMode.

Parameters
CRCxCRC Instance
Return values
Returnedvalue can be one of the following values:
  • LL_CRC_OUTDATA_REVERSE_NONE
  • LL_CRC_OUTDATA_REVERSE_BIT

Definition at line 246 of file stm32l4xx_ll_crc.h.

247 {
248  return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_OUT));
249 }

◆ LL_CRC_GetPolynomialCoef()

__STATIC_INLINE uint32_t LL_CRC_GetPolynomialCoef ( CRC_TypeDef *  CRCx)

Return current Programmable polynomial value.

Note
Please check Reference Manual and existing Errata Sheets, regarding possible limitations for Polynomial values usage. For example, for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 is written 0x65 POL POL LL_CRC_GetPolynomialCoef
Parameters
CRCxCRC Instance
Return values
Valueprogrammed in Programmable Polynomial value register

Definition at line 305 of file stm32l4xx_ll_crc.h.

306 {
307  return (uint32_t)(READ_REG(CRCx->POL));
308 }

◆ LL_CRC_GetPolynomialSize()

__STATIC_INLINE uint32_t LL_CRC_GetPolynomialSize ( CRC_TypeDef *  CRCx)

Return size of the polynomial. CR POLYSIZE LL_CRC_GetPolynomialSize.

Parameters
CRCxCRC Instance
Return values
Returnedvalue can be one of the following values:
  • LL_CRC_POLYLENGTH_32B
  • LL_CRC_POLYLENGTH_16B
  • LL_CRC_POLYLENGTH_8B
  • LL_CRC_POLYLENGTH_7B

Definition at line 188 of file stm32l4xx_ll_crc.h.

189 {
190  return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_POLYSIZE));
191 }

◆ LL_CRC_ResetCRCCalculationUnit()

__STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit ( CRC_TypeDef *  CRCx)

Reset the CRC calculation unit.

Note
If Programmable Initial CRC value feature is available, also set the Data Register to the value stored in the CRC_INIT register, otherwise, reset Data Register to its default value. CR RESET LL_CRC_ResetCRCCalculationUnit
Parameters
CRCxCRC Instance
Return values
None

Definition at line 157 of file stm32l4xx_ll_crc.h.

158 {
159  SET_BIT(CRCx->CR, CRC_CR_RESET);
160 }

◆ LL_CRC_SetInitialData()

__STATIC_INLINE void LL_CRC_SetInitialData ( CRC_TypeDef *  CRCx,
uint32_t  InitCrc 
)

Initialize the Programmable initial CRC value.

Note
If the CRC size is less than 32 bits, the least significant bits are used to write the correct value
LL_CRC_DEFAULT_CRC_INITVALUE could be used as value for InitCrc parameter. INIT INIT LL_CRC_SetInitialData
Parameters
CRCxCRC Instance
InitCrcValue to be programmed in Programmable initial CRC value register
Return values
None

Definition at line 261 of file stm32l4xx_ll_crc.h.

262 {
263  WRITE_REG(CRCx->INIT, InitCrc);
264 }

◆ LL_CRC_SetInputDataReverseMode()

__STATIC_INLINE void LL_CRC_SetInputDataReverseMode ( CRC_TypeDef *  CRCx,
uint32_t  ReverseMode 
)

Configure the reversal of the bit order of the input data CR REV_IN LL_CRC_SetInputDataReverseMode.

Parameters
CRCxCRC Instance
ReverseModeThis parameter can be one of the following values:
  • LL_CRC_INDATA_REVERSE_NONE
  • LL_CRC_INDATA_REVERSE_BYTE
  • LL_CRC_INDATA_REVERSE_HALFWORD
  • LL_CRC_INDATA_REVERSE_WORD
Return values
None

Definition at line 204 of file stm32l4xx_ll_crc.h.

205 {
206  MODIFY_REG(CRCx->CR, CRC_CR_REV_IN, ReverseMode);
207 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_CRC_SetOutputDataReverseMode()

__STATIC_INLINE void LL_CRC_SetOutputDataReverseMode ( CRC_TypeDef *  CRCx,
uint32_t  ReverseMode 
)

Configure the reversal of the bit order of the Output data CR REV_OUT LL_CRC_SetOutputDataReverseMode.

Parameters
CRCxCRC Instance
ReverseModeThis parameter can be one of the following values:
  • LL_CRC_OUTDATA_REVERSE_NONE
  • LL_CRC_OUTDATA_REVERSE_BIT
Return values
None

Definition at line 233 of file stm32l4xx_ll_crc.h.

234 {
235  MODIFY_REG(CRCx->CR, CRC_CR_REV_OUT, ReverseMode);
236 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)

◆ LL_CRC_SetPolynomialCoef()

__STATIC_INLINE void LL_CRC_SetPolynomialCoef ( CRC_TypeDef *  CRCx,
uint32_t  PolynomCoef 
)

Initialize the Programmable polynomial value (coefficients of the polynomial to be used for CRC calculation).

Note
LL_CRC_DEFAULT_CRC32_POLY could be used as value for PolynomCoef parameter.
Please check Reference Manual and existing Errata Sheets, regarding possible limitations for Polynomial values usage. For example, for a polynomial of degree 7, X^7 + X^6 + X^5 + X^2 + 1 is written 0x65 POL POL LL_CRC_SetPolynomialCoef
Parameters
CRCxCRC Instance
PolynomCoefValue to be programmed in Programmable Polynomial value register
Return values
None

Definition at line 291 of file stm32l4xx_ll_crc.h.

292 {
293  WRITE_REG(CRCx->POL, PolynomCoef);
294 }

◆ LL_CRC_SetPolynomialSize()

__STATIC_INLINE void LL_CRC_SetPolynomialSize ( CRC_TypeDef *  CRCx,
uint32_t  PolySize 
)

Configure size of the polynomial. CR POLYSIZE LL_CRC_SetPolynomialSize.

Parameters
CRCxCRC Instance
PolySizeThis parameter can be one of the following values:
  • LL_CRC_POLYLENGTH_32B
  • LL_CRC_POLYLENGTH_16B
  • LL_CRC_POLYLENGTH_8B
  • LL_CRC_POLYLENGTH_7B
Return values
None

Definition at line 173 of file stm32l4xx_ll_crc.h.

174 {
175  MODIFY_REG(CRCx->CR, CRC_CR_POLYSIZE, PolySize);
176 }
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)