STLcrc32.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. /**
  2. ******************************************************************************
  3. * @file STLcrc32.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date May-2012
  7. * @brief This file contains all the functions prototypes for the
  8. * ADC firmware library.
  9. ******************************************************************************
  10. * @copyright
  11. *
  12. * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2>
  13. *
  14. * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  15. * You may not use this file except in compliance with the License.
  16. * You may obtain a copy of the License at:
  17. *
  18. * http://www.st.com/software_license_agreement_liberty_v2
  19. *
  20. * Unless required by applicable law or agreed to in writing, software
  21. * distributed under the License is distributed on an "AS IS" BASIS,
  22. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  23. * See the License for the specific language governing permissions and
  24. * limitations under the License.
  25. */
  26. /* Define to prevent recursive inclusion -------------------------------------*/
  27. #ifndef __STL_CRC32_H
  28. #define __STL_CRC32_H
  29. /* Includes ------------------------------------------------------------------*/
  30. #include "gd32f30x_libopt.h"
  31. #include "STLmisc.h"
  32. /* Exported types ------------------------------------------------------------*/
  33. /* Exported constants --------------------------------------------------------*/
  34. /* DR is the read/write data register which holds the 32-bit CRC. Each write in
  35. this register re-computes a CRC with the new data and the previous CRC. The
  36. result is written back into DR. (kind of CRC) */
  37. /* IDR is a 8-bit storage register which allows to keep a test ID or the 8 LSBs
  38. of a previous CRC for instance */
  39. /* CR is the Control Register. It contains the CRC reset bit (other bits are
  40. reserved). The CRC reset value is 0xFFFFFFFF */
  41. #define CRC_RESET (uint32_t)(0x00000001)
  42. /* Exported macro ------------------------------------------------------------*/
  43. /* Exported functions ------------------------------------------------------- */
  44. void CRC_Init(void);
  45. uint32_t CRC_CalcBlockCrc(uc32 *p, uint32_t len);
  46. #endif /*__CRC_H */
  47. /******************* (C) COPYRIGHT STMicroelectronics *****END OF FILE****/