100 CRC->POL = 0x04C11DB7;
104 CRC->INIT = 0xFFFFFFFF;
141 tmpcr &= (uint32_t)~((uint32_t)CRC_CR_POLSIZE);
143 tmpcr |= (uint32_t)CRC_PolSize;
146 CRC->CR = (uint32_t)tmpcr;
170 tmpcr &= (uint32_t)~((uint32_t)CRC_CR_REV_IN);
172 tmpcr |= (uint32_t)CRC_ReverseInputData;
175 CRC->CR = (uint32_t)tmpcr;
193 CRC->CR |= CRC_CR_REV_OUT;
198 CRC->CR &= (uint32_t)~((uint32_t)CRC_CR_REV_OUT);
210 CRC->INIT = CRC_InitValue;
258 *(uint16_t*)(
CRC_BASE) = (uint16_t) CRC_Data;
270 *(uint8_t*)(
CRC_BASE) = (uint8_t) CRC_Data;
285 for(index = 0; index < BufferLength; index++)
287 CRC->DR = pBuffer[index];
325 CRC->IDR = CRC_IDValue;
uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
Computes the 32-bit CRC of a given buffer of data word(32-bit).
uint8_t CRC_GetIDRegister(void)
Returns the 8-bit data stored in the Independent Data(ID) register.
void CRC_PolynomialSizeSelect(uint32_t CRC_PolSize)
Selects the polynomial size.
void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData)
Selects the reverse operation to be performed on input data.
void CRC_SetIDRegister(uint8_t CRC_IDValue)
Stores an 8-bit data in the Independent Data(ID) register.
void assert_param(int val)
#define IS_FUNCTIONAL_STATE(STATE)
uint32_t CRC_CalcCRC8bits(uint8_t CRC_Data)
Computes the 8-bit CRC of a given 8-bit data.
uint32_t CRC_CalcCRC(uint32_t CRC_Data)
Computes the 32-bit CRC of a given data word(32-bit).
This file contains all the functions prototypes for the CRC firmware library.
void CRC_SetPolynomial(uint32_t CRC_Pol)
Initializes the polynomail coefficients.
#define IS_CRC_POL_SIZE(SIZE)
uint32_t CRC_CalcCRC16bits(uint16_t CRC_Data)
Computes the 16-bit CRC of a given 16-bit data.
void CRC_DeInit(void)
Deinitializes CRC peripheral registers to their default reset values.
void CRC_ReverseOutputDataCmd(FunctionalState NewState)
Enables or disable the reverse operation on output data. The reverse operation on output data is perf...
uint32_t CRC_GetCRC(void)
Returns the current CRC value.
void CRC_ResetDR(void)
Resets the CRC calculation unit and sets INIT register content in DR register.
void CRC_SetInitRegister(uint32_t CRC_InitValue)
Initializes the INIT register.