COSA
An Object-Oriented Platform for Arduino Programming
|
#include <HammingCodec_7_4.hh>
Public Member Functions | |
HammingCodec_7_4 () | |
virtual const uint8_t * | preamble () |
virtual uint8_t | encode4 (uint8_t nibble) |
virtual uint8_t | decode4 (uint8_t symbol) |
virtual uint8_t | decode8 (uint16_t symbol) |
Public Attributes | |
const uint8_t | BITS_PER_SYMBOL |
const uint16_t | START_SYMBOL |
const uint8_t | PREAMBLE_MAX |
const uint8_t | SYMBOL_MASK |
const uint16_t | BITS_MSB |
Hamming(7,4) Codec for the Cosa VWI (Virtual Wire Interface). This is a linear error-correcting code that encodes 4 bits of data into 7 bits by adding 3 parity bits. Hamming's (7,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).
Definition at line 38 of file HammingCodec_7_4.hh.
|
inline |
Construct Hamming(7,4) codec with given bits per symbol, start symbol, and preamble size.
Definition at line 44 of file HammingCodec_7_4.hh.
|
inlinevirtual |
Returns 4-bit data for given symbol.
[in] | symbol | code. |
Implements VWI::Codec.
Definition at line 76 of file HammingCodec_7_4.hh.
|
inlinevirtualinherited |
|
inlinevirtual |
Returns symbol for given 4-bit data.
[in] | nibble | data. |
Implements VWI::Codec.
Definition at line 65 of file HammingCodec_7_4.hh.
|
inlinevirtual |
Returns pointer to Hamming frame preamble in program memory.
Implements VWI::Codec.
Definition at line 54 of file HammingCodec_7_4.hh.
|
inherited |
|
inherited |
|
inherited |