LL CRC Functions

CRC Configuration functions

group CRC_LL_EF_Configuration

Functions

void LL_CRC_ResetCRCCalculationUnit ( CRC_TypeDef * crcx )

Reset the CRC calculation unit.

Reference Manual to LL API cross reference (Register Field Functions)

CR RESET LL_CRC_ResetCRCCalculationUnit

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.

Parameters :

crcx – CRC Instance

void LL_CRC_SetPolynomialSize ( CRC_TypeDef * crcx , uint32_t poly_size )

Configure size of the polynomial.

Reference Manual to LL API cross reference (Register Field Functions)

CR POLYSIZE LL_CRC_SetPolynomialSize

Parameters :
uint32_t LL_CRC_GetPolynomialSize ( const CRC_TypeDef * crcx )

Return size of the polynomial.

Reference Manual to LL API cross reference (Register Field Functions)

CR POLYSIZE LL_CRC_GetPolynomialSize

Parameters :

crcx – CRC Instance

Return values :

Returned – value can be one of the following values:

void LL_CRC_SetDataReverseMode ( CRC_TypeDef * crcx , uint32_t input_reverse_mode , uint32_t output_reverse_mode )

Configure the reversal of the bit order of the input and Output data.

Reference Manual to LL API cross reference (Register Field Functions)

CR REV_X LL_CRC_SetDataReverseMode

Note

REV_X bit value of REV_IN and REV_OUT

Parameters :
void LL_CRC_SetInputDataReverseMode ( CRC_TypeDef * crcx , uint32_t input_reverse_mode )

Configure the reversal of the bit order of the input data.

Reference Manual to LL API cross reference (Register Field Functions)

CR REV_IN LL_CRC_SetInputDataReverseMode

Parameters :
uint32_t LL_CRC_GetInputDataReverseMode ( const CRC_TypeDef * crcx )

Return type of reversal for input data bit order.

Reference Manual to LL API cross reference (Register Field Functions)

CR REV_IN LL_CRC_GetInputDataReverseMode

Parameters :

crcx – CRC Instance

Return values :

Returned – value can be one of the following values:

void LL_CRC_SetOutputDataReverseMode ( CRC_TypeDef * crcx , uint32_t output_reverse_mode )

Configure the reversal of the bit order of the Output data.

Reference Manual to LL API cross reference (Register Field Functions)

CR REV_OUT LL_CRC_SetOutputDataReverseMode

Parameters :
uint32_t LL_CRC_GetOutputDataReverseMode ( const CRC_TypeDef * crcx )

Return type of reversal of the bit order of the Output data.

Reference Manual to LL API cross reference (Register Field Functions)

CR REV_OUT LL_CRC_GetOutputDataReverseMode

Parameters :

crcx – CRC Instance

Return values :

Returned – value can be one of the following values:

void LL_CRC_SetInitialData ( CRC_TypeDef * crcx , uint32_t crc_init_value )

Initialize the Programmable initial CRC value.

Reference Manual to LL API cross reference (Register Field Functions)

INIT INIT LL_CRC_SetInitialData

Note

If the CRC size is less than 32 bits, the least significant bits are used to write the correct value

Note

LL_CRC_DEFAULT_CRC_INITVALUE could be used as value for InitCrc parameter.

Parameters :
  • crcx – CRC Instance

  • crc_init_value – Value to be programmed in Programmable initial CRC value register

uint32_t LL_CRC_GetInitialData ( const CRC_TypeDef * crcx )

Return current Initial CRC value.

Reference Manual to LL API cross reference (Register Field Functions)

INIT INIT LL_CRC_GetInitialData

Note

If the CRC size is less than 32 bits, the least significant bits are used to read the correct value

Parameters :

crcx – CRC Instance

Return values :

Value – programmed in Programmable initial CRC value register

void LL_CRC_SetPolynomialCoef ( CRC_TypeDef * crcx , uint32_t polynomial_coefficient )

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

Reference Manual to LL API cross reference (Register Field Functions)

POL POL LL_CRC_SetPolynomialCoef

Note

LL_CRC_DEFAULT_CRC32_POLY could be used as value for PolynomCoef parameter.

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

Parameters :
  • crcx – CRC Instance

  • polynomial_coefficient – Value to be programmed in Programmable Polynomial value register

