Content originally posted in LPCWare by Dave on Fri Mar 08 15:44:41 MST 2013
Anybody out there using the built in CRC engine in the LPC1788?
I thought this was pretty cool:
<code>
uint32_t CRC_32( uint8_t *Data, uint32_t Size )
{
uint32_t *temp = (uint32_t *)(Data);
LPC_CRC->MODE = 0x36;
LPC_CRC->SEED = 0xFFFFFFFF;
while( Size-- != 0 )
{
LPC_CRC->WR_DATA_DWORD.DATA = *temp++;
}
return( LPC_CRC->SUM );
}
</code>
Beats the heck out of building a look-up table :-)