COSA
An Object-Oriented Platform for Arduino Programming
|
#include <VWI.hh>
Public Member Functions | |
Codec (uint8_t bits_per_symbol, uint16_t start_symbol, uint8_t preamble_max=VWI::Transmitter::PREAMBLE_MAX) | |
virtual const uint8_t * | preamble ()=0 |
virtual uint8_t | encode4 (uint8_t nibble)=0 |
virtual uint8_t | decode4 (uint8_t symbol)=0 |
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 |
The Virtual Wire Codec; define message preamble and start symbol. Supports encode and decoding of data to transmission symbols. Cosa support several transmission codecs. They may be used to optimize performance in a given scenario; speed, noise, message length, etc.
VWI::Codec::Codec | ( | uint8_t | bits_per_symbol, |
uint16_t | start_symbol, | ||
uint8_t | preamble_max = VWI::Transmitter::PREAMBLE_MAX |
||
) |
|
pure virtual |
Decode symbol back to 4 bits (nibble) of data.
[in] | symbol | to decode. |
Implemented in HammingCodec_7_4, HammingCodec_8_4, BitstuffingCodec, Block4B5BCodec, ManchesterCodec, and VirtualWireCodec.
|
inlinevirtual |
|
pure virtual |
Encode 4 bits (nibble) to a symbol with BITS_PER_SYMBOL.
[in] | nibble | data to encode. |
Implemented in HammingCodec_7_4, HammingCodec_8_4, BitstuffingCodec, Block4B5BCodec, ManchesterCodec, and VirtualWireCodec.
|
pure virtual |
Provide pointer to frame preamble in program memory. PREAMBLE_MAX should contain the length of the preamble including start symbol.
Implemented in HammingCodec_7_4, HammingCodec_8_4, BitstuffingCodec, VirtualWireCodec, Block4B5BCodec, and ManchesterCodec.
const uint8_t VWI::Codec::PREAMBLE_MAX |