48 lines
866 B
Arduino
Raw Normal View History

2023-08-01 17:27:01 +02:00
//
// FILE: CRC_test.ino
// AUTHOR: Rob Tillaart
// PURPOSE: demo
// DATE: 2020
// (c) : MIT
//
2021-01-29 12:31:58 +01:00
#include "CRC.h"
#include "printHelpers.h" // for the 64 bit...
char str[24] = "123456789";
2021-12-14 20:22:40 +01:00
2021-01-29 12:31:58 +01:00
void setup()
{
Serial.begin(115200);
Serial.println(__FILE__);
uint8_t * data = (uint8_t *) &str[0];
2022-01-28 14:56:11 +01:00
Serial.println("Verified with - https://crccalc.com/ \n");
2021-01-29 12:31:58 +01:00
2023-08-01 17:27:01 +02:00
// use default parameters for calcCRCxx()
2021-01-29 12:31:58 +01:00
Serial.print("TEST:\t");
Serial.println(str);
Serial.print("CRC8:\t");
2023-07-13 11:08:10 +02:00
Serial.println(calcCRC8(data, 9), HEX);
2021-01-29 12:31:58 +01:00
Serial.print("CRC16:\t");
2023-07-13 11:08:10 +02:00
Serial.println(calcCRC16(data, 9), HEX);
2021-01-29 12:31:58 +01:00
Serial.print("CRC32:\t");
2023-07-13 11:08:10 +02:00
Serial.println(calcCRC32(data, 9), HEX);
2021-01-29 12:31:58 +01:00
// Serial.print("*CRC64:\t");
2023-07-13 11:08:10 +02:00
// uint64_t t = calcCRC64(data, 9);
2021-01-29 12:31:58 +01:00
// Serial.println(print64(t, HEX));
Serial.println("\n\nDone...");
}
2021-12-14 20:22:40 +01:00
2021-01-29 12:31:58 +01:00
void loop()
{
2023-08-01 17:27:01 +02:00
}
// -- END OF FILE --