Main Page | Modules | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Examples

Table-driven Manchester encoding and decoding
[Libraries]


Detailed Description

Manchester encoding is a bit encoding scheme which translates each bit into two bits: the original bit and the inverted bit.

Manchester encoding is used for transmitting ones and zeroes between two computers. The Manchester encoding reduces the receive oscillator drift by making sure that no consecutive ones or zeroes are ever transmitted.

The table driven method of Manchester encoding and decoding uses two tables with 256 entries. One table is a direct mapping of an 8-bit byte into a 16-bit Manchester encoding of the byte. The second table is a mapping of a Manchester encoded 8-bit byte to 4 decoded bits.


Files

file  me.h
 Header file for the table-driven Manchester encoding and decoding.
file  me.c
 Implementation of the table-driven Manchester encoding and decoding.

Functions

unsigned char me_valid (unsigned char m)
 Check if an encoded byte is valid.
unsigned short me_encode (unsigned char c)
 Manchester encode an 8-bit byte.
unsigned char me_decode16 (unsigned short m)
 Decode a Manchester encoded 16-bit word.
unsigned char me_decode8 (unsigned char m)
 Decode a Manchester encoded 8-bit byte.


Function Documentation

unsigned char me_decode16 unsigned short  m  ) 
 

Decode a Manchester encoded 16-bit word.

This function decodes a Manchester encoded 16-bit word into a 8-bit byte. The function does not check for parity errors in the encoded byte.

Parameters:
m The 16-bit Manchester encoded word
Returns:
The decoded 8-bit byte

Definition at line 76 of file me.c.

unsigned char me_decode8 unsigned char  m  ) 
 

Decode a Manchester encoded 8-bit byte.

This function decodes a Manchester encoded 8-bit byte into 4 decoded bits.. The function does not check for parity errors in the encoded byte.

Parameters:
m The 8-bit Manchester encoded byte
Returns:
The decoded 4 bits

Definition at line 100 of file me.c.

Referenced by PT_THREAD().

unsigned short me_encode unsigned char  c  ) 
 

Manchester encode an 8-bit byte.

This function Manchester encodes an 8-bit byte into a 16-bit word. The function me_decode() does the inverse operation.

Parameters:
c The byte to be encoded
Return values:
The encoded word.

Definition at line 59 of file me.c.


Generated on Thu Jun 22 17:45:43 2006 for Contiki 2.x by  doxygen 1.4.4