WIRELESS CONNECTIVITY & SENSORS
User manual Proteus-III
A. Additional CRC8 Information
This Annex gives an example CRC8 implementation and test vectors.
A.1. Example CRC8 Implementation
#include <stdint.h>
uint8_t Get_CRC8(uint8_t * bufP, uint16_t len)
{
uint8_t crc = 0x00;
for (uint16_t i = 0; i < len; i ++)
{
crc ^= bufP[i ];
}
return crc;
}
A.2. CRC8 Test Vectors
Input data
Null
0x02 0x01 0x00 0x00
0x02 0x87 0x01 0x00 0x16
0x02 0x04 0x04 0x00 0x41 0x42 0x43 0x44
0x02 0x88 0x07 0x00 0x00 0x55 0x00 0x00 0xDA 0x18 0x00
Order code 2611011024000
Version 1.8 , July 2022
Code 1: Example CRC8 Implementation
Table 86: CRC8 Test Vectors
Data length
Resulting CRC8
0
0x00
4
0x03
5
0x92
8
0x06
11
0x1A
www.we-online.com/wcs
240