48 const uint8_t *buf =
reinterpret_cast<const uint8_t *
> (&
value);
49 size_t len =
sizeof (T);
51 m_ucCrc = CrcIButtonUpdate (m_ucCrc, *buf++);
63 static inline uint8_t CrcIButtonUpdate (uint8_t crc, uint8_t data) {
67 for (i = 0; i < 8; i++) {
69 crc = (crc >> 1) ^ 0x8C;
iButton CRC template class
void update(const T &value)
Update CRC with a T value.
static const uint8_t InitValue
Initial value of CRC.
CrcIButton()
Construct a new Crc I Button object.
void reset()
Reset CRC value.
uint8_t value() const
Get the value of CRC.