
SP37
Tire Pressure Monitoring Sensor
ROM Library Functions
ROM Library Function Guide
93
Revision 1.0, 2011-12-15
2.24
CRC8_Calc()
2.24.1
Description
This function calculates the CRC-8 checksum for a memory area in RAM using a fixed polynomial (x
8
+x
2
+x+1).
The CRC-8 calculation starts with a defined preload value.
2.24.2
Actions
•
Calculate CRC-8
2.24.3
Prototype
unsigned char
CRC8_Calc
(unsigned char
Preload
, unsigned char idata *
BlockStart
, unsigned char
BlockLength
)
2.24.4
Inputs
2.24.5
Outputs
Table 105
CRC8_Calc: Input Parameters
Register / Address
Type
Name
Description
R7
unsigned char Preload
Preload Value for the CRC Calculation.
According to CCITT a value FF
H
is
recommended.
R5
unsigned char
idata*
BlockStart
Pointer to first Byte of the Data that is to be used
for calculating checksum
R3
unsigned char BlockLength
Length in Bytes of Block that is used for
calculation of the checksum, starting with
*BlockStart.
Table 106
CRC8_Calc: Output values
Register/ Address
Type
Name
Description
R7
unsigned char CRC_Result
Calculated CRC8 checksum