DUNE: Uniform Navigational Environment  2019.02.1
DUNE::Algorithms::CRC8 Class Reference

Detailed Description

Generic computation of 8-bit CRCs.

Public Member Functions

 CRC8 (uint8_t polynomial, uint8_t value=0)
 
void set (uint8_t value=0)
 
uint8_t get (void) const
 
uint8_t putByte (uint8_t byte)
 
uint8_t putArray (const uint8_t *data, unsigned int data_size)
 

Constructor & Destructor Documentation

DUNE::Algorithms::CRC8::CRC8 ( uint8_t  polynomial,
uint8_t  value = 0 
)
inline

Constructor.

Parameters
[in]polynomialpolynomial.
[in]valueinitial CRC8 value.

Member Function Documentation

uint8_t DUNE::Algorithms::CRC8::get ( void  ) const
inline

Retrieve the current CRC8 value.

Returns
current CRC8 value.

Referenced by DUNE::Hardware::UCTK::Bootloader::program().

uint8_t DUNE::Algorithms::CRC8::putArray ( const uint8_t *  data,
unsigned int  data_size 
)
inline

Compute the CRC8 of an array of bytes.

Parameters
[in]dataarray of bytes.
[in]data_sizesize of array.
Returns
current CRC8 value.

References putByte().

Referenced by DUNE::Hardware::UCTK::Bootloader::program().

uint8_t DUNE::Algorithms::CRC8::putByte ( uint8_t  byte)
inline

Compute the CRC8 of one byte.

Parameters
[in]bytebyte.
Returns
current CRC8 value.

Referenced by putArray().

void DUNE::Algorithms::CRC8::set ( uint8_t  value = 0)
inline

Set the current CRC8 value.

Parameters
[in]valuecurrent CRC8 value.
Collaboration diagram for DUNE::Algorithms::CRC8:
Collaboration graph