Bitstream Interpretation Library (BIL)
0.1
|
A register for doing cyclic redundancy checks. More...
#include <packetprocessor/V5CRCRegister.hpp>
Public Member Functions | |
V5CRCRegister () | |
Constructs a V5CRCRegister instance. | |
virtual void | write (const boost::uint32_t *words, size_t wordCount) |
When writing a word, a CRC check will be issued (by calling check()). | |
virtual void | read (boost::uint32_t *words, size_t wordCount) const |
When reading a word, the current CRC value will be returned. | |
boost::uint32_t | crcValue () const |
Gets the current CRC value. | |
void | reset () |
Resets the CRC register value to 0. | |
void | update (const boost::uint32_t *words, size_t wordCount, RegisterAddress::address_t registerAddress) |
Updates the CRC value based on given data and register address. | |
void | check () const |
Checks if CRC was successful, i.e. CRC value is 0 again. | |
Public Member Functions inherited from bil::Register | |
Register (RegisterAddress::address_t address, const std::string &name, bool writable=true, bool readable=true) | |
Constructs a Register instance. | |
virtual | ~Register ()=0 |
Destructs a Register instance. | |
RegisterAddress::address_t | address () const |
Gets register address. | |
const std::string & | name () const |
Gets register name. | |
bool | writable () const |
Tells if register is writable. | |
bool | readable () const |
Tells if register is readable. |
A register for doing cyclic redundancy checks.
The CRC register is an one word write- and readable register. Writes will trigger a check of its register value. Reads will return the current CRC value. The actual updating of the CRC values must be done from outside per update().
Definition at line 23 of file V5CRCRegister.hpp.
V5CRCRegister::V5CRCRegister | ( | ) |
Constructs a V5CRCRegister instance.
Definition at line 14 of file V5CRCRegister.cpp.
|
virtual |
When writing a word, a CRC check will be issued (by calling check()).
words | Pointer to data words to write. |
wordCount | Number of data words to write. |
. |
Reimplemented from bil::Register.
Definition at line 21 of file V5CRCRegister.cpp.
|
virtual |
When reading a word, the current CRC value will be returned.
words | Pointer to data buffer. |
wordCount | Number of data words to read. |
. |
Reimplemented from bil::Register.
Definition at line 33 of file V5CRCRegister.cpp.
boost::uint32_t V5CRCRegister::crcValue | ( | ) | const |
void V5CRCRegister::reset | ( | ) |
Resets the CRC register value to 0.
Definition at line 50 of file V5CRCRegister.cpp.
void V5CRCRegister::update | ( | const boost::uint32_t * | words, |
size_t | wordCount, | ||
RegisterAddress::address_t | registerAddress | ||
) |
Updates the CRC value based on given data and register address.
words | Pointer to data words. |
wordCount | Number of data words. |
registerAddress | Target register of data words. |
Definition at line 56 of file V5CRCRegister.cpp.
void V5CRCRegister::check | ( | ) | const |
Checks if CRC was successful, i.e. CRC value is 0 again.
. |
Definition at line 73 of file V5CRCRegister.cpp.