MSPM0C1105_C1106 Driver Library  2.05.01.00
Enumerations | Functions
Cyclic Redundancy Check (CRC)

Enumerations

enum  DL_CRC_POLYNOMIAL { DL_CRC_16_POLYNOMIAL = CRC_CRCCTRL_POLYSIZE_CRC16 }
 
enum  DL_CRC_BIT {
  DL_CRC_BIT_REVERSED = CRC_CRCCTRL_BITREVERSE_REVERSED,
  DL_CRC_BIT_NOT_REVERSED = CRC_CRCCTRL_BITREVERSE_NOT_REVERSED
}
 
enum  DL_CRC_INPUT_ENDIANESS {
  DL_CRC_INPUT_ENDIANESS_LITTLE_ENDIAN,
  DL_CRC_INPUT_ENDIANESS_BIG_ENDIAN = CRC_CRCCTRL_INPUT_ENDIANNESS_BIG_ENDIAN
}
 
enum  DL_CRC_OUTPUT_BYTESWAP {
  DL_CRC_OUTPUT_BYTESWAP_ENABLED = CRC_CRCCTRL_OUTPUT_BYTESWAP_ENABLE,
  DL_CRC_OUTPUT_BYTESWAP_DISABLED = CRC_CRCCTRL_OUTPUT_BYTESWAP_DISABLE
}
 

Functions

__STATIC_INLINE void DL_CRC_enablePower (CRC_Regs *crc)
 Enables the Peripheral Write Enable (PWREN) register for the CRC. More...
 
__STATIC_INLINE void DL_CRC_disablePower (CRC_Regs *crc)
 Disables the Peripheral Write Enable (PWREN) register for the CRC. More...
 
__STATIC_INLINE bool DL_CRC_isPowerEnabled (const CRC_Regs *crc)
 Returns if the Peripheral Write Enable (PWREN) register for the CRC is enabled. More...
 
__STATIC_INLINE void DL_CRC_reset (CRC_Regs *crc)
 Resets crc peripheral. More...
 
__STATIC_INLINE bool DL_CRC_isReset (const CRC_Regs *crc)
 Returns if crc module has been reset. More...
 
__STATIC_INLINE void DL_CRC_init (CRC_Regs *crc, DL_CRC_POLYNOMIAL poly, DL_CRC_BIT bitOrd, DL_CRC_INPUT_ENDIANESS inEndianness, DL_CRC_OUTPUT_BYTESWAP outByteSwap)
 Initializes CRC. More...
 
__STATIC_INLINE void DL_CRC_setSeed16 (CRC_Regs *crc, uint16_t seed)
 Initializes the seed for a 16-bit polynomial CRC calculation. More...
 
__STATIC_INLINE void DL_CRC_setSeed32 (CRC_Regs *crc, uint32_t seed)
 Initializes the seed for a 32-bit polynomial CRC calculation. More...
 
__STATIC_INLINE void DL_CRC_feedData8 (CRC_Regs *crc, uint8_t dataIn)
 Feeds 8-bit data into the CRC calculation. More...
 
__STATIC_INLINE void DL_CRC_feedData16 (CRC_Regs *crc, uint16_t dataIn)
 Feeds 16-bit data into the CRC calculation. More...
 
__STATIC_INLINE void DL_CRC_feedData32 (CRC_Regs *crc, uint32_t dataIn)
 Feeds 32-bit data into the CRC calculation. More...
 
__STATIC_INLINE uint16_t DL_CRC_getResult16 (const CRC_Regs *crc)
 Returns the result from the 16-bit polynomial calculation. More...
 
__STATIC_INLINE uint32_t DL_CRC_getResult32 (const CRC_Regs *crc)
 Returns the result from the 32-bit polynomial calculation. More...
 
uint32_t DL_CRC_calculateBlock32 (CRC_Regs *crc, uint32_t seed, const uint32_t *ptr, uint32_t size)
 Calculates the CRC over a range of 32-bit values. More...
 
uint32_t DL_CRC_calculateMemoryRange32 (CRC_Regs *crc, uint32_t seed, uint32_t *ptrStart, const uint32_t *ptrEnd)
 Calculates the CRC over a memory range. More...
 
uint16_t DL_CRC_calculateBlock16 (CRC_Regs *crc, uint16_t seed, const uint16_t *ptr, uint16_t size)
 Calculates the CRC over a range of 16-bit values. More...
 
uint16_t DL_CRC_calculateMemoryRange16 (CRC_Regs *crc, uint16_t seed, uint16_t *ptrStart, const uint16_t *ptrEnd)
 Calculates the CRC over a memory range. More...
 
__STATIC_INLINE uintptr_t DL_CRC_getCRCINAddr (const CRC_Regs *crc)
 Returns the address of the CRC input data register. More...
 

Detailed Description

Overview

