COSA
An Object-Oriented Platform for Arduino Programming
BitstuffingCodec Class Reference

#include <BitstuffingCodec.hh>

Inheritance diagram for BitstuffingCodec:
Inheritance graph
Collaboration diagram for BitstuffingCodec:
Collaboration graph

Public Member Functions

 BitstuffingCodec ()
 
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
 

Detailed Description

Fixed bitstuffing 4 to 5 bit codec for the Cosa VWI (Virtual Wire Interface).

Definition at line 30 of file BitstuffingCodec.hh.

Constructor & Destructor Documentation

BitstuffingCodec::BitstuffingCodec ( )
inline

Construct fixed bitstuffing codec with given bits per symbol, start symbol, and preamble size.

Definition at line 36 of file BitstuffingCodec.hh.

Member Function Documentation

virtual uint8_t BitstuffingCodec::decode4 ( uint8_t  symbol)
inlinevirtual

Returns 4-bit data for given fixed bitstuffed symbol.

Parameters
[in]symbolto decode.
Returns
4-bit data.

Implements VWI::Codec.

Definition at line 69 of file BitstuffingCodec.hh.

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
[in]symbolto decode.
Returns
data.

Definition at line 136 of file VWI.hh.

virtual uint8_t BitstuffingCodec::encode4 ( uint8_t  nibble)
inlinevirtual

Returns fixed bitstuffed symbol for given 4-bit data.

Parameters
[in]nibbleto encode.
Returns
5-bit bitstuffed code.

Implements VWI::Codec.

Definition at line 58 of file BitstuffingCodec.hh.

virtual const uint8_t* BitstuffingCodec::preamble ( )
inlinevirtual

Returns pointer to Cosa fixed bitstuffing frame preamble in program memory.

Returns
pointer.

Implements VWI::Codec.

Definition at line 47 of file BitstuffingCodec.hh.

Member Data Documentation

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 file: