rcbench
Servo and ESC test bench: panel, IOmcu and shared C
Toggle main menu visibility
Loading...
Searching...
No Matches
link_crc.h
Go to the documentation of this file.
1
16
#ifndef RCBENCH_LINK_CRC_H
17
#define RCBENCH_LINK_CRC_H
18
19
#include <stddef.h>
20
#include <stdint.h>
21
22
#ifdef __cplusplus
23
extern
"C"
{
24
#endif
25
27
#define LINK_CRC_INIT 0xFFFFu
28
32
#define LINK_CRC_CHECK 0x29B1u
33
46
uint16_t
link_crc
(uint16_t crc,
const
void
*data,
size_t
len);
47
51
#define LINK_FNV_INIT 0x811C9DC5uL
52
57
#define LINK_FNV_CHECK 0xBB86B11CuL
58
71
uint32_t
link_fnv1a32
(uint32_t hash,
const
void
*data,
size_t
len);
72
73
#ifdef __cplusplus
74
}
75
#endif
76
77
#endif
/* RCBENCH_LINK_CRC_H */
link_fnv1a32
uint32_t link_fnv1a32(uint32_t hash, const void *data, size_t len)
FNV-1a, 32 bits: per byte, XOR then multiply by 16777619.
Definition
link_crc.c:30
link_crc
uint16_t link_crc(uint16_t crc, const void *data, size_t len)
Fold len bytes into crc and return the new accumulator.
Definition
link_crc.c:16
shared
link
include
link_crc.h
Generated by
1.18.0