CRC
7.2.1
Function Documentation
7.2.1.1
ROM_Crc16
Calculates the CRC-16 of an array of bytes.
Prototype:
uint16_t
ROM_Crc16(uint16_t ui16Crc,
const uint8_t *pui8Data,
uint32_t ui32Count)
ROM Location:
ROM_APITABLE
is an array of pointers located at
0x0100.0010
.
ROM_SOFTWARETABLE
is an array of pointers located at
ROM_APITABLE[21]
.
ROM_Crc16
is a function pointer located at
ROM_SOFTWARETABLE[3]
.
Parameters:
ui16Crc
is the starting CRC-16 value.
pui8Data
is a pointer to the data buffer.
ui32Count
is the number of bytes in the data buffer.
Description:
This function is used to calculate the CRC-16 of the input buffer. The CRC-16 is computed in a
running fashion, meaning that the entire data block that is to have its CRC-16 computed does
not need to be supplied all at once. If the input buffer contains the entire block of data, then
ui16Crc
should be set to 0. If, however, the entire block of data is not available, then
ui16Crc
should be set to 0 for the first portion of the data, and then the returned value should be passed
back in as
ui16Crc
for the next portion of the data.
For example, to compute the CRC-16 of a block that has been split into three pieces, use the
following:
ui16Crc = ROM_Crc16(0, pui8Data1, ui32Len1);
ui16Crc = ROM_Crc16(ui16Crc, pui8Data2, ui32Len2);
ui16Crc = ROM_Crc16(ui16Crc, pui8Data3, ui32Len3);
Computing a CRC-16 in a running fashion is useful in cases where the data is arriving via a
serial link (for example) and is therefore not all available at one time.
Returns:
The CRC-16 of the input data.
7.2.1.2
ROM_Crc16Array
Calculates the CRC-16 of an array of words.
Prototype:
uint16_t
ROM_Crc16Array(uint32_t ui32WordLen,
uint32_t *pui32Data)
70
April 8, 2013
Summary of Contents for Tiva TM4C123GH6PM
Page 26: ...Boot Loader 26 April 8 2013...
Page 68: ...Controller Area Network CAN 68 April 8 2013...
Page 122: ...Hibernation Module 122 April 8 2013...
Page 136: ...Inter Integrated Circuit I2C 136 April 8 2013...
Page 152: ...Memory Protection Unit MPU 152 April 8 2013...
Page 174: ...Pulse Width Modulator PWM Returns None 174 April 8 2013...
Page 196: ...Synchronous Serial Interface SSI 196 April 8 2013...
Page 222: ...System Control 222 April 8 2013...
Page 270: ...UART 270 April 8 2013...
Page 296: ...uDMA Controller 296 April 8 2013...
Page 351: ...April 8 2013 351...