stm32f10x_crc.c
Go to the documentation of this file.
1 
22 /* Includes ------------------------------------------------------------------*/
23 #include "stm32f10x_crc.h"
24 
83 void CRC_ResetDR(void)
84 {
85  /* Reset CRC generator */
86  CRC->CR = CRC_CR_RESET;
87 }
88 
94 uint32_t CRC_CalcCRC(uint32_t Data)
95 {
96  CRC->DR = Data;
97 
98  return (CRC->DR);
99 }
100 
107 uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
108 {
109  uint32_t index = 0;
110 
111  for(index = 0; index < BufferLength; index++)
112  {
113  CRC->DR = pBuffer[index];
114  }
115  return (CRC->DR);
116 }
117 
123 uint32_t CRC_GetCRC(void)
124 {
125  return (CRC->DR);
126 }
127 
133 void CRC_SetIDRegister(uint8_t IDValue)
134 {
135  CRC->IDR = IDValue;
136 }
137 
143 uint8_t CRC_GetIDRegister(void)
144 {
145  return (CRC->IDR);
146 }
147 
160 /******************* (C) COPYRIGHT 2011 STMicroelectronics *****END OF FILE****/
void CRC_SetIDRegister(uint8_t IDValue)
Stores a 8-bit data in the Independent Data(ID) register.
uint32_t CRC_CalcCRC(uint32_t Data)
Computes the 32-bit CRC of a given data word(32-bit).
Definition: stm32f10x_crc.c:94
This file contains all the functions prototypes for the CRC firmware library.
#define CRC_CR_RESET
Definition: stm32f4xx.h:3868
#define CRC
Definition: stm32f4xx.h:2121
uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength)
Computes the 32-bit CRC of a given buffer of data word(32-bit).
uint8_t CRC_GetIDRegister(void)
Returns the 8-bit data stored in the Independent Data(ID) register.
uint32_t CRC_GetCRC(void)
Returns the current CRC value.
void CRC_ResetDR(void)
Resets the CRC Data register (DR).
Definition: stm32f10x_crc.c:83


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:19