21 #ifndef STM32L4xx_LL_CRC_H 22 #define STM32L4xx_LL_CRC_H 29 #include "stm32l4xx.h" 55 #define LL_CRC_POLYLENGTH_32B 0x00000000U 56 #define LL_CRC_POLYLENGTH_16B CRC_CR_POLYSIZE_0 57 #define LL_CRC_POLYLENGTH_8B CRC_CR_POLYSIZE_1 58 #define LL_CRC_POLYLENGTH_7B (CRC_CR_POLYSIZE_1 | CRC_CR_POLYSIZE_0) 66 #define LL_CRC_INDATA_REVERSE_NONE 0x00000000U 67 #define LL_CRC_INDATA_REVERSE_BYTE CRC_CR_REV_IN_0 68 #define LL_CRC_INDATA_REVERSE_HALFWORD CRC_CR_REV_IN_1 69 #define LL_CRC_INDATA_REVERSE_WORD (CRC_CR_REV_IN_1 | CRC_CR_REV_IN_0) 77 #define LL_CRC_OUTDATA_REVERSE_NONE 0x00000000U 78 #define LL_CRC_OUTDATA_REVERSE_BIT CRC_CR_REV_OUT 88 #define LL_CRC_DEFAULT_CRC32_POLY 0x04C11DB7U 96 #define LL_CRC_DEFAULT_CRC_INITVALUE 0xFFFFFFFFU 121 #define LL_CRC_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, __VALUE__) 129 #define LL_CRC_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__) 159 SET_BIT(CRCx->CR, CRC_CR_RESET);
175 MODIFY_REG(CRCx->CR, CRC_CR_POLYSIZE, PolySize);
190 return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_POLYSIZE));
206 MODIFY_REG(CRCx->CR, CRC_CR_REV_IN, ReverseMode);
221 return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_IN));
235 MODIFY_REG(CRCx->CR, CRC_CR_REV_OUT, ReverseMode);
248 return (uint32_t)(READ_BIT(CRCx->CR, CRC_CR_REV_OUT));
263 WRITE_REG(CRCx->INIT, InitCrc);
276 return (uint32_t)(READ_REG(CRCx->INIT));
293 WRITE_REG(CRCx->POL, PolynomCoef);
307 return (uint32_t)(READ_REG(CRCx->POL));
327 WRITE_REG(CRCx->DR, InData);
341 pReg = (__IO uint16_t *)(__IO
void *)(&CRCx->DR);
354 *(uint8_t __IO *)(&CRCx->DR) = (uint8_t) InData;
365 return (uint32_t)(READ_REG(CRCx->DR));
377 return (uint16_t)READ_REG(CRCx->DR);
389 return (uint8_t)READ_REG(CRCx->DR);
401 return (uint8_t)(READ_REG(CRCx->DR) & 0x7FU);
414 return (uint32_t)(READ_REG(CRCx->IDR));
428 #if (CRC_IDR_IDR == 0x0FFU) 429 *((uint8_t __IO *)(&CRCx->IDR)) = (uint8_t) InData;
431 WRITE_REG(CRCx->IDR, InData);
438 #if defined(USE_FULL_LL_DRIVER) __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_GetOutputDataReverseMod...
ErrorStatus LL_CRC_DeInit(CRC_TypeDef *CRCx)
De-initialize CRC registers (Registers restored to their default values).
__STATIC_INLINE uint32_t LL_CRC_ReadData32(CRC_TypeDef *CRCx)
Return current CRC calculation result. 32 bits value is returned. DR DR LL_CRC_ReadData32.
__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.
__STATIC_INLINE void LL_CRC_FeedData32(CRC_TypeDef *CRCx, uint32_t InData)
Write given 32-bit data to the CRC calculator DR DR LL_CRC_FeedData32.
__STATIC_INLINE uint8_t LL_CRC_ReadData8(CRC_TypeDef *CRCx)
Return current CRC calculation result. 8 bits value is returned.
__STATIC_INLINE uint16_t LL_CRC_ReadData16(CRC_TypeDef *CRCx)
Return current CRC calculation result. 16 bits value is returned.
__STATIC_INLINE void LL_CRC_ResetCRCCalculationUnit(CRC_TypeDef *CRCx)
Reset the CRC calculation unit.
__STATIC_INLINE uint8_t LL_CRC_ReadData7(CRC_TypeDef *CRCx)
Return current CRC calculation result. 7 bits value is returned.
__STATIC_INLINE uint32_t LL_CRC_GetInitialData(CRC_TypeDef *CRCx)
Return current Initial CRC value.
__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.
__STATIC_INLINE void LL_CRC_FeedData16(CRC_TypeDef *CRCx, uint16_t InData)
Write given 16-bit data to the CRC calculator DR DR LL_CRC_FeedData16.
__STATIC_INLINE void LL_CRC_SetInitialData(CRC_TypeDef *CRCx, uint32_t InitCrc)
Initialize the Programmable initial CRC value.
__STATIC_INLINE uint32_t LL_CRC_Read_IDR(CRC_TypeDef *CRCx)
Return data stored in the Independent Data(IDR) register.
__STATIC_INLINE void LL_CRC_SetPolynomialSize(CRC_TypeDef *CRCx, uint32_t PolySize)
Configure size of the polynomial. CR POLYSIZE LL_CRC_SetPolynomialSize.
__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_SetOutputDataReverseMod...
__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 calcu...
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialCoef(CRC_TypeDef *CRCx)
Return current Programmable polynomial value.
__STATIC_INLINE void LL_CRC_FeedData8(CRC_TypeDef *CRCx, uint8_t InData)
Write given 8-bit data to the CRC calculator DR DR LL_CRC_FeedData8.
__STATIC_INLINE uint32_t LL_CRC_GetPolynomialSize(CRC_TypeDef *CRCx)
Return size of the polynomial. CR POLYSIZE LL_CRC_GetPolynomialSize.
__STATIC_INLINE void LL_CRC_Write_IDR(CRC_TypeDef *CRCx, uint32_t InData)
Store data in the Independent Data(IDR) register.