|
ICARUS OS (Intelligent Cooperative Architecture for Real-time Unified Systems) 0.1.0
Preemptive Real-Time Operating System for ARM Cortex-M7
|
CRC16-CCITT helper for the ICARUS OS kernel. More...
#include <stdint.h>Go to the source code of this file.
Functions | |
| uint16_t | crc16_ccitt (const uint8_t *data, uint16_t len) |
| Compute CRC16-CCITT (poly 0x1021, init 0xFFFF) over a byte buffer. | |
CRC16-CCITT helper for the ICARUS OS kernel.
Polynomial 0x1021, initial value 0xFFFF, no reflection, no final XOR. Suitable for CCSDS Space Packet integrity checks and small flash record protection.
On STM32H7 target, backed by the on-chip CRC peripheral (AHB4 bus, configurable polynomial), lazy-initialised on the first call. Under HOST_TEST a portable bytewise loop is used so unit tests run unchanged off-target.
Thread-safe: each call wraps a critical section because the CRC peripheral has internal state.
Definition in file crc.h.
| uint16_t crc16_ccitt | ( | const uint8_t * | data, |
| uint16_t | len | ||
| ) |
Compute CRC16-CCITT (poly 0x1021, init 0xFFFF) over a byte buffer.
| data | Buffer to checksum (may be NULL only if len is 0). |
| len | Number of bytes in data. |
Definition at line 66 of file crc.c.
References __enter_critical(), __exit_critical(), crc_hw_init(), and crc_initialised.
Referenced by __cs_add_region(), __cs_check_all(), __cs_rebaseline(), __tbl_activate_prepare(), __tbl_load(), and cs_selftest().