26 lines
480 B
C
26 lines
480 B
C
//
|
|
// Created by 79513 on 13.06.2023.
|
|
//
|
|
|
|
#ifndef CRC16_CCITT_H_
|
|
#define CRC16_CCITT_H_
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
typedef uint16_t CRC_t;
|
|
|
|
typedef struct {
|
|
const CRC_t* CRC_TAB;
|
|
CRC_t crc;
|
|
int size;
|
|
} CRC16_CCITT;
|
|
|
|
void crc_init(CRC16_CCITT* crc_obj);
|
|
void crc_update(CRC16_CCITT* crc_obj, uint8_t data);
|
|
bool crc_good(const CRC16_CCITT* crc_obj);
|
|
void crc_final(CRC16_CCITT* crc_obj);
|
|
uint8_t crc_get(const CRC16_CCITT* crc_obj, int8_t pos);
|
|
|
|
#endif
|