GY-63_MS5611/libraries/Fletcher/Fletcher64.h

40 lines
649 B
C
Raw Normal View History

2022-01-27 04:11:25 -05:00
#pragma once
//
// FILE: Fletcher64.h
// AUTHOR: Rob Tillaart
// PURPOSE: Arduino class for Fletcher64
// URL: https://github.com/RobTillaart/Fletcher
#include "Arduino.h"
class Fletcher64
{
public:
Fletcher64();
// set parameters to default
void begin(uint32_t s1 = 0, uint32_t s2 = 0);
void add(uint32_t value);
void add(const uint32_t * array, uint16_t length);
2022-09-13 10:31:43 -04:00
uint64_t getFletcher();
uint32_t count();
2022-01-27 04:11:25 -05:00
private:
2022-09-13 10:31:43 -04:00
#if defined(ARDUINO_ARCH_AVR) || defined(ESP32) || defined(ESP8266)
uint32_t _s1;
uint32_t _s2;
#else
2022-01-27 04:11:25 -05:00
uint64_t _s1;
uint64_t _s2;
2022-09-13 10:31:43 -04:00
#endif
2022-01-27 04:11:25 -05:00
uint32_t _count;
};
// -- END OF FILE --