STM32F10x Standard Peripherals Library  3.5.0
/opt/STM32F10x_StdPeriph_Lib_V3.5.0/Libraries/STM32F10x_StdPeriph_Driver/src/stm32f10x_crc.c
Go to the documentation of this file.
00001 
00022 /* Includes ------------------------------------------------------------------*/
00023 #include "stm32f10x_crc.h"
00024 
00083 void CRC_ResetDR(void)
00084 {
00085   /* Reset CRC generator */
00086   CRC->CR = CRC_CR_RESET;
00087 }
00088 
00094 uint32_t CRC_CalcCRC(uint32_t Data)
00095 {
00096   CRC->DR = Data;
00097   
00098   return (CRC->DR);
00099 }
00100 
00107 uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
00108 {
00109   uint32_t index = 0;
00110   
00111   for(index = 0; index < BufferLength; index++)
00112   {
00113     CRC->DR = pBuffer[index];
00114   }
00115   return (CRC->DR);
00116 }
00117 
00123 uint32_t CRC_GetCRC(void)
00124 {
00125   return (CRC->DR);
00126 }
00127 
00133 void CRC_SetIDRegister(uint8_t IDValue)
00134 {
00135   CRC->IDR = IDValue;
00136 }
00137 
00143 uint8_t CRC_GetIDRegister(void)
00144 {
00145   return (CRC->IDR);
00146 }
00147 
00160 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/