Real-Time Data Monitor (RTDM) Cumulative CRC16 Function
RTDM_CumulativeCrc16()
Description
This function calculates the polynomial for the checksum byte.
There are two approaches to calculating this number:
- “On-the-fly” every time saves code space because no const table is required. This approach saves code space but yields slower throughput performance.
- Use a coefficients table. This approach has faster performance but consumes a higher amount of program memory.
Include
RTDM.h
RTDMUSER.h
Prototype
unsigned int RTDM_CumulativeCrc16 (unsigned char *buf,
unsigned int u16Length,
unsigned int u16CRC );
Arguments
unsigned char *buf | A pointer to the state memory for the data to be used on the checksum calculation |
unsigned int u16Length | Number of bytes to be computed |
unsigned int u16CRC | Polynomial value used to calculate the CRC16 checksum |
Return Value
CRC16 checksum value