crc.c 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /**
  2. ******************************************************************************
  3. * @file crc.c
  4. * @brief This file provides code for the configuration
  5. * of the CRC instances.
  6. ******************************************************************************
  7. * @attention
  8. *
  9. * <h2><center>&copy; Copyright (c) 2020 STMicroelectronics.
  10. * All rights reserved.</center></h2>
  11. *
  12. * This software component is licensed by ST under Ultimate Liberty license
  13. * SLA0044, the "License"; You may not use this file except in compliance with
  14. * the License. You may obtain a copy of the License at:
  15. * www.st.com/SLA0044
  16. *
  17. ******************************************************************************
  18. */
  19. /* Includes ------------------------------------------------------------------*/
  20. #include "crc.h"
  21. /* USER CODE BEGIN 0 */
  22. /* USER CODE END 0 */
  23. CRC_HandleTypeDef hcrc;
  24. /* CRC init function */
  25. void MX_CRC_Init(void)
  26. {
  27. hcrc.Instance = CRC;
  28. hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
  29. hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
  30. hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
  31. hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
  32. hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
  33. if (HAL_CRC_Init(&hcrc) != HAL_OK)
  34. {
  35. Error_Handler();
  36. }
  37. }
  38. void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle)
  39. {
  40. if(crcHandle->Instance==CRC)
  41. {
  42. /* USER CODE BEGIN CRC_MspInit 0 */
  43. /* USER CODE END CRC_MspInit 0 */
  44. /* CRC clock enable */
  45. __HAL_RCC_CRC_CLK_ENABLE();
  46. /* USER CODE BEGIN CRC_MspInit 1 */
  47. /* USER CODE END CRC_MspInit 1 */
  48. }
  49. }
  50. void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle)
  51. {
  52. if(crcHandle->Instance==CRC)
  53. {
  54. /* USER CODE BEGIN CRC_MspDeInit 0 */
  55. /* USER CODE END CRC_MspDeInit 0 */
  56. /* Peripheral clock disable */
  57. __HAL_RCC_CRC_CLK_DISABLE();
  58. /* USER CODE BEGIN CRC_MspDeInit 1 */
  59. /* USER CODE END CRC_MspDeInit 1 */
  60. }
  61. }
  62. /* USER CODE BEGIN 1 */
  63. /* USER CODE END 1 */
  64. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/