stm32f0xx_crc.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. /**
  2. ******************************************************************************
  3. * @file stm32f0xx_crc.h
  4. * @author MCD Application Team
  5. * @version V1.0.0
  6. * @date 23-March-2012
  7. * @brief This file contains all the functions prototypes for the CRC firmware
  8. * library.
  9. ******************************************************************************
  10. * @attention
  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. ******************************************************************************
  27. */
  28. /* Define to prevent recursive inclusion -------------------------------------*/
  29. #ifndef __STM32F0XX_CRC_H
  30. #define __STM32F0XX_CRC_H
  31. #ifdef __cplusplus
  32. extern "C" {
  33. #endif
  34. /*!< Includes ----------------------------------------------------------------*/
  35. #include "stm32f0xx.h"
  36. /** @addtogroup STM32F0xx_StdPeriph_Driver
  37. * @{
  38. */
  39. /** @addtogroup CRC
  40. * @{
  41. */
  42. /* Exported types ------------------------------------------------------------*/
  43. /* Exported constants --------------------------------------------------------*/
  44. /** @defgroup CRC_Exported_Constants
  45. * @{
  46. */
  47. #define CRC_ReverseInputData_No ((uint32_t)0x00000000) /*!< No reverse operation of Input Data */
  48. #define CRC_ReverseInputData_8bits CRC_CR_REV_IN_0 /*!< Reverse operation of Input Data on 8 bits */
  49. #define CRC_ReverseInputData_16bits CRC_CR_REV_IN_1 /*!< Reverse operation of Input Data on 16 bits */
  50. #define CRC_ReverseInputData_32bits CRC_CR_REV_IN /*!< Reverse operation of Input Data on 32 bits */
  51. #define IS_CRC_REVERSE_INPUT_DATA(DATA) (((DATA) == CRC_ReverseInputData_No) || \
  52. ((DATA) == CRC_ReverseInputData_8bits) || \
  53. ((DATA) == CRC_ReverseInputData_16bits) || \
  54. ((DATA) == CRC_ReverseInputData_32bits))
  55. /**
  56. * @}
  57. */
  58. /* Exported macro ------------------------------------------------------------*/
  59. /* Exported functions ------------------------------------------------------- */
  60. /* Configuration of the CRC computation unit **********************************/
  61. void CRC_DeInit(void);
  62. void CRC_ResetDR(void);
  63. void CRC_ReverseInputDataSelect(uint32_t CRC_ReverseInputData);
  64. void CRC_ReverseOutputDataCmd(FunctionalState NewState);
  65. void CRC_SetInitRegister(uint32_t CRC_InitValue);
  66. /* CRC computation ************************************************************/
  67. uint32_t CRC_CalcCRC(uint32_t CRC_Data);
  68. uint32_t CRC_CalcBlockCRC(uint32_t pBuffer[], uint32_t BufferLength);
  69. uint32_t CRC_GetCRC(void);
  70. /* Independent register (IDR) access (write/read) *****************************/
  71. void CRC_SetIDRegister(uint8_t CRC_IDValue);
  72. uint8_t CRC_GetIDRegister(void);
  73. #ifdef __cplusplus
  74. }
  75. #endif
  76. #endif /* __STM32F0XX_CRC_H */
  77. /**
  78. * @}
  79. */
  80. /**
  81. * @}
  82. */
  83. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/