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

crc_algs.c File Reference

Functions that perform the equivalent CRC16 and CRC32 to the hardware components. More...

#include "MAVRK_Arch.h"
#include "crc.h"

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.

Detailed Description

Functions that perform the equivalent CRC16 and CRC32 to the hardware components.

Author:
Emil Lenchak
Date:
March 2004

The software based CRC functions are designed to perform a CRC16 and CRC32 without the hardware engine. This allows micro-processors without a CRC engine to still create CRC values for message blocks.

There is also a C optimized version of each algorithm present in the file.

Note:
Prototypes for functions in this file are located in the crc.h header file located in the mavrk_embedded\Modular_EVM_Libraries\Algorithms\MSP430_CRC_16 directory
Warning:
These specific files are intended for calculating the CRC using a software algorithm with the processor. There exists identical function names for calculating the CRC using the hardware accelerator.
See also:
For Support: http://ti.com/mavrkquestions

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
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