libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
CRC peripheral API
Collaboration diagram for CRC peripheral API:

Functions

void crc_reset (void)
 Reset the CRC calculator to initial values. More...
 
uint32_t crc_calculate (uint32_t data)
 Writes a data word to the register, the write operation stalling until the computation is complete. More...
 
uint32_t crc_calculate_block (uint32_t *datap, int size)
 Add a block of data to the CRC calculator and return the final result. More...
 

Detailed Description

Author
© 2012 Karl Palsson karlp.nosp@m.@rem.nosp@m.ake.i.nosp@m.s

Function Documentation

◆ crc_calculate()

uint32_t crc_calculate ( uint32_t  data)

Writes a data word to the register, the write operation stalling until the computation is complete.

Parameters
[in]datanew word to add to the CRC calculator
Returns
int32 Computed CRC result

Definition at line 36 of file crc_common_all.c.

References CRC_DR.

◆ crc_calculate_block()

uint32_t crc_calculate_block ( uint32_t *  datap,
int  size 
)

Add a block of data to the CRC calculator and return the final result.

Writes data words consecutively to the register, the write operation stalling until the computation of each word is complete, then returns the final result

Parameters
[in]datappointer to an array of 32 bit data words.
[in]sizelength of data, in 32bit increments
Returns
final CRC calculator value

Definition at line 43 of file crc_common_all.c.

References CRC_DR.

◆ crc_reset()

void crc_reset ( void  )

Reset the CRC calculator to initial values.

Definition at line 31 of file crc_common_all.c.

References CRC_CR, and CRC_CR_RESET.