ahoy/tools/esp8266/crc.h
lumapu 6ed2dfde9c * fix EPS32 GPIO names #286
* fix negative temperature  (OpenDTU issue 246)
* added plausibility check based on payload length
* prepared project for splitting into library and end-user-esp
* added donation link to index.html
* deactivated disclaimer temporarily
2022-10-21 16:44:04 +02:00

21 lines
632 B
C++

//-----------------------------------------------------------------------------
// 2022 Ahoy, https://github.com/lumpapu/ahoy
// Creative Commons - http://creativecommons.org/licenses/by-nc-sa/3.0/de/
//-----------------------------------------------------------------------------
#ifndef __CRC_H__
#define __CRC_H__
#include <cstdint>
#include "Arduino.h"
#define CRC8_INIT 0x00
#define CRC8_POLY 0x01
#define CRC16_MODBUS_POLYNOM 0xA001
namespace ah {
uint8_t crc8(uint8_t buf[], uint8_t len);
uint16_t crc16(uint8_t buf[], uint8_t len, uint16_t start = 0xffff);
}
#endif /*__CRC_H__*/