Files
templates/c/set-protocol/include/set_crc.h

26 lines
767 B
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* Общие контрольные суммы исторических протоколов SET. Алгоритмы с разными полиномами,
* начальными значениями и отражением битов не взаимозаменяемы, даже если возвращают одинаковый
* по ширине целый тип.
*/
/** @file set_crc.h @brief Shared checksums used by legacy SET controllers. */
#ifndef SET_CRC_H
#define SET_CRC_H
#include <stddef.h>
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/** CRC-16/Modbus: reflected polynomial 0xA001, initial value 0xFFFF. */
uint16_t set_crc16_modbus(const uint8_t *data, size_t size);
#ifdef __cplusplus
}
#endif
#endif /* SET_CRC_H */