F´ Flight Software - C/C++ Documentation  devel
A framework for building embedded system applications to NASA flight quality standards.
lib_crc.c File Reference
#include "lib_crc.h"

Go to the source code of this file.

Macros

#define P_16   0xA001
 
#define P_32   0xEDB88320L
 
#define P_CCITT   0x1021
 
#define P_DNP   0xA6BC
 
#define P_KERMIT   0x8408
 
#define P_SICK   0x8005
 

Functions

static void init_crc16_tab (void)
 
static void init_crc32_tab (void)
 
static void init_crcccitt_tab (void)
 
static void init_crcdnp_tab (void)
 
static void init_crckermit_tab (void)
 
unsigned short update_crc_ccitt (unsigned short crc, char c)
 
unsigned short update_crc_sick (unsigned short crc, char c, char prev_byte)
 
unsigned short update_crc_16 (unsigned short crc, char c)
 
unsigned short update_crc_kermit (unsigned short crc, char c)
 
unsigned short update_crc_dnp (unsigned short crc, char c)
 
unsigned long update_crc_32 (unsigned long crc, char c)
 

Variables

static int crc_tab16_init = CRC_FALSE
 
static int crc_tab32_init = CRC_FALSE
 
static int crc_tabccitt_init = CRC_FALSE
 
static int crc_tabdnp_init = CRC_FALSE
 
static int crc_tabkermit_init = CRC_FALSE
 
static unsigned short crc_tab16 [256]
 
static unsigned long crc_tab32 [256]
 
static unsigned short crc_tabccitt [256]
 
static unsigned short crc_tabdnp [256]
 
static unsigned short crc_tabkermit [256]
 

Macro Definition Documentation

◆ P_16

#define P_16   0xA001

Definition at line 64 of file lib_crc.c.

◆ P_32

#define P_32   0xEDB88320L

Definition at line 65 of file lib_crc.c.

◆ P_CCITT

#define P_CCITT   0x1021

Definition at line 66 of file lib_crc.c.

◆ P_DNP

#define P_DNP   0xA6BC

Definition at line 67 of file lib_crc.c.

◆ P_KERMIT

#define P_KERMIT   0x8408

Definition at line 68 of file lib_crc.c.

◆ P_SICK

#define P_SICK   0x8005

Definition at line 69 of file lib_crc.c.

Function Documentation

◆ init_crc16_tab()

static void init_crc16_tab ( void  )
static

Definition at line 297 of file lib_crc.c.

◆ init_crc32_tab()

static void init_crc32_tab ( void  )
static

Definition at line 405 of file lib_crc.c.

◆ init_crcccitt_tab()

static void init_crcccitt_tab ( void  )
static

Definition at line 438 of file lib_crc.c.

◆ init_crcdnp_tab()

static void init_crcdnp_tab ( void  )
static

Definition at line 369 of file lib_crc.c.

◆ init_crckermit_tab()

static void init_crckermit_tab ( void  )
static

Definition at line 333 of file lib_crc.c.

◆ update_crc_16()

unsigned short update_crc_16 ( unsigned short  crc,
char  c 
)

Definition at line 188 of file lib_crc.c.

◆ update_crc_32()

unsigned long update_crc_32 ( unsigned long  crc,
char  c 
)

Definition at line 271 of file lib_crc.c.

◆ update_crc_ccitt()

unsigned short update_crc_ccitt ( unsigned short  crc,
char  c 
)

Definition at line 131 of file lib_crc.c.

◆ update_crc_dnp()

unsigned short update_crc_dnp ( unsigned short  crc,
char  c 
)

Definition at line 244 of file lib_crc.c.

◆ update_crc_kermit()

unsigned short update_crc_kermit ( unsigned short  crc,
char  c 
)

Definition at line 217 of file lib_crc.c.

◆ update_crc_sick()

unsigned short update_crc_sick ( unsigned short  crc,
char  c,
char  prev_byte 
)

Definition at line 159 of file lib_crc.c.

Variable Documentation

◆ crc_tab16

unsigned short crc_tab16[256]
static

Definition at line 96 of file lib_crc.c.

◆ crc_tab16_init

int crc_tab16_init = CRC_FALSE
static

Definition at line 90 of file lib_crc.c.

◆ crc_tab32

unsigned long crc_tab32[256]
static

Definition at line 97 of file lib_crc.c.

◆ crc_tab32_init

int crc_tab32_init = CRC_FALSE
static

Definition at line 91 of file lib_crc.c.

◆ crc_tabccitt

unsigned short crc_tabccitt[256]
static

Definition at line 98 of file lib_crc.c.

◆ crc_tabccitt_init

int crc_tabccitt_init = CRC_FALSE
static

Definition at line 92 of file lib_crc.c.

◆ crc_tabdnp

unsigned short crc_tabdnp[256]
static

Definition at line 99 of file lib_crc.c.

◆ crc_tabdnp_init

int crc_tabdnp_init = CRC_FALSE
static

Definition at line 93 of file lib_crc.c.

◆ crc_tabkermit

unsigned short crc_tabkermit[256]
static

Definition at line 100 of file lib_crc.c.

◆ crc_tabkermit_init

int crc_tabkermit_init = CRC_FALSE
static

Definition at line 94 of file lib_crc.c.