30 #ifndef __STM32F30x_CRC_H 31 #define __STM32F30x_CRC_H 38 #include "stm32f30x.h" 54 #define CRC_ReverseInputData_No ((uint32_t)0x00000000) 55 #define CRC_ReverseInputData_8bits CRC_CR_REV_IN_0 56 #define CRC_ReverseInputData_16bits CRC_CR_REV_IN_1 57 #define CRC_ReverseInputData_32bits CRC_CR_REV_IN 59 #define IS_CRC_REVERSE_INPUT_DATA(DATA) (((DATA) == CRC_ReverseInputData_No) || \ 60 ((DATA) == CRC_ReverseInputData_8bits) || \ 61 ((DATA) == CRC_ReverseInputData_16bits) || \ 62 ((DATA) == CRC_ReverseInputData_32bits)) 71 #define CRC_PolSize_7 CRC_CR_POLSIZE 72 #define CRC_PolSize_8 CRC_CR_POLSIZE_1 73 #define CRC_PolSize_16 CRC_CR_POLSIZE_0 74 #define CRC_PolSize_32 ((uint32_t)0x00000000) 76 #define IS_CRC_POL_SIZE(SIZE) (((SIZE) == CRC_PolSize_7) || \ 77 ((SIZE) == CRC_PolSize_8) || \ 78 ((SIZE) == CRC_PolSize_16) || \ 79 ((SIZE) == CRC_PolSize_32)) void CRC_SetIDRegister(uint8_t IDValue)
Stores a 8-bit data in the Independent Data(ID) register.
void CRC_SetInitRegister(uint32_t CRC_InitValue)
Initializes the INIT register.
uint32_t CRC_CalcCRC(uint32_t Data)
Computes the 32-bit CRC of a given data word(32-bit).
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_CalcCRC8bits(uint8_t CRC_Data)
Computes the 8-bit CRC of a given 8-bit data.
uint32_t CRC_CalcCRC16bits(uint16_t CRC_Data)
Computes the 16-bit CRC of a given 16-bit data.
uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
Computes the 32-bit CRC of a given buffer of data word(32-bit).
void CRC_PolynomialSizeSelect(uint32_t CRC_PolSize)
Selects the polynomial size.
uint8_t CRC_GetIDRegister(void)
Returns the 8-bit data stored in the Independent Data(ID) register.
void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData)
Selects the reverse operation to be performed on input data.
void CRC_SetPolynomial(uint32_t CRC_Pol)
Initializes the polynomail coefficients.
uint32_t CRC_GetCRC(void)
Returns the current CRC value.
void CRC_ResetDR(void)
Resets the CRC Data register (DR).