10.07.2015 Views

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

CF2 API Reference (PDF) - Persistor Instruments Inc

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>CRC16Block -- Compute a 16 bit CCITT CRC for a block of dataDescription:Prototype:Inputs:Returns:Computes and returns an unsigned short cyclic redundancy check on a block of memory. Pass ita pointer to the start of the block, the number of bytes to compute, and a starting CRC value(typically zero). The algorithm is table driven and has deterministic timing. This is calledautomatically at BIOS startup.ushort CRC16Block(const void *data, ulong len, ushort runningCRC);data points to the start of the data block to CRClen is the count in bytes to CRCrunningCRC is the running CRC from a previous call, usually initialized to zero for the first callthe computed CRCCRC32 -- Update a running 32 bit CCITT CRCDescription:Prototype:Inputs:Returns:Computes and returns an updated unsigned short long cyclic redundancy check derived from anunsigned byte value and an unsigned short running CRC. The running CRC is typically zero forthe first call, and the latest returned value for subsequent calls. The algorithm is table drive andhas deterministic timing as shown below. This is called automatically at BIOS startup.ulong CRC32(uchar value, ulong runningCRC);value is the next byte to CRCrunningCRC is the running CRC from a previous call, usually initialized to zero for the first callthe updated CRC, either the final value, or the next value to pass as the running CRCCRC32Block -- Compute a 32 bit CCITT CRC for a block of dataDescription:Prototype:Inputs:Returns:This function computes and returns an unsigned long cyclic redundancy check on a block ofmemory. Pass it a pointer to the start of the block, the number of bytes to compute, and astarting CRC value (typically zero). The algorithm is table drive and has deterministic timing asshown below. This is called automatically at BIOS startup.ulong CRC32Block(const void *data, ulong len, ulong runningCRC);data points to the start of the data block to CRClen is the count in bytes to CRCrunningCRC is the running CRC from a previous call, usually initialized to zero for the first callthe computed CRCCRCInit -- Initialize the CRC tablesDescription:Prototype:The 16 and 32 bit CRC routines work from table lookup algorithms rather than performing fullcomputations for each request. These tables are setup by this routine, which is automaticallycalled as part of the drivers initialization performed during the BIOS initialization. You will neverneed to explicitly call this function, and its description is included here so that when you see thisfunction listed in the function table, you won't wonder if this is something you need to do.Calling this function more than once has no effect. This is called automatically at BIOS startup.void CRCInit(void);PERSISTOR<strong>Instruments</strong> <strong>Inc</strong>.10 of 84<strong>CF2</strong> <strong>API</strong> <strong>Reference</strong>7/19/2005

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!