crc.c 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /* USER CODE BEGIN Header */
  2. /**
  3. ******************************************************************************
  4. * @file crc.c
  5. * @brief This file provides code for the configuration
  6. * of the CRC instances.
  7. ******************************************************************************
  8. * @attention
  9. *
  10. * Copyright (c) 2022 STMicroelectronics.
  11. * All rights reserved.
  12. *
  13. * This software is licensed under terms that can be found in the LICENSE file
  14. * in the root directory of this software component.
  15. * If no LICENSE file comes with this software, it is provided AS-IS.
  16. *
  17. ******************************************************************************
  18. */
  19. /* USER CODE END Header */
  20. /* Includes ------------------------------------------------------------------*/
  21. #include "crc.h"
  22. /* USER CODE BEGIN 0 */
  23. /* USER CODE END 0 */
  24. CRC_HandleTypeDef hcrc;
  25. /* CRC init function */
  26. void MX_CRC_Init(void)
  27. {
  28. /* USER CODE BEGIN CRC_Init 0 */
  29. /* USER CODE END CRC_Init 0 */
  30. /* USER CODE BEGIN CRC_Init 1 */
  31. /* USER CODE END CRC_Init 1 */
  32. hcrc.Instance = CRC;
  33. if (HAL_CRC_Init(&hcrc) != HAL_OK)
  34. {
  35. Error_Handler();
  36. }
  37. /* USER CODE BEGIN CRC_Init 2 */
  38. /* USER CODE END CRC_Init 2 */
  39. }
  40. void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle)
  41. {
  42. if(crcHandle->Instance==CRC)
  43. {
  44. /* USER CODE BEGIN CRC_MspInit 0 */
  45. /* USER CODE END CRC_MspInit 0 */
  46. /* CRC clock enable */
  47. __HAL_RCC_CRC_CLK_ENABLE();
  48. /* USER CODE BEGIN CRC_MspInit 1 */
  49. /* USER CODE END CRC_MspInit 1 */
  50. }
  51. }
  52. void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle)
  53. {
  54. if(crcHandle->Instance==CRC)
  55. {
  56. /* USER CODE BEGIN CRC_MspDeInit 0 */
  57. /* USER CODE END CRC_MspDeInit 0 */
  58. /* Peripheral clock disable */
  59. __HAL_RCC_CRC_CLK_DISABLE();
  60. /* USER CODE BEGIN CRC_MspDeInit 1 */
  61. /* USER CODE END CRC_MspDeInit 1 */
  62. }
  63. }
  64. /* USER CODE BEGIN 1 */
  65. /* USER CODE END 1 */