1 /*
2 * Copyright (c) 2025 Renesas Electronics Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7 #include <zephyr/logging/log.h>
8 LOG_MODULE_REGISTER(subsys_crc_example, CONFIG_LOG_DEFAULT_LEVEL);
9
10 #include <zephyr/sys/crc.h>
11
main(void)12 int main(void)
13 {
14 uint32_t result;
15 uint8_t data[8] = {0x0A, 0x2B, 0x4C, 0x6D, 0x8E, 0x49, 0x00, 0xC4};
16
17 /* CRC computation */
18 result = crc32_ieee(data, sizeof(data));
19 LOG_INF("Result of CRC32 IEEE: 0x%08X", result);
20
21 /* CRC computation */
22 result = (uint8_t)crc8_ccitt(0xFF, data, sizeof(data));
23 LOG_INF("Result of CRC8 CCITT: 0x%02X", result & 0xFF);
24
25 LOG_INF("CRC computation completed successfully");
26
27 return 0;
28 }
29