crc.c 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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) 2021 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. /* USER CODE BEGIN CRC_Init 0 */
  28. /* USER CODE END CRC_Init 0 */
  29. /* USER CODE BEGIN CRC_Init 1 */
  30. /* USER CODE END CRC_Init 1 */
  31. hcrc.Instance = CRC;
  32. hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE;
  33. hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE;
  34. hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE;
  35. hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE;
  36. hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES;
  37. if (HAL_CRC_Init(&hcrc) != HAL_OK)
  38. {
  39. Error_Handler();
  40. }
  41. /* USER CODE BEGIN CRC_Init 2 */
  42. /* USER CODE END CRC_Init 2 */
  43. }
  44. void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle)
  45. {
  46. if(crcHandle->Instance==CRC)
  47. {
  48. /* USER CODE BEGIN CRC_MspInit 0 */
  49. /* USER CODE END CRC_MspInit 0 */
  50. /* CRC clock enable */
  51. __HAL_RCC_CRC_CLK_ENABLE();
  52. /* USER CODE BEGIN CRC_MspInit 1 */
  53. /* USER CODE END CRC_MspInit 1 */
  54. }
  55. }
  56. void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle)
  57. {
  58. if(crcHandle->Instance==CRC)
  59. {
  60. /* USER CODE BEGIN CRC_MspDeInit 0 */
  61. /* USER CODE END CRC_MspDeInit 0 */
  62. /* Peripheral clock disable */
  63. __HAL_RCC_CRC_CLK_DISABLE();
  64. /* USER CODE BEGIN CRC_MspDeInit 1 */
  65. /* USER CODE END CRC_MspDeInit 1 */
  66. }
  67. }
  68. /* USER CODE BEGIN 1 */
  69. /* USER CODE END 1 */
  70. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/