1 | /*
|
2 | * crc16.h
|
3 | *
|
4 | * Created: 19.11.2016 09:24:38
|
5 | * Author: Admin
|
6 | */
|
7 |
|
8 |
|
9 | #ifndef CRC16_H_
|
10 | #define CRC16_H_
|
11 |
|
12 | #include <stdbool.h>
|
13 |
|
14 | #define CRC16_POLYNOM 0x1002
|
15 | #define CRC_HI 1
|
16 | #define CRC_LO 0
|
17 |
|
18 |
|
19 | typedef union{
|
20 | unsigned int iCRC16;
|
21 | unsigned char cCRC16[2];
|
22 | }uCRC16_t;
|
23 |
|
24 | extern unsigned int crc16; // kommt später da weg!!!!!
|
25 |
|
26 | void InitCRC(void);
|
27 | unsigned int CalcCRC(unsigned char data);
|
28 | uCRC16_t CalcCRCBuffer(unsigned char *data, unsigned int length);
|
29 | bool CheckCRC(unsigned char *data, unsigned int length);
|
30 |
|
31 |
|
32 |
|
33 | #endif /* CRC16_H_ */
|