uint32_t LL_CRC_GetPolynomialCoef ( const CRC_TypeDef * crcx )

Return current Programmable polynomial value.

Reference Manual to LL API cross reference (Register Field Functions)

POL POL LL_CRC_GetPolynomialCoef

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

Parameters :

crcx – CRC Instance

Return values :

Value – programmed in Programmable Polynomial value register

Data_Management

group CRC_LL_EF_Data_Management

Functions

void LL_CRC_FeedData32 ( CRC_TypeDef * crcx , uint32_t in_data )

Write given 32-bit data to the CRC calculator.

Reference Manual to LL API cross reference (Register Field Functions)

DR DR LL_CRC_FeedData32

Parameters :
  • crcx – CRC Instance

  • in_data – value to be provided to CRC calculator between Min_Data=0 and Max_Data=0xFFFFFFFF

void LL_CRC_FeedData16 ( CRC_TypeDef * crcx , uint16_t in_data )

Write given 16-bit data to the CRC calculator.

Reference Manual to LL API cross reference (Register Field Functions)

DR DR LL_CRC_FeedData16

Parameters :
  • crcx – CRC Instance

  • in_data – 16 bit value to be provided to CRC calculator between Min_Data=0 and Max_Data=0xFFFF

void LL_CRC_FeedData8 ( CRC_TypeDef * crcx , uint8_t in_data )

Write given 8-bit data to the CRC calculator.

Reference Manual to LL API cross reference (Register Field Functions)

DR DR LL_CRC_FeedData8

Parameters :
  • crcx – CRC Instance

  • in_data – 8 bit value to be provided to CRC calculator between Min_Data=0 and Max_Data=0xFF

uint32_t LL_CRC_ReadData32 ( const CRC_TypeDef * crcx )

Return current CRC calculation result. 32 bits value is returned.

Reference Manual to LL API cross reference (Register Field Functions)

DR DR LL_CRC_ReadData32

Parameters :

crcx – CRC Instance

Return values :

Current – CRC calculation result as stored in CRC_DR register (32 bits).

uint16_t LL_CRC_ReadData16 ( const CRC_TypeDef * crcx )

Return current CRC calculation result. 16 bits value is returned.

Reference Manual to LL API cross reference (Register Field Functions)

DR DR LL_CRC_ReadData16

Note

This function is expected to be used in a 16 bits CRC polynomial size context.

Parameters :

crcx – CRC Instance

Return values :

Current – CRC calculation result as stored in CRC_DR register (16 bits).

uint8_t LL_CRC_ReadData8 ( const CRC_TypeDef * crcx )

Return current CRC calculation result. 8 bits value is returned.

Reference Manual to LL API cross reference (Register Field Functions)

DR DR LL_CRC_ReadData8

Note

This function is expected to be used in a 8 bits CRC polynomial size context.

Parameters :

crcx – CRC Instance

Return values :

Current – CRC calculation result as stored in CRC_DR register (8 bits).

uint8_t LL_CRC_ReadData7 ( const CRC_TypeDef * crcx )

Return current CRC calculation result. 7 bits value is returned.

Reference Manual to LL API cross reference (Register Field Functions)

DR DR LL_CRC_ReadData7

Note

This function is expected to be used in a 7 bits CRC polynomial size context.

Parameters :

crcx – CRC Instance

Return values :

Current – CRC calculation result as stored in CRC_DR register (7 bits).

uint32_t LL_CRC_ReadIDR ( const CRC_TypeDef * crcx )

Return data stored in the Independent Data(IDR) register.

Reference Manual to LL API cross reference (Register Field Functions)

IDR IDR LL_CRC_ReadIDR

Note

This register can be used as a temporary storage location for one 32-bit long data.

Parameters :

crcx – CRC Instance

Return values :

Value – stored in CRC_IDR register (General-purpose 32-bit data register).

void LL_CRC_WriteIDR ( CRC_TypeDef * crcx , uint32_t in_data )

Store data in the Independent Data(IDR) register.

Reference Manual to LL API cross reference (Register Field Functions)

IDR IDR LL_CRC_WriteIDR

Note

This register can be used as a temporary storage location for one 32-bit long data.

Parameters :
  • crcx – CRC Instance

  • in_data – value to be stored in CRC_IDR register (32-bit) between Min_Data=0 and Max_Data=0xFFFFFFFF