SMART Embedded Computing MVME7100 Programmer's Reference Manual page 64

Table of Contents

Advertisement

Programmable Configuration Data
Programmable Configuration Data
The VPD CRC generation code is shown in the following example.
/*
* vpdGenerateCRC - generate CRC data for the passed buffer
* description:
* This function's purpose is to generate the CRC for the
* passed VPD SROM buffer.
* call:
* argument #1 = buffer pointer
* argument #2 = number of elements
* return:
* CRC data
*/
unsigned int
vpdGenerateCRC(pVpdBuffer, vpdSromSize)
unsigned char *pVpdBuffer;
unsigned int vpdSromSize;
{
unsigned int crcValue;
unsigned int crcValueFlipped;
unsigned char dataByte;
unsigned int index, dataBitValue, msbDataBitValue;
crcValue = 0xffffffff;
for (index = 0; index < vpdSromSize; index++)
{
dataByte = *pVpdBuffer++;
for (dataBitValue = 0; dataBitValue < 8; dataBitValue++)
{
msbDataBitValue = (crcValue >> 31) & 1;
crcValue <<= 1;
if (msbDataBitValue ^ (dataByte & 1))
{
crcValue ^= 0x04c11db6;
crcValue |= 1;
}
dataByte >>= 1;
}
62
MVME7100 Single Board Computer Programmer's Reference (6806800E82C)

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the MVME7100 and is the answer not in the manual?

Table of Contents