COSA
An Object-Oriented Platform for Arduino Programming
ManchesterCodec.hh
Go to the documentation of this file.
1 
21 #ifndef COSA_MANCHESTERCODEC_HH
22 #define COSA_MANCHESTERCODEC_HH
23 
24 #include <VWI.h>
25 
30 class ManchesterCodec : public VWI::Codec {
31 public:
37  VWI::Codec(8, 0x5d55, 8)
38  {
39  }
40 
46  virtual const uint8_t* preamble()
47  {
48  return (s_preamble);
49  }
50 
57  virtual uint8_t encode4(uint8_t nibble)
58  {
59  return (pgm_read_byte(&s_symbols[nibble & 0xf]));
60  };
61 
68  virtual uint8_t decode4(uint8_t symbol);
69 
70 private:
72  static const uint8_t s_symbols[] PROGMEM;
73 
75  static const uint8_t s_preamble[] PROGMEM;
76 };
77 
78 #endif
Definition: VWI.hh:64
virtual const uint8_t * preamble()
virtual uint8_t encode4(uint8_t nibble)
Codec(uint8_t bits_per_symbol, uint16_t start_symbol, uint8_t preamble_max=VWI::Transmitter::PREAMBLE_MAX)
Definition: VWI.cpp:59
virtual uint8_t decode4(uint8_t symbol)