#include <HammingCodec_8_4.hh>
Hamming(8,4) Codec for the Cosa VWI (Virtual Wire Interface). This is a linear error-correcting code that encodes 4 bits of data into 8 bits by adding 4 parity bits. Hamming's (8,4) algorithm can correct any single-bit error, or detect all single-bit and two-bit errors. This implementation uses inverted parity bits to improve DC balance in transmission (e.g. avoid coding long sequences of zero or one).
References
- http://en.wikipedia.org/wiki/Hamming_code#.5B7.2C4.5D_Hamming_code_with_an_additional_parity_bit
Definition at line 38 of file HammingCodec_8_4.hh.
HammingCodec_8_4::HammingCodec_8_4 |
( |
| ) |
|
|
inline |
Construct Hamming(8,4) codec with given bits per symbol, start symbol, and preamble size.
Definition at line 44 of file HammingCodec_8_4.hh.
virtual uint8_t HammingCodec_8_4::decode4 |
( |
uint8_t |
symbol | ) |
|
|
inlinevirtual |
virtual uint8_t VWI::Codec::decode8 |
( |
uint16_t |
symbol | ) |
|
|
inlinevirtualinherited |
Decode two packed symbols (max 16-bit) back to 8 bits (byte) of data.
- Parameters
-
- Returns
- data.
Definition at line 136 of file VWI.hh.
virtual uint8_t HammingCodec_8_4::encode4 |
( |
uint8_t |
nibble | ) |
|
|
inlinevirtual |
virtual const uint8_t* HammingCodec_8_4::preamble |
( |
| ) |
|
|
inlinevirtual |
const uint16_t VWI::Codec::BITS_MSB |
|
inherited |
Symbol MSB.
Definition at line 91 of file VWI.hh.
const uint8_t VWI::Codec::BITS_PER_SYMBOL |
|
inherited |
Bits per symbol.
Definition at line 76 of file VWI.hh.
const uint8_t VWI::Codec::PREAMBLE_MAX |
|
inherited |
Size of preamble with start symbol. Should be less or equal to Transmitter::PREAMBLE_MAX.
Definition at line 85 of file VWI.hh.
const uint16_t VWI::Codec::START_SYMBOL |
|
inherited |
Start symbol.
Definition at line 79 of file VWI.hh.
const uint8_t VWI::Codec::SYMBOL_MASK |
|
inherited |
Symbol mask.
Definition at line 88 of file VWI.hh.
The documentation for this class was generated from the following files: