refactor: merge protocol cores as SETProtocol

This commit is contained in:
2026-09-01 09:58:09 +03:00
parent 5504104cc5
commit 19becd7b8c
56 changed files with 1256 additions and 359 deletions

View File

@@ -0,0 +1,28 @@
/**
* @file pcan_crc.h
* @brief CRC-16/CCITT-FALSE: poly 0x1021, init 0xFFFF, без рефлексии,
* без финального XOR. Контрольное значение для "123456789" - 0x29B1.
*/
#ifndef PCAN_CRC_H
#define PCAN_CRC_H
#include <stddef.h>
#include <stdint.h>
#include "pcan_config.h"
#ifdef __cplusplus
extern "C" {
#endif
/** Начальное значение для инкрементального расчёта. */
#define PCAN_CRC_INIT 0xFFFFU
uint16_t pcan_crc16_update(uint16_t crc, uint8_t byte);
uint16_t pcan_crc16(const uint8_t *data, size_t len);
#ifdef __cplusplus
}
#endif
#endif /* PCAN_CRC_H */