summaryrefslogtreecommitdiff
path: root/daemon/stm32crc.h
diff options
context:
space:
mode:
Diffstat (limited to 'daemon/stm32crc.h')
-rw-r--r--daemon/stm32crc.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/daemon/stm32crc.h b/daemon/stm32crc.h
new file mode 100644
index 0000000..1361de3
--- /dev/null
+++ b/daemon/stm32crc.h
@@ -0,0 +1,24 @@
+#ifndef STM32CRC_H
+#define STM32CRC_H
+
+#include <QByteArray>
+
+class Stm32Crc
+{
+public:
+ Stm32Crc();
+
+ void reset();
+
+ // Data size must be multiple of 4, data must be aligned to 4.
+
+ void addData(const char *data, int length);
+ void addData(const QByteArray &data);
+
+ quint32 result() const;
+
+private:
+ quint32 crc;
+};
+
+#endif // STM32CRC_H