Microchip® Advanced Software Framework

gcr.c File Reference

    Implementation of GCR coding/decoding
Author
Joakim Eriksson joaki.nosp@m.me@s.nosp@m.ics.s.nosp@m.e
#include "gcr.h"

Functions

void gcr_decode (unsigned char gcr_data)
 
void gcr_encode (unsigned char raw_data)
 
unsigned char gcr_finished (void)
 
unsigned char gcr_get_decoded (unsigned char *raw_data)
 
unsigned char gcr_get_encoded (unsigned char *raw_data)
 
void gcr_init (void)
 
unsigned char gcr_valid (void)
 

Variables

static unsigned char gcr_bits = 0
 
static const unsigned char GCR_decode [32]
 
static const unsigned char GCR_encode [16]
 
static unsigned short gcr_val = 0
 

void gcr_decode ( unsigned char  gcr_data)

References gcr_bits, and gcr_val.

void gcr_encode ( unsigned char  raw_data)

References gcr_bits, GCR_encode, and gcr_val.

unsigned char gcr_finished ( void  )

References gcr_bits.

unsigned char gcr_get_decoded ( unsigned char *  raw_data)

References gcr_bits, GCR_decode, and gcr_val.

unsigned char gcr_get_encoded ( unsigned char *  raw_data)

References gcr_bits, and gcr_val.

void gcr_init ( void  )

References gcr_bits, and gcr_val.

unsigned char gcr_valid ( void  )

References gcr_bits, GCR_decode, and gcr_val.

unsigned char gcr_bits = 0
static
const unsigned char GCR_decode[32]
static
Initial value:
= {
0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff,
0xff, 0x08, 0x00, 0x01,
0xff, 0x0c, 0x04, 0x05,
0xff, 0xff, 0x02, 0x03,
0xff, 0x0f, 0x06, 0x07,
0xff, 0x09, 0x0a, 0x0b,
0xff, 0x0d, 0x0e, 0xff,
}

Referenced by gcr_get_decoded(), and gcr_valid().

const unsigned char GCR_encode[16]
static
Initial value:
= {
0x0a, 0x0b, 0x12, 0x13,
0x0e, 0x0f, 0x16, 0x17,
0x09, 0x19, 0x1a, 0x1b,
0x0d, 0x1d, 0x1e, 0x15
}

Referenced by gcr_encode().

unsigned short gcr_val = 0
static