diff --git a/include/libopencm3/stm32/common/crc_common_all.h b/include/libopencm3/stm32/common/crc_common_all.h index f0cd13d6..360e5cc1 100644 --- a/include/libopencm3/stm32/common/crc_common_all.h +++ b/include/libopencm3/stm32/common/crc_common_all.h @@ -94,16 +94,20 @@ BEGIN_DECLS void crc_reset(void); /** - * Add a word to the CRC calculator and return the result. - * @param data new word to add to the CRC calculator - * @return final CRC calculator value + * Writes a data word to the register, the write operation stalling until + * the computation is complete. + * @param[in] data new word to add to the CRC calculator + * @returns int32 Computed CRC result */ uint32_t crc_calculate(uint32_t data); /** - * Add a block of data to the CRC calculator and return the final result - * @param datap pointer to the start of a block of 32bit data words - * @param size length of data, in 32bit increments + * 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 + * @param[in] datap pointer to an array of 32 bit data words. + * @param[in] size length of data, in 32bit increments * @return final CRC calculator value */ uint32_t crc_calculate_block(uint32_t *datap, int size); diff --git a/lib/stm32/common/crc_common_all.c b/lib/stm32/common/crc_common_all.c index 06bb6d4f..6f4a0be2 100644 --- a/lib/stm32/common/crc_common_all.c +++ b/lib/stm32/common/crc_common_all.c @@ -28,28 +28,11 @@ /**@{*/ -/*---------------------------------------------------------------------------*/ -/** @brief CRC Reset. - -Reset the CRC unit and forces the data register to all 1s. - -*/ - void crc_reset(void) { CRC_CR |= CRC_CR_RESET; } -/*---------------------------------------------------------------------------*/ -/** @brief CRC Calculate. - -Writes a data word to the register, the write operation stalling until the -computation is complete. - -@param[in] data Unsigned int32. -@returns int32 Computed CRC result -*/ - uint32_t crc_calculate(uint32_t data) { CRC_DR = data; @@ -57,17 +40,6 @@ uint32_t crc_calculate(uint32_t data) return CRC_DR; } -/*---------------------------------------------------------------------------*/ -/** @brief CRC Calculate of a Block of Data. - -Writes data words consecutively to the register, the write operation stalling -until the computation of each word is complete. - -@param[in] datap Unsigned int32. pointer to an array of 32 bit data words. -@param[in] size int. Size of the array. -@returns int32 Final computed CRC result -*/ - uint32_t crc_calculate_block(uint32_t *datap, int size) { int i;