Cyclic Redundancy Check Library
This Library provides a set of functions for using the MSPWare CRC32 module. Functions are provided to initialize the CRC and create a CRC signature to check the validity of data.
This is mostly useful in the communication of data, or as a startup procedure to as a more complex and accurate check of data.
The CRC32 module offers no interrupts and is used only to generate CRC signatures to verify against pre-made CRC signatures (Checksums). The CRC32 module provides the capability for both 32-bit and 16-bit calculations.
As such, the DriverLib API provides functionality for the user to provide variable bit-length data for either 16-bit or 32-bit calculations.
Library Routines
- CRC32_setSeed
- CRC32_set8BitData
- CRC32_set16BitData
- CRC32_set32BitData
- CRC32_set8BitDataReversed
- CRC32_set16BitDataReversed
- CRC32_set32BitDataReversed
- CRC32_getResult
- CRC32_getResultReversed
CRC32_setSeed
Prototype |
void CRC32_setSeed(uint32_t seed, uint_fast8_t crcType); |
||||||
---|---|---|---|---|---|---|---|
Description |
This function sets the seed for the CRC to begin generating a signature with the given seed and all passed data. Using this function resets the CRC32 signature. |
||||||
Parameters |
|
||||||
Returns |
Nothing. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
CRC32_set8BitData
Prototype |
void CRC32_set8BitData(uint8_t dataIn, uint_fast8_t crcType); |
||||||
---|---|---|---|---|---|---|---|
Description |
This function sets the 8 Bit data to add into the CRC module to generate a new signature.
|
||||||
Parameters |
|
||||||
Returns |
Nothing. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
CRC32_set16BitData
Prototype |
void CRC32_set16BitData(uint16_t dataIn, uint_fast8_t crcType); |
||||||
---|---|---|---|---|---|---|---|
Description |
This function sets the 16 Bit data to add into the CRC module to generate a new signature.
|
||||||
Parameters |
|
||||||
Returns |
Nothing. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
CRC32_set32BitData
Prototype |
void CRC32_set32BitData(uint32_t dataIn); |
---|---|
Description |
This function sets the 32 Bit data to add into the CRC module to generate a new signature.
|
Parameters |
|
Returns |
Nothing. |
Requires |
Nothing. |
Notes |
Available only for MSP432 devices. |
CRC32_set8BitDataReversed
Prototype |
void CRC32_set8BitDataReversed(int8_t dataIn, uint_fast8_t crcType); |
||||||
---|---|---|---|---|---|---|---|
Description |
Translates the data by reversing the bits in each 8 bit data and then sets this data to add into the CRC module to generate a new signature.
|
||||||
Parameters |
|
||||||
Returns |
Nothing. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
CRC32_set16BitDataReversed
Prototype |
void CRC32_set16BitDataReversed(int16_t dataIn, uint_fast8_t crcType); |
||||||
---|---|---|---|---|---|---|---|
Description |
Translates the data by reversing the bits in each 16 bit data and then sets this data to add into the CRC module to generate a new signature.
|
||||||
Parameters |
|
||||||
Returns |
Nothing. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
CRC32_set32BitDataReversed
Prototype |
void CRC32_set32BitDataReversed(uint32_t dataIn); |
||||||
---|---|---|---|---|---|---|---|
Description |
Translates the data by reversing the bits in each 32 bit data and then sets this data to add into the CRC module to generate a new signature.
|
||||||
Parameters |
|
||||||
Returns |
Nothing. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
CRC32_getResult
Prototype |
uint32_t CRC32_getResult(uint_fast8_t crcType); |
||||||
---|---|---|---|---|---|---|---|
Description |
This function returns the value of the signature result generated by the CRC. Bit 0 is treated as LSB. |
||||||
Parameters |
|
||||||
Returns |
Returns the value of CRC Signature Result. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
CRC32_getResultReversed
Prototype |
uint32_t CRC32_getResultReversed(uint_fast8_t crcType); |
||||||
---|---|---|---|---|---|---|---|
Description |
This function returns the bit-wise reversed format of the Signature Result. Bit 0 is treated as MSB. |
||||||
Parameters |
|
||||||
Returns |
Returns the bit-wise reversed format of the 32 bit Signature Result.. |
||||||
Requires |
Nothing. |
||||||
Notes |
Available only for MSP432 devices. |
What do you think about this topic ? Send us feedback!