|
rcbench
Servo and ESC test bench: panel, IOmcu and shared C
|
The PD mini's codec: the CRC8 (cyclic redundancy check, 8 bits) of a frame and the framing of a reply. More...
#include "pdmini.h"Functions | |
| uint8_t | pdmini_crc8 (const uint8_t *p, size_t n) |
CRC8, polynomial 0x31, initial 0xFF, over n bytes. | |
| static size_t | fixed_len (uint8_t cmd) |
| A fixed-length reply's whole length, or 0 for one that is not. | |
| pdmini_frame_t | pdmini_reply_frame (uint8_t cmd, const uint8_t *buf, size_t n) |
Checks the bytes received so far against a reply to cmd. | |
The PD mini's codec: the CRC8 (cyclic redundancy check, 8 bits) of a frame and the framing of a reply.
See pdmini.h.
SPDX-License-Identifier: MIT
|
static |
A fixed-length reply's whole length, or 0 for one that is not.
| cmd | Command byte the reply answers. |
| uint8_t pdmini_crc8 | ( | const uint8_t * | p, |
| size_t | n ) |
CRC8, polynomial 0x31, initial 0xFF, over n bytes.
| p | Bytes to check. |
| n | Number of bytes in p. |
| pdmini_frame_t pdmini_reply_frame | ( | uint8_t | cmd, |
| const uint8_t * | buf, | ||
| size_t | n ) |
Checks the bytes received so far against a reply to cmd.
| cmd | Command byte the reply answers. |
| buf | Bytes received so far. |
| n | Number of bytes in buf. |