MSPM0L122X_L222X Driver Library  2.08.00.03
Macros | Enumerations | Functions
Cyclic Redundancy Check with Configurable Polynomial (CRCP)

Macros

#define DL_CRC_POLYNOMIAL_SIZE_16   DL_CRCP_POLYNOMIAL_SIZE_16
 Redirects to DL_CRCP_POLYNOMIAL_SIZE_16 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_POLYNOMIAL_SIZE_32   DL_CRCP_POLYNOMIAL_SIZE_32
 Redirects to DL_CRCP_POLYNOMIAL_SIZE_32 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_BIT_REVERSED   DL_CRCP_BIT_REVERSED
 Redirects to DL_CRCP_BIT_REVERSED for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_BIT_NOT_REVERSED   DL_CRCP_BIT_NOT_REVERSED
 Redirects to DL_CRCP_BIT_NOT_REVERSED for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_INPUT_ENDIANESS_LITTLE_ENDIAN   DL_CRCP_INPUT_ENDIANESS_LITTLE_ENDIAN
 Redirects to DL_CRCP_INPUT_ENDIANESS_LITTLE_ENDIAN for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_INPUT_ENDIANESS_BIG_ENDIAN   DL_CRCP_INPUT_ENDIANESS_BIG_ENDIAN
 Redirects to DL_CRCP_INPUT_ENDIANESS_BIG_ENDIAN for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_OUTPUT_BYTESWAP_ENABLED   DL_CRCP_OUTPUT_BYTESWAP_ENABLED
 Redirects to DL_CRCP_OUTPUT_BYTESWAP_ENABLED for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_OUTPUT_BYTESWAP_DISABLED   DL_CRCP_OUTPUT_BYTESWAP_DISABLED
 Redirects to DL_CRCP_OUTPUT_BYTESWAP_DISABLED for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_32_MPEG2   DL_CRCP_CRCPOLY_POLYNOMIAL_32_MPEG2
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_32_MPEG2 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_32_MPEG2   DL_CRCP_CRCPOLY_POLYNOMIAL_32_MPEG2
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_32_MPEG2 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_32_Q   DL_CRCP_CRCPOLY_POLYNOMIAL_32_Q
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_32_Q for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_32_JAMCRC   DL_CRCP_CRCPOLY_POLYNOMIAL_32_JAMCRC
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_32_JAMCRC for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_32_XFER   DL_CRCP_CRCPOLY_POLYNOMIAL_32_XFER
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_32_XFER for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_16_CCIT_ZERO   DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_ZERO
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_ZERO for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_16_ARC   DL_CRCP_CRCPOLY_POLYNOMIAL_16_ARC
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_16_ARC for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_16_AUG_CCIT   DL_CRCP_CRCPOLY_POLYNOMIAL_16_AUG_CCIT
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_16_AUG_CCIT for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_16_BUYPASS   DL_CRCP_CRCPOLY_POLYNOMIAL_16_BUYPASS
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_16_BUYPASS for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_16_CCIT_FALSE   DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_FALSE
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_FALSE for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_16_CDMA2000   DL_CRCP_CRCPOLY_POLYNOMIAL_16_CDMA2000
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_16_CDMA2000 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCPOLY_POLYNOMIAL_16_MODBUS   DL_CRCP_CRCPOLY_POLYNOMIAL_16_MODBUS
 Redirects to DL_CRCP_CRCPOLY_POLYNOMIAL_16_MODBUS for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_32_MPEG2   DL_CRCP_CRCSEED_SEED_32_MPEG2
 Redirects to DL_CRCP_CRCSEED_SEED_32_MPEG2 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_32_MPEG2   DL_CRCP_CRCSEED_SEED_32_MPEG2
 Redirects to DL_CRCP_CRCSEED_SEED_32_MPEG2 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_32_Q   DL_CRCP_CRCSEED_SEED_32_Q
 Redirects to DL_CRCP_CRCSEED_SEED_32_Q for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_32_JAMCRC   DL_CRCP_CRCSEED_SEED_32_JAMCRC
 Redirects to DL_CRCP_CRCSEED_SEED_32_JAMCRC for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_32_XFER   DL_CRCP_CRCSEED_SEED_32_XFER
 Redirects to DL_CRCP_CRCSEED_SEED_32_XFER for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_16_AUG_CCIT   DL_CRCP_CRCSEED_SEED_16_AUG_CCIT
 Redirects to DL_CRCP_CRCSEED_SEED_16_AUG_CCIT for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_16_BUYPASS   DL_CRCP_CRCSEED_SEED_16_BUYPASS
 Redirects to DL_CRCP_CRCSEED_SEED_16_BUYPASS for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_16_CCIT_FALSE   DL_CRCP_CRCSEED_SEED_16_CCIT_FALSE
 Redirects to DL_CRCP_CRCSEED_SEED_16_CCIT_FALSE for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_16_CDMA2000   DL_CRCP_CRCSEED_SEED_16_CDMA2000
 Redirects to DL_CRCP_CRCSEED_SEED_16_CDMA2000 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_CRCSEED_SEED_16_MODBUS   DL_CRCP_CRCSEED_SEED_16_MODBUS
 Redirects to DL_CRCP_CRCSEED_SEED_16_MODBUS for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_enablePower   DL_CRCP_enablePower
 Redirects to DL_CRCP_enablePower for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_isPowerEnabled   DL_CRCP_isPowerEnabled
 Redirects to DL_CRCP_isPowerEnabled for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_reset   DL_CRCP_reset
 Redirects to DL_CRCP_reset for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_isReset   DL_CRCP_isReset
 Redirects to DL_CRCP_isReset for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_init   DL_CRCP_init
 Redirects to DL_CRCP_init for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_setSeed16   DL_CRCP_setSeed16
 Redirects to DL_CRCP_setSeed16 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_setSeed32   DL_CRCP_setSeed32
 Redirects to DL_CRCP_setSeed32 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_feedData8   DL_CRCP_feedData8
 Redirects to DL_CRCP_feedData8 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_feedData16   DL_CRCP_feedData16
 Redirects to DL_CRCP_feedData16 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_feedData32   DL_CRCP_feedData32
 Redirects to DL_CRCP_feedData32 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_getResult16   DL_CRCP_getResult16
 Redirects to DL_CRCP_getResult16 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_getResult32   DL_CRCP_getResult32
 Redirects to DL_CRCP_getResult32 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_setPolynomial   DL_CRCP_setPolynomial
 Redirects to DL_CRCP_setPolynomial for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_getPolynomial   DL_CRCP_getPolynomial
 Redirects to DL_CRCP_getPolynomial for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_calculateBlock32   DL_CRCP_calculateBlock32
 Redirects to DL_CRCP_calculateBlock32 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_calculateMemoryRange32   DL_CRCP_calculateMemoryRange32
 Redirects to DL_CRCP_calculateMemoryRange32 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_calculateBlock16   DL_CRCP_calculateBlock16
 Redirects to DL_CRCP_calculateBlock16 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_calculateMemoryRange16   DL_CRCP_calculateMemoryRange16
 Redirects to DL_CRCP_calculateMemoryRange16 for compatibility between CRC and CRCP DriverLib modules.
 
#define DL_CRC_getCRCINAddr   DL_CRCP_getCRCINAddr
 Redirects to DL_CRCP_getCRCINAddr for compatibility between CRC and CRCP DriverLib modules.
 

Enumerations

enum  DL_CRCP_POLYNOMIAL_SIZE {
  DL_CRCP_POLYNOMIAL_SIZE_16 = CRCP_CRCCTRL_POLYSIZE_CRC16,
  DL_CRCP_POLYNOMIAL_SIZE_32 = CRCP_CRCCTRL_POLYSIZE_CRC32
}
 
enum  DL_CRCP_BIT {
  DL_CRCP_BIT_REVERSED = CRCP_CRCCTRL_BITREVERSE_REVERSED,
  DL_CRCP_BIT_NOT_REVERSED = CRCP_CRCCTRL_BITREVERSE_NOT_REVERSED
}
 
enum  DL_CRCP_INPUT_ENDIANESS {
  DL_CRCP_INPUT_ENDIANESS_LITTLE_ENDIAN,
  DL_CRCP_INPUT_ENDIANESS_BIG_ENDIAN
}
 
enum  DL_CRCP_OUTPUT_BYTESWAP {
  DL_CRCP_OUTPUT_BYTESWAP_ENABLED = CRCP_CRCCTRL_OUTPUT_BYTESWAP_ENABLE,
  DL_CRCP_OUTPUT_BYTESWAP_DISABLED = CRCP_CRCCTRL_OUTPUT_BYTESWAP_DISABLE
}
 
enum  DL_CRCP_CRCPOLY_POLYNOMIAL {
  DL_CRCP_CRCPOLY_POLYNOMIAL_32_MPEG2 = 0x04C11DB7,
  DL_CRCP_CRCPOLY_POLYNOMIAL_32_Q = 0x814141AB,
  DL_CRCP_CRCPOLY_POLYNOMIAL_32_JAMCRC = 0x04C11DB7,
  DL_CRCP_CRCPOLY_POLYNOMIAL_32_XFER = 0x000000AF,
  DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_ZERO = 0x00001021,
  DL_CRCP_CRCPOLY_POLYNOMIAL_16_ARC = 0x00001DCF,
  DL_CRCP_CRCPOLY_POLYNOMIAL_16_AUG_CCIT = 0x00001021,
  DL_CRCP_CRCPOLY_POLYNOMIAL_16_BUYPASS = 0x00008005,
  DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_FALSE = 0x00001021,
  DL_CRCP_CRCPOLY_POLYNOMIAL_16_CDMA2000 = 0x0000C867,
  DL_CRCP_CRCPOLY_POLYNOMIAL_16_MODBUS = 0x00008005
}
 commonly used pre-defined polynomials to be used by CRCP as mentioned by the website http://www.sunshine2k.de/coding/javascript/crc/crc_js.html. Custom polynomials can also be used in lieu of the follwoing. More...
 
enum  DL_CRCP_CRCSEED_SEED {
  DL_CRCP_CRCSEED_SEED_32_MPEG2 = 0xFFFFFFFF,
  DL_CRCP_CRCSEED_SEED_32_Q = 0x00000000,
  DL_CRCP_CRCSEED_SEED_32_JAMCRC = 0xFFFFFFFF,
  DL_CRCP_CRCSEED_SEED_32_XFER = 0x00000000,
  DL_CRCP_CRCSEED_SEED_16_CCIT_ZERO = 0x0000,
  DL_CRCP_CRCSEED_SEED_16_ARC = 0x0000,
  DL_CRCP_CRCSEED_SEED_16_AUG_CCIT = 0x1D0F,
  DL_CRCP_CRCSEED_SEED_16_BUYPASS = 0x0000,
  DL_CRCP_CRCSEED_SEED_16_CCIT_FALSE = 0xFFFF,
  DL_CRCP_CRCSEED_SEED_16_CDMA2000 = 0xFFFF,
  DL_CRCP_CRCSEED_SEED_16_MODBUS = 0xFFFF
}
 seeds for commonly used pre-defined polynomials to be used by CRCP as mentioned by the website http://www.sunshine2k.de/coding/javascript/crc/crc_js.html. Custom polynomials can also be used in lieu of the follwoing. More...
 

Functions

__STATIC_INLINE void DL_CRCP_enablePower (CRCP_Regs *crcp)
 Enables the Peripheral Write Enable (PWREN) register for the CRCP. More...
 
__STATIC_INLINE void DL_CRCP_disablePower (CRCP_Regs *crcp)
 Disables the Peripheral Write Enable (PWREN) register for the CRCP. More...
 
__STATIC_INLINE bool DL_CRCP_isPowerEnabled (const CRCP_Regs *crcp)
 Returns if the Peripheral Write Enable (PWREN) register for the CRCP is enabled. More...
 
__STATIC_INLINE void DL_CRCP_reset (CRCP_Regs *crcp)
 Resets CRCP peripheral. More...
 
__STATIC_INLINE bool DL_CRCP_isReset (const CRCP_Regs *crcp)
 Returns if CRCP module has been reset. More...
 
__STATIC_INLINE void DL_CRCP_init (CRCP_Regs *crcp, DL_CRCP_POLYNOMIAL_SIZE polySize, DL_CRCP_BIT bitOrd, DL_CRCP_INPUT_ENDIANESS inEndianness, DL_CRCP_OUTPUT_BYTESWAP outByteSwap)
 Initializes the CRCP peripheral. More...
 
__STATIC_INLINE void DL_CRCP_setSeed16 (CRCP_Regs *crcp, uint16_t seed)
 Initializes the seed for a 16-bit polynomial CRC calculation. More...
 
__STATIC_INLINE void DL_CRCP_setSeed32 (CRCP_Regs *crcp, uint32_t seed)
 Initializes the seed for a 32-bit polynomial CRC calculation. More...
 
__STATIC_INLINE void DL_CRCP_feedData8 (CRCP_Regs *crcp, uint8_t dataIn)
 Feeds 8-bit data into the CRC calculation. More...
 
__STATIC_INLINE void DL_CRCP_feedData16 (CRCP_Regs *crcp, uint16_t dataIn)
 Feeds 16-bit data into the CRC calculation. More...
 
__STATIC_INLINE void DL_CRCP_feedData32 (CRCP_Regs *crcp, uint32_t dataIn)
 Feeds 32-bit data into the CRC calculation. More...
 
__STATIC_INLINE uint16_t DL_CRCP_getResult16 (const CRCP_Regs *crcp)
 Returns the result from the 16-bit polynomial calculation. More...
 
__STATIC_INLINE uint32_t DL_CRCP_getResult32 (const CRCP_Regs *crcp)
 Returns the result from the 32-bit polynomial calculation. More...
 
__STATIC_INLINE void DL_CRCP_setPolynomial (CRCP_Regs *crcp, uint32_t poly)
 Sets the active polynomial terms for the CRC calculation. More...
 
__STATIC_INLINE uint32_t DL_CRCP_getPolynomial (const CRCP_Regs *crcp)
 Gets the active polynomial terms for the CRC calculation. More...
 
uint32_t DL_CRCP_calculateBlock32 (CRCP_Regs *crcp, uint32_t seed, const uint32_t *ptr, uint32_t size)
 Calculates the CRC over a range of 32-bit values. More...
 
uint32_t DL_CRCP_calculateMemoryRange32 (CRCP_Regs *crcp, uint32_t seed, uint32_t *ptrStart, const uint32_t *ptrEnd)
 Calculates the CRC over a memory range. More...
 
uint16_t DL_CRCP_calculateBlock16 (CRCP_Regs *crcp, uint16_t seed, const uint16_t *ptr, uint16_t size)
 Calculates the CRC over a range of 16-bit values. More...
 
uint16_t DL_CRCP_calculateMemoryRange16 (CRCP_Regs *crcp, uint16_t seed, uint16_t *ptrStart, const uint16_t *ptrEnd)
 Calculates the CRC over a memory range. More...
 
__STATIC_INLINE uintptr_t DL_CRCP_getCRCINAddr (const CRCP_Regs *crcp)
 Returns the address of the CRC input data register. More...
 

Detailed Description

Overview

The CRCP DriverLib allows full configuration of the MSPM0 CRCP module. The cyclic redundancy check (CRC) accelerator generates signatures for a given data sequence based on a user-configured polynomial, allowing for support of any 16-bit or 32-bit polynomial including but not limited to:


Enumeration Type Documentation

§ DL_CRCP_POLYNOMIAL_SIZE

Enumerator
DL_CRCP_POLYNOMIAL_SIZE_16 

Use lower 16-bit value of CRCPOLY as polynomial for calculation. Upon reset, user will need to update polynomial value for 16-bits, such as the CRC-16-CCITT standard of 0x1021.

DL_CRCP_POLYNOMIAL_SIZE_32 

Use 32-bit polynomial value of CRCPOLY as polynomial for calculation. Defaults to the CRC32-ISO3309 standard value of 0x04C11DB7.

§ DL_CRCP_BIT

Enumerator
DL_CRCP_BIT_REVERSED 

CRCP Bit Input and output bit orders are reversed

DL_CRCP_BIT_NOT_REVERSED 

CRCP Bit Input and output are not reversed

§ DL_CRCP_INPUT_ENDIANESS

Enumerator
DL_CRCP_INPUT_ENDIANESS_LITTLE_ENDIAN 

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

DL_CRCP_INPUT_ENDIANESS_BIG_ENDIAN 

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

§ DL_CRCP_OUTPUT_BYTESWAP

Enumerator
DL_CRCP_OUTPUT_BYTESWAP_ENABLED 

CRCP output byteswap is enabled

DL_CRCP_OUTPUT_BYTESWAP_DISABLED 

CRCP output byteswap is disabled

§ DL_CRCP_CRCPOLY_POLYNOMIAL

commonly used pre-defined polynomials to be used by CRCP as mentioned by the website http://www.sunshine2k.de/coding/javascript/crc/crc_js.html. Custom polynomials can also be used in lieu of the follwoing.

Enumerator
DL_CRCP_CRCPOLY_POLYNOMIAL_32_MPEG2 

CRCP commonly used polynomial CRC32_MPEG2. To match online output, seed value must be set to 0xFFFFFFFF

DL_CRCP_CRCPOLY_POLYNOMIAL_32_Q 

CRCP commonly used polynomial CRC32_Q. To match online output, seed value must be set to 0x00000000

DL_CRCP_CRCPOLY_POLYNOMIAL_32_JAMCRC 

CRCP commonly used polynomial CRC32_JAMCRC. To match online output, seed value must be set to 0xFFFFFFFF and bit order reversed

DL_CRCP_CRCPOLY_POLYNOMIAL_32_XFER 

CRCP commonly used polynomial CRC32_XFER. To match online output, seed value must be set to 0x00000000

DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_ZERO 

CRCP commonly used polynomial CRC16_CCIT_ZERO. To match online output, seed value must be set to 0x0000

DL_CRCP_CRCPOLY_POLYNOMIAL_16_ARC 

CRCP commonly used polynomial CRC16_ARC. To match online output, seed value must be set to 0x0000 and bit order reversed

DL_CRCP_CRCPOLY_POLYNOMIAL_16_AUG_CCIT 

CRCP commonly used polynomial CRC16_AUG_CCIT. To match online output, seed value must be set to 0x1D0F

DL_CRCP_CRCPOLY_POLYNOMIAL_16_BUYPASS 

CRCP commonly used polynomial CRC16_BUYPASS. To match online output, seed value must be set to 0x0000

DL_CRCP_CRCPOLY_POLYNOMIAL_16_CCIT_FALSE 

CRCP commonly used polynomial CRC16_CCIT_FALSE. To match online output, seed value must be set to 0xFFFF

DL_CRCP_CRCPOLY_POLYNOMIAL_16_CDMA2000 

CRCP commonly used polynomial CRC16_CDMA2000. To match online output, seed value must be set to 0xFFFF

DL_CRCP_CRCPOLY_POLYNOMIAL_16_MODBUS 

CRCP commonly used polynomial CRC16_MODBUS. To match online output, seed value must be set to 0xFFFF and bit order reversed

§ DL_CRCP_CRCSEED_SEED

seeds for commonly used pre-defined polynomials to be used by CRCP as mentioned by the website http://www.sunshine2k.de/coding/javascript/crc/crc_js.html. Custom polynomials can also be used in lieu of the follwoing.

Enumerator
DL_CRCP_CRCSEED_SEED_32_MPEG2 

CRCP commonly used polynomial CRC32_MPEG2. To match online output, polynomial must be set to 0x04C11DB7

DL_CRCP_CRCSEED_SEED_32_Q 

CRCP commonly used polynomial CRC32_Q. To match online output, polynomial must be set to 0x814141AB

DL_CRCP_CRCSEED_SEED_32_JAMCRC 

CRCP commonly used polynomial CRC32_JAMCRC. To match online output, polynomial must be set to 0x04C11DB7 and bit order reversed

DL_CRCP_CRCSEED_SEED_32_XFER 

CRCP commonly used polynomial CRC32_XFER. To match online output, polynomial must be set to 0x000000AF

DL_CRCP_CRCSEED_SEED_16_CCIT_ZERO 

CRCP commonly used polynomial CRC16_CCIT_ZERO. To match online output, polynomial must be set to 0x00001021

DL_CRCP_CRCSEED_SEED_16_ARC 

CRCP commonly used polynomial CRC16_ARC. To match online output, polynomial must be set to 0x00001DCF and bit order reversed

DL_CRCP_CRCSEED_SEED_16_AUG_CCIT 

CRCP commonly used polynomial CRC16_AUG_CCIT. To match online output, polynomial must be set to 0x00001021

DL_CRCP_CRCSEED_SEED_16_BUYPASS 

CRCP commonly used polynomial CRC16_BUYPASS. To match online output, polynomial must be set to 0x00008005

DL_CRCP_CRCSEED_SEED_16_CCIT_FALSE 

CRCP commonly used polynomial CRC16_CCIT_FALSE. To match online output, polynomial must be set to 0x00001021

DL_CRCP_CRCSEED_SEED_16_CDMA2000 

CRCP commonly used polynomial CRC16_CDMA2000. To match online output, polynomial must be set to 0x0000C867

DL_CRCP_CRCSEED_SEED_16_MODBUS 

CRCP commonly used polynomial CRC16_MODBUS. To match online output, polynomial must be set to 0x00008005 and bit order reversed

Function Documentation

§ DL_CRCP_enablePower()

__STATIC_INLINE void DL_CRCP_enablePower ( CRCP_Regs *  crcp)

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

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
crcpPointer to the register overlay for the CRCP peripheral

§ DL_CRCP_disablePower()

__STATIC_INLINE void DL_CRCP_disablePower ( CRCP_Regs *  crcp)

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

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
crcpPointer to the register overlay for the CRCP peripheral

§ DL_CRCP_isPowerEnabled()

__STATIC_INLINE bool DL_CRCP_isPowerEnabled ( const CRCP_Regs *  crcp)

Returns if the Peripheral Write Enable (PWREN) register for the CRCP 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
crcpPointer to the register overlay for the CRCP peripheral
Returns
true if peripheral register access is enabled
false if peripheral register access is disabled

§ DL_CRCP_reset()

__STATIC_INLINE void DL_CRCP_reset ( CRCP_Regs *  crcp)

Resets CRCP peripheral.

Parameters
crcpPointer to the register overlay for the CRCP peripheral

§ DL_CRCP_isReset()

__STATIC_INLINE bool DL_CRCP_isReset ( const CRCP_Regs *  crcp)

Returns if CRCP module has been reset.

Parameters
crcpPointer to the register overlay for the CRCP peripheral
Returns
true if peripheral was reset
false if peripheral wasn't reset

§ DL_CRCP_init()

__STATIC_INLINE void DL_CRCP_init ( CRCP_Regs *  crcp,
DL_CRCP_POLYNOMIAL_SIZE  polySize,
DL_CRCP_BIT  bitOrd,
DL_CRCP_INPUT_ENDIANESS  inEndianness,
DL_CRCP_OUTPUT_BYTESWAP  outByteSwap 
)

Initializes the CRCP peripheral.

Parameters
crcpPointer to the register overlay for the CRCP peripheral.
polySizeSelects CRC polynomial size. One of DL_CRCP_POLYNOMIAL_SIZE.
bitOrdSelects CRC bit order. One of DL_CRCP_BIT.
inEndiannessSelects CRC input endianess. One of DL_CRCP_INPUT_ENDIANESS.
outByteSwapSelects CRC output byte swap mode. One of DL_CRCP_OUTPUT_BYTESWAP.

§ DL_CRCP_setSeed16()

__STATIC_INLINE void DL_CRCP_setSeed16 ( CRCP_Regs *  crcp,
uint16_t  seed 
)

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

Note
CRC seed is swapped when CRCP module is configured in big-endian mode. For example when calling DL_CRCP_setSeed32(CRC, 0xaabb). The CRCP 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.

Sets the inital seed for a 16-bit CRC calculation. can be any value, or cast one of the common seeds in DL_CRCP_CRCSEED_SEED.

Parameters
[in]crcpPointer to the register overlay for the CRCP peripheral
[in]seedThe seed from which to start generating a signature

§ DL_CRCP_setSeed32()

__STATIC_INLINE void DL_CRCP_setSeed32 ( CRCP_Regs *  crcp,
uint32_t  seed 
)

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

Note
CRC seed is swapped when CRCP module is configured in big-endian mode. For example when calling DL_CRCP_setSeed32(CRC, 0xaabbccdd). The CRCP 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.

Sets the inital seed for a 32-bit CRC calculation. can be any value, or cast one of the common seeds in DL_CRCP_CRCSEED_SEED.

Parameters
[in]crcpPointer to the register overlay for the CRCP peripheral
[in]seedThe seed from which to start generating a signature

§ DL_CRCP_feedData8()

__STATIC_INLINE void DL_CRCP_feedData8 ( CRCP_Regs *  crcp,
uint8_t  dataIn 
)

Feeds 8-bit data into the CRC calculation.

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

§ DL_CRCP_feedData16()

__STATIC_INLINE void DL_CRCP_feedData16 ( CRCP_Regs *  crcp,
uint16_t  dataIn 
)

Feeds 16-bit data into the CRC calculation.

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

§ DL_CRCP_feedData32()

__STATIC_INLINE void DL_CRCP_feedData32 ( CRCP_Regs *  crcp,
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]crcpPointer to the register overlay for the CRCP peripheral
[in]dataIn32 bit data value to add to the signature

§ DL_CRCP_getResult16()

__STATIC_INLINE uint16_t DL_CRCP_getResult16 ( const CRCP_Regs *  crcp)

Returns the result from the 16-bit polynomial calculation.

Note
CRC Output will be swapped if the CRCP module is configured in byte-swap mode. For example, if enabled and CRCOUT register has the value 0xaabbccdd, DL_CRCP_getResult16 would return 0xddcc. Please refer to the TRM for more information.
Parameters
[in]crcpPointer to the register overlay for the CRCP peripheral
Returns
The calculation result for the 16-bit polynomial

§ DL_CRCP_getResult32()

__STATIC_INLINE uint32_t DL_CRCP_getResult32 ( const CRCP_Regs *  crcp)

Returns the result from the 32-bit polynomial calculation.

Note
CRC Output will be swapped if the CRCP module is configured in byte-swap mode. For example, if enabled and CRCOUT register has value 0xaabbccdd, DL_CRCP_getResult32 would return 0xddccbbaa in the 32-bit case, and 0x0000ddcc. In the 16-bit case. Additionally, if byte-swap is disabled, the 16-bit size would return 0x0000ccdd. Please refer to the TRM for more information.
Parameters
[in]crcpPointer to the register overlay for the CRCP peripheral
Returns
The calculation result for the 32-bit polynomial

§ DL_CRCP_setPolynomial()

__STATIC_INLINE void DL_CRCP_setPolynomial ( CRCP_Regs *  crcp,
uint32_t  poly 
)

Sets the active polynomial terms for the CRC calculation.

The polynomial can be any value represented with MSB first. Thus, in a 16-bit polynomial (where the 16th power is always present), the nth bit corresponds to the inclusion of the nth term of the polynomial. For example, The 16-bit polynomial CCIT x^16 + x^12 + x^5 + 1 is represented as 0x1021. One can craft a custom polynomial, use an existing polynomial, or cast one of the common polynomials in DL_CRCP_CRCPOLY_POLYNOMIAL. If the polynomial size is configured as 16-bit, the upper 16-bits are ignored.

Parameters
[in]crcpPointer to the register overlay for the CRCP peripheral
[in]polyPolynomial to implement (normal representation)

§ DL_CRCP_getPolynomial()

__STATIC_INLINE uint32_t DL_CRCP_getPolynomial ( const CRCP_Regs *  crcp)

Gets the active polynomial terms for the CRC calculation.

The polynomial can be any value represented as with MSB first. Thus, in a 16-bit polynomial (where the 16th power is always present), the nth bit corresponds to the inclusion of the nth term of the polynomial. For example, The 16-bit polynomial CCIT x^16 + x^12 + x^5 + 1 is represented as 0x1021. If the polynomial size is configured as 16-bit, the upper 16-bits are ignored.

Parameters
[in]crcpPointer to the register overlay for the CRCP peripheral
Returns
Active polynomial (normal representation)

References DL_CRCP_calculateBlock16(), DL_CRCP_calculateBlock32(), DL_CRCP_calculateMemoryRange16(), and DL_CRCP_calculateMemoryRange32().

§ DL_CRCP_calculateBlock32()

uint32_t DL_CRCP_calculateBlock32 ( CRCP_Regs *  crcp,
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]crcpPointer to the register overlay for the CRCP 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_CRCP_getPolynomial().

§ DL_CRCP_calculateMemoryRange32()

uint32_t DL_CRCP_calculateMemoryRange32 ( CRCP_Regs *  crcp,
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]crcpPointer 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_CRCP_getPolynomial().

§ DL_CRCP_calculateBlock16()

uint16_t DL_CRCP_calculateBlock16 ( CRCP_Regs *  crcp,
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]crcpPointer to the register overlay for the CRCP peripheral
[in]seedThe seed for the CRCP 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_CRCP_getPolynomial().

§ DL_CRCP_calculateMemoryRange16()

uint16_t DL_CRCP_calculateMemoryRange16 ( CRCP_Regs *  crcp,
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]crcpPointer 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_CRCP_getPolynomial().

§ DL_CRCP_getCRCINAddr()

__STATIC_INLINE uintptr_t DL_CRCP_getCRCINAddr ( const CRCP_Regs *  crcp)

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]crcpPointer 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