Added crc files

This commit is contained in:
Jan Mrna
2022-06-12 22:25:57 +02:00
commit 5fc3f95ee0
2 changed files with 53 additions and 0 deletions

22
crc8.h Normal file
View File

@@ -0,0 +1,22 @@
/*
* crc.h
*
* Created on: Jun 9, 2021
* Author: user
*/
#ifndef INC_CRC8_H_
#define INC_CRC8_H_
#include "stdint.h"
/*
* Definitions & macros
*/
#define CRC8_POLYNOMIAL ((uint8_t)0x31)
#define CRC8_INIT ((uint8_t)0xFF)
uint8_t crc8_calculate(const uint8_t *data, uint16_t count);
#endif /* INC_CRC8_H_ */