The CRC DriverLib allows full configuration of the MSPM0 CRC module. The cyclic redundancy check (CRC) accelerator generates signatures for a given data sequence based on the CRC16-CCITT polynomial or the CRC32-ISO3309 polynomial.


Enumeration Type Documentation

§ DL_CRC_POLYNOMIAL

Enumerator
DL_CRC_16_POLYNOMIAL 

Use 16-bit polynomial for calculation. Follows CRC-16-CCITT standard with a polynomial value of 0x1021.

§ DL_CRC_BIT

enum DL_CRC_BIT
Enumerator
DL_CRC_BIT_REVERSED 

CRC Bit Input and output are reversed

DL_CRC_BIT_NOT_REVERSED 

CRC Bit Input and output are not reversed

§ DL_CRC_INPUT_ENDIANESS

Enumerator
DL_CRC_INPUT_ENDIANESS_LITTLE_ENDIAN 

CRC Input is proccessed in little endian. LSB is lowest memory address and first to be processed.

DL_CRC_INPUT_ENDIANESS_BIG_ENDIAN 

CRC Input is proccessed in big endian. LSB is highest memory address and last to be processed.

§ DL_CRC_OUTPUT_BYTESWAP

Enumerator
DL_CRC_OUTPUT_BYTESWAP_ENABLED 

CRC output byteswap is enabled

DL_CRC_OUTPUT_BYTESWAP_DISABLED 

CRC output byteswap is disabled

Function Documentation

§ DL_CRC_enablePower()

__STATIC_INLINE void DL_CRC_enablePower ( CRC_Regs *  crc)

Enables the Peripheral Write Enable (PWREN) register for the CRC.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

Parameters
crcPointer to the register overlay for the CRC peripheral

§ DL_CRC_disablePower()

__STATIC_INLINE void DL_CRC_disablePower ( CRC_Regs *  crc)

Disables the Peripheral Write Enable (PWREN) register for the CRC.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Note
This API does not provide large power savings.
Parameters
crcPointer to the register overlay for the CRC peripheral

§ DL_CRC_isPowerEnabled()

__STATIC_INLINE bool DL_CRC_isPowerEnabled ( const CRC_Regs *  crc)

Returns if the Peripheral Write Enable (PWREN) register for the CRC is enabled.

Before any peripheral registers can be configured by software, the peripheral itself must be enabled by writing the ENABLE bit together with the appropriate KEY value to the peripheral's PWREN register.

When the PWREN.ENABLE bit is cleared, the peripheral's registers are not accessible for read/write operations.

Parameters
crcPointer to the register overlay for the CRC peripheral
Returns
true if peripheral register access is enabled
false if peripheral register access is disabled

§ DL_CRC_reset()

__STATIC_INLINE void DL_CRC_reset ( CRC_Regs *  crc)

Resets crc peripheral.

Parameters
crcPointer to the register overlay for the CRC peripheral

§ DL_CRC_isReset()

__STATIC_INLINE bool DL_CRC_isReset ( const CRC_Regs *  crc)

Returns if crc module has been reset.

Parameters
crcPointer to the register overlay for the CRC peripheral\
Returns
true if peripheral was reset
false if peripheral wasn't reset

§ DL_CRC_init()

__STATIC_INLINE void DL_CRC_init ( CRC_Regs *  crc,
DL_CRC_POLYNOMIAL  poly,
DL_CRC_BIT  bitOrd,
DL_CRC_INPUT_ENDIANESS  inEndianness,
DL_CRC_OUTPUT_BYTESWAP  outByteSwap 
)

Initializes CRC.

Parameters
crcPointer to the register overlay for the CRC peripheral
polySelects CRC polynomial. One of DL_CRC_POLYNOMIAL.
bitOrdSelects CRC bit order. One of DL_CRC_BIT.
inEndiannessSelects CRC input endianess. One of DL_CRC_INPUT_ENDIANESS.
outByteSwapSelects CRC output byte swap mode. One of DL_CRC_OUTPUT_BYTESWAP.

§ DL_CRC_setSeed16()

__STATIC_INLINE void DL_CRC_setSeed16 ( CRC_Regs *  crc,
uint16_t  seed 
)

Initializes the seed for a 16-bit polynomial CRC calculation.

Note
CRC seed is swapped when CRC module is configured in big-endian mode. For example when calling DL_CRC_setSeed32(CRC, 0xaabb). The CRC module will be initialized with 0xbbaa. Therefore, the seed value should be appropriately specified taking endianness into account. Please refer to the device TRM for additional detail.
Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]seedThe seed for the CRC to start generating a signature from

§ DL_CRC_setSeed32()

__STATIC_INLINE void DL_CRC_setSeed32 ( CRC_Regs *  crc,
uint32_t  seed 
)

Initializes the seed for a 32-bit polynomial CRC calculation.

Note
CRC seed is swapped when CRC module is configured in big-endian mode. For example when calling DL_CRC_setSeed32(CRC, 0xaabbccdd). The CRC module will be initialized with 0xddccbbaa. Therefore, the seed value should be appropriately specified taking endianness into account. Please refer to the device TRM for additional detail.
Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]seedThe seed for the CRC to start generating a signature from

§ DL_CRC_feedData8()

__STATIC_INLINE void DL_CRC_feedData8 ( CRC_Regs *  crc,
uint8_t  dataIn 
)

Feeds 8-bit data into the CRC calculation.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]dataIn8-bit data value to add to the signature

§ DL_CRC_feedData16()

__STATIC_INLINE void DL_CRC_feedData16 ( CRC_Regs *  crc,
uint16_t  dataIn 
)

Feeds 16-bit data into the CRC calculation.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]dataIn16-bit data value to add to the signature

§ DL_CRC_feedData32()

__STATIC_INLINE void DL_CRC_feedData32 ( CRC_Regs *  crc,
uint32_t  dataIn 
)

Feeds 32-bit data into the CRC calculation.

Feeds a 32-bit value into the CRC calculation. 32-bit data can only be used with the 32-bit polynomial.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]dataIn32 bit data value to add to the signature

§ DL_CRC_getResult16()

__STATIC_INLINE uint16_t DL_CRC_getResult16 ( const CRC_Regs *  crc)

Returns the result from the 16-bit polynomial calculation.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
Returns
The calculation result for the 16-bit polynomial

§ DL_CRC_getResult32()

__STATIC_INLINE uint32_t DL_CRC_getResult32 ( const CRC_Regs *  crc)

Returns the result from the 32-bit polynomial calculation.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
Returns
The calculation result for the 32-bit polynomial

References DL_CRC_calculateBlock16(), DL_CRC_calculateBlock32(), DL_CRC_calculateMemoryRange16(), and DL_CRC_calculateMemoryRange32().

§ DL_CRC_calculateBlock32()

uint32_t DL_CRC_calculateBlock32 ( CRC_Regs *  crc,
uint32_t  seed,
const uint32_t *  ptr,
uint32_t  size 
)

Calculates the CRC over a range of 32-bit values.

Uses the 32-bit polynomial to calculate the checksum over a block of values.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]seedThe seed for the CRC to start generating a signature from
[in]ptrA pointer to the block of code to calculate the CRC over
[in]sizeThe size of the block of uint32_t data
Returns
The calculated CRC signature value

Referenced by DL_CRC_getResult32().

§ DL_CRC_calculateMemoryRange32()

uint32_t DL_CRC_calculateMemoryRange32 ( CRC_Regs *  crc,
uint32_t  seed,
uint32_t *  ptrStart,
const uint32_t *  ptrEnd 
)

Calculates the CRC over a memory range.

Calculates the checksum using the 32-bit polynomial over any memory range.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]seedThe seed used to start generating a signature from
[in]ptrStartA uint32_t pointer to the start of a block of code to calculate the CRC over
[in]ptrEndA uint32_t pointer to the end of a block of code to calculate the CRC over
Returns
The calculated CRC signature value

Referenced by DL_CRC_getResult32().

§ DL_CRC_calculateBlock16()

uint16_t DL_CRC_calculateBlock16 ( CRC_Regs *  crc,
uint16_t  seed,
const uint16_t *  ptr,
uint16_t  size 
)

Calculates the CRC over a range of 16-bit values.

Uses the 16-bit polynomial to calculate the checksum over a block of values.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]seedThe seed for the CRC to start generating a signature from
[in]ptrA pointer to the block of code to calculate the CRC over
[in]sizeThe size of the block of 16-bit data
Returns
The calculated CRC signature value

Referenced by DL_CRC_getResult32().

§ DL_CRC_calculateMemoryRange16()

uint16_t DL_CRC_calculateMemoryRange16 ( CRC_Regs *  crc,
uint16_t  seed,
uint16_t *  ptrStart,
const uint16_t *  ptrEnd 
)

Calculates the CRC over a memory range.

Calculates the checksum using the 16-bit polynomial over any memory range.

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
[in]seedThe seed used to start generating a signature from
[in]ptrStartA uint16_t pointer to the start of a block of code to calculate the CRC over
[in]ptrEndA uint16_t pointer to the end of a block of code to calculate the CRC over
Returns
The calculated CRC signature value

Referenced by DL_CRC_getResult32().

§ DL_CRC_getCRCINAddr()

__STATIC_INLINE uintptr_t DL_CRC_getCRCINAddr ( const CRC_Regs *  crc)

Returns the address of the CRC input data register.

This API can be used with DL_DMA_setDestAddr to set the destination address when using DMA transfers

Parameters
[in]crcPointer to the register overlay for the CRC peripheral
Returns
Address of the CRC input data register
© Copyright 1995-2025, Texas Instruments Incorporated. All rights reserved.
Trademarks | Privacy policy | Terms of use | Terms of sale