MAVRK Embedded Software 0.91
Software Libraries for the MAVRK motherboard and related components
Defines | Functions

crc.h File Reference

Go to the source code of this file.

Defines

#define TBL_MEM
#define CRC_MSG_MAXSIZE   70
#define CRC_TABLE_SIZE   256
#define CRC_TEST_SEQ   "123456789"
#define CRC16_CHECK   0xFEE8
#define CRC16R_CHECK   0xBB3D
#define CRC32_CHECK   0xFC891918
#define CRC32R_CHECK   0xCBF43926
#define CRC16R_POLY   0xA001
#define CRC16R_INIT_REM   0x0
#define CRC16R_FINAL_XOR   0x0
#define CRC16_POLY   0x1021
#define CRC16_POLY_REF
#define CRC16_INIT_REM   0x0
#define CRC16_FINAL_XOR   0x0
#define CRC32_POLY   0x04C11DB7
#define CRC32_INIT_REM   0xFFFFFFFF
#define CRC32_FINAL_XOR   0xFFFFFFFF
#define CRC32R_POLY   0xEDB88320
#define CRC32R_INIT_REM   0xFFFFFFFF
#define CRC32R_FINAL_XOR   0xFFFFFFFF

Functions

unsigned short mvk_Make_Bitwise_Crc16 (unsigned short crc, unsigned short poly, unsigned char *pmsg, unsigned int msg_size)
 Perform a 16 bit CRC in software.
unsigned short mvk_Make_Bitwise_Crc16_2 (unsigned short crc, unsigned short poly, unsigned char *pmsg, unsigned int msg_size)
 Perform a 16 bit CRC in software.
unsigned long mvk_Make_Bitwise_Crc32 (unsigned long crc, unsigned long poly, unsigned char *pmsg, unsigned int msg_size)
 Perform a 32 bit CRC in software.
unsigned long mvk_Make_Bitwise_Crc32_2 (unsigned long crc, unsigned long poly, unsigned char *pmsg, unsigned int msg_size)
 Perform a 32 bit CRC in software.

Define Documentation

#define CRC16_CHECK   0xFEE8
#define CRC16_FINAL_XOR   0x0
#define CRC16_INIT_REM   0x0
#define CRC16_POLY   0x1021
#define CRC16_POLY_REF
#define CRC16R_CHECK   0xBB3D
#define CRC16R_FINAL_XOR   0x0
#define CRC16R_INIT_REM   0x0
#define CRC16R_POLY   0xA001
#define CRC32_CHECK   0xFC891918
#define CRC32_FINAL_XOR   0xFFFFFFFF
#define CRC32_INIT_REM   0xFFFFFFFF
#define CRC32_POLY   0x04C11DB7
#define CRC32R_CHECK   0xCBF43926
#define CRC32R_FINAL_XOR   0xFFFFFFFF
#define CRC32R_INIT_REM   0xFFFFFFFF
#define CRC32R_POLY   0xEDB88320
#define CRC_MSG_MAXSIZE   70
#define CRC_TABLE_SIZE   256
#define CRC_TEST_SEQ   "123456789"
#define TBL_MEM

Function Documentation

unsigned short mvk_Make_Bitwise_Crc16 ( unsigned short  crc,
unsigned short  poly,
unsigned char *  pmsg,
unsigned int  msg_size 
)

Perform a 16 bit CRC in software.

This function performs a 16 bit CRC on the data block using the polynomial provided.

Parameters:
[in]crcCRC init value
[in]polyCRC generator polynomial
[in]*pmsgPointer to the block of data on which we will perform the CRC
[in]msg_sizeNumber of bytes in the CRC data block
Returns:
16 bit CRC value

Perform a 16 bit CRC in software.

This function performs a 16 bit CRC on the data block using the polynomial provided.

Parameters:
[in]crcCRC init value
[in]polyCRC generator polynomial
[in]*pmsgPointer to the block of data on which we will perform the CRC
[in]msg_sizeNumber of bytes in the CRC data block
Returns:
16 bit CRC value
unsigned short mvk_Make_Bitwise_Crc16_2 ( unsigned short  crc,
unsigned short  poly,
unsigned char *  pmsg,
unsigned int  msg_size 
)

Perform a 16 bit CRC in software.

This is a C optimized version of the algorithm that performs a 16 bit CRC on the data block using the polynomial provided.

Parameters:
[in]crcCRC init value
[in]polyCRC generator polynomial
[in]*pmsgPointer to the block of data on which we will perform the CRC
[in]msg_sizeNumber of bytes in the CRC data block
Returns:
16 bit CRC value
unsigned long mvk_Make_Bitwise_Crc32 ( unsigned long  crc,
unsigned long  poly,
unsigned char *  pmsg,
unsigned int  msg_size 
)

Perform a 32 bit CRC in software.

This function performs a 32 bit CRC on the data block using the polynomial provided.

Parameters:
[in]crcCRC init value
[in]polyCRC generator polynomial
[in]*pmsgPointer to the block of data on which we will perform the CRC
[in]msg_sizeNumber of bytes in the CRC data block
Returns:
32 bit CRC value
unsigned long mvk_Make_Bitwise_Crc32_2 ( unsigned long  crc,
unsigned long  poly,
unsigned char *  pmsg,
unsigned int  msg_size 
)

Perform a 32 bit CRC in software.

* This is a C optimized version of the algorithm that performs a 32 bit CRC on the data block using the polynomial provided.

Parameters:
[in]crcCRC init value
[in]polyCRC generator polynomial
[in]*pmsgPointer to the block of data on which we will perform the CRC
[in]msg_sizeNumber of bytes in the CRC data block
Returns:
32 bit CRC value
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines