STM32F37 Standard Peripheral bibliotheek  1.0
ST Microelectronics bibliotheek documentatie voor de STM32F37 Standard Peripheral Library
 All Data Structures Files Functions Variables Enumerations Enumerator Groups

CRC driver modules. More...

Modules

 CRC_ReverseInputData
 
 CRC_PolynomialSize
 
 CRC_Private_Functions
 

Functions

void CRC_DeInit (void)
 Deinitializes CRC peripheral registers to their default reset values. More...
 
void CRC_ResetDR (void)
 Resets the CRC calculation unit and sets INIT register content in DR register. More...
 
void CRC_PolynomialSizeSelect (uint32_t CRC_PolSize)
 Selects the polynomial size. More...
 
void CRC_ReverseInputDataSelect (uint32_t CRC_ReverseInputData)
 Selects the reverse operation to be performed on input data. More...
 
void CRC_ReverseOutputDataCmd (FunctionalState NewState)
 Enables or disable the reverse operation on output data. The reverse operation on output data is performed on 32-bit. More...
 
void CRC_SetInitRegister (uint32_t CRC_InitValue)
 Initializes the INIT register. More...
 
void CRC_SetPolynomial (uint32_t CRC_Pol)
 Initializes the polynomail coefficients. More...
 
uint32_t CRC_CalcCRC (uint32_t CRC_Data)
 Computes the 32-bit CRC of a given data word(32-bit). More...
 
uint32_t CRC_CalcCRC16bits (uint16_t CRC_Data)
 Computes the 16-bit CRC of a given 16-bit data. More...
 
uint32_t CRC_CalcCRC8bits (uint8_t CRC_Data)
 Computes the 8-bit CRC of a given 8-bit data. More...
 
uint32_t CRC_CalcBlockCRC (uint32_t pBuffer[], uint32_t BufferLength)
 Computes the 32-bit CRC of a given buffer of data word(32-bit). More...
 
uint32_t CRC_GetCRC (void)
 Returns the current CRC value. More...
 
void CRC_SetIDRegister (uint8_t CRC_IDValue)
 Stores an 8-bit data in the Independent Data(ID) register. More...
 
uint8_t CRC_GetIDRegister (void)
 Returns the 8-bit data stored in the Independent Data(ID) register. More...
 

Detailed Description

CRC driver modules.

Function Documentation

uint32_t CRC_CalcBlockCRC ( uint32_t  pBuffer[],
uint32_t  BufferLength 
)

Computes the 32-bit CRC of a given buffer of data word(32-bit).

Parameters
pBuffer,:pointer to the buffer containing the data to be computed
BufferLength,:length of the buffer to be computed
Return values
32-bitCRC
uint32_t CRC_CalcCRC ( uint32_t  CRC_Data)

Computes the 32-bit CRC of a given data word(32-bit).

Parameters
CRC_Data,:data word(32-bit) to compute its CRC
Return values
32-bitCRC
uint32_t CRC_CalcCRC16bits ( uint16_t  CRC_Data)

Computes the 16-bit CRC of a given 16-bit data.

Parameters
CRC_Data,:data half-word(16-bit) to compute its CRC
Return values
16-bitCRC
uint32_t CRC_CalcCRC8bits ( uint8_t  CRC_Data)

Computes the 8-bit CRC of a given 8-bit data.

Parameters
CRC_Data,:8-bit data to compute its CRC
Return values
8-bitCRC
void CRC_DeInit ( void  )

Deinitializes CRC peripheral registers to their default reset values.

Parameters
None
Return values
None
uint32_t CRC_GetCRC ( void  )

Returns the current CRC value.

Parameters
None
Return values
32-bitCRC
uint8_t CRC_GetIDRegister ( void  )

Returns the 8-bit data stored in the Independent Data(ID) register.

Parameters
None
Return values
8-bitvalue of the ID register
void CRC_PolynomialSizeSelect ( uint32_t  CRC_PolSize)

Selects the polynomial size.

Parameters
CRC_PolSize,:Specifies the polynomial size. This parameter can be:
  • CRC_PolSize_7: 7-bit polynomial for CRC calculation
  • CRC_PolSize_8: 8-bit polynomial for CRC calculation
  • CRC_PolSize_16: 16-bit polynomial for CRC calculation
  • CRC_PolSize_32: 32-bit polynomial for CRC calculation
Return values
None
void CRC_ResetDR ( void  )

Resets the CRC calculation unit and sets INIT register content in DR register.

Parameters
None
Return values
None
void CRC_ReverseInputDataSelect ( uint32_t  CRC_ReverseInputData)

Selects the reverse operation to be performed on input data.

Parameters
CRC_ReverseInputData,:Specifies the reverse operation on input data. This parameter can be:
  • CRC_ReverseInputData_No: No reverse operation is performed
  • CRC_ReverseInputData_8bits: reverse operation performed on 8 bits
  • CRC_ReverseInputData_16bits: reverse operation performed on 16 bits
  • CRC_ReverseInputData_32bits: reverse operation performed on 32 bits
Return values
None
void CRC_ReverseOutputDataCmd ( FunctionalState  NewState)

Enables or disable the reverse operation on output data. The reverse operation on output data is performed on 32-bit.

Parameters
NewState,:new state of the reverse operation on output data. This parameter can be: ENABLE or DISABLE.
Return values
None
void CRC_SetIDRegister ( uint8_t  CRC_IDValue)

Stores an 8-bit data in the Independent Data(ID) register.

Parameters
CRC_IDValue,:8-bit value to be stored in the ID register
Return values
None
void CRC_SetInitRegister ( uint32_t  CRC_InitValue)

Initializes the INIT register.

Note
After resetting CRC calculation unit, CRC_InitValue is stored in DR register
Parameters
CRC_InitValue,:Programmable initial CRC value
Return values
None
void CRC_SetPolynomial ( uint32_t  CRC_Pol)

Initializes the polynomail coefficients.

Parameters
CRC_Pol,:Polynomial to be used for CRC calculation.
Return values
None