![]() |
![]() |
MSPM0C1105_C1106 Driver Library
2.05.01.00
|
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... | |
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.
enum DL_CRC_POLYNOMIAL |
enum DL_CRC_BIT |
__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.
crc | Pointer to the register overlay for the CRC peripheral |
__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.
crc | Pointer to the register overlay for the CRC peripheral |
__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.
crc | Pointer to the register overlay for the CRC peripheral |
__STATIC_INLINE void DL_CRC_reset | ( | CRC_Regs * | crc | ) |
Resets crc peripheral.
crc | Pointer to the register overlay for the CRC peripheral |
__STATIC_INLINE bool DL_CRC_isReset | ( | const CRC_Regs * | crc | ) |
Returns if crc module has been reset.
crc | Pointer to the register overlay for the CRC peripheral\ |
__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.
crc | Pointer to the register overlay for the CRC peripheral |
poly | Selects CRC polynomial. One of DL_CRC_POLYNOMIAL. |
bitOrd | Selects CRC bit order. One of DL_CRC_BIT. |
inEndianness | Selects CRC input endianess. One of DL_CRC_INPUT_ENDIANESS. |
outByteSwap | Selects CRC output byte swap mode. One of DL_CRC_OUTPUT_BYTESWAP. |
__STATIC_INLINE void DL_CRC_setSeed16 | ( | CRC_Regs * | crc, |
uint16_t | seed | ||
) |
Initializes the seed for a 16-bit polynomial CRC calculation.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | seed | The seed for the CRC to start generating a signature from |
__STATIC_INLINE void DL_CRC_setSeed32 | ( | CRC_Regs * | crc, |
uint32_t | seed | ||
) |
Initializes the seed for a 32-bit polynomial CRC calculation.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | seed | The seed for the CRC to start generating a signature from |
__STATIC_INLINE void DL_CRC_feedData8 | ( | CRC_Regs * | crc, |
uint8_t | dataIn | ||
) |
Feeds 8-bit data into the CRC calculation.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | dataIn | 8-bit data value to add to the signature |
__STATIC_INLINE void DL_CRC_feedData16 | ( | CRC_Regs * | crc, |
uint16_t | dataIn | ||
) |
Feeds 16-bit data into the CRC calculation.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | dataIn | 16-bit data value to add to the signature |
__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.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | dataIn | 32 bit data value to add to the signature |
__STATIC_INLINE uint16_t DL_CRC_getResult16 | ( | const CRC_Regs * | crc | ) |
Returns the result from the 16-bit polynomial calculation.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
__STATIC_INLINE uint32_t DL_CRC_getResult32 | ( | const CRC_Regs * | crc | ) |
Returns the result from the 32-bit polynomial calculation.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
References DL_CRC_calculateBlock16(), DL_CRC_calculateBlock32(), DL_CRC_calculateMemoryRange16(), and DL_CRC_calculateMemoryRange32().
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.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | seed | The seed for the CRC to start generating a signature from |
[in] | ptr | A pointer to the block of code to calculate the CRC over |
[in] | size | The size of the block of uint32_t data |
Referenced by DL_CRC_getResult32().
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.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | seed | The seed used to start generating a signature from |
[in] | ptrStart | A uint32_t pointer to the start of a block of code to calculate the CRC over |
[in] | ptrEnd | A uint32_t pointer to the end of a block of code to calculate the CRC over |
Referenced by DL_CRC_getResult32().
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.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | seed | The seed for the CRC to start generating a signature from |
[in] | ptr | A pointer to the block of code to calculate the CRC over |
[in] | size | The size of the block of 16-bit data |
Referenced by DL_CRC_getResult32().
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.
[in] | crc | Pointer to the register overlay for the CRC peripheral |
[in] | seed | The seed used to start generating a signature from |
[in] | ptrStart | A uint16_t pointer to the start of a block of code to calculate the CRC over |
[in] | ptrEnd | A uint16_t pointer to the end of a block of code to calculate the CRC over |
Referenced by DL_CRC_getResult32().
__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
[in] | crc | Pointer to the register overlay for the CRC peripheral |