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) 2025 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 | |
---|
23 | /* USER CODE BEGIN 0 */ |
---|
24 | |
---|
25 | /* USER CODE END 0 */ |
---|
26 | |
---|
27 | CRC_HandleTypeDef hcrc; |
---|
28 | |
---|
29 | /* CRC init function */ |
---|
30 | void MX_CRC_Init(void) |
---|
31 | { |
---|
32 | |
---|
33 | /* USER CODE BEGIN CRC_Init 0 */ |
---|
34 | |
---|
35 | /* USER CODE END CRC_Init 0 */ |
---|
36 | |
---|
37 | /* USER CODE BEGIN CRC_Init 1 */ |
---|
38 | |
---|
39 | /* USER CODE END CRC_Init 1 */ |
---|
40 | hcrc.Instance = CRC; |
---|
41 | hcrc.Init.DefaultPolynomialUse = DEFAULT_POLYNOMIAL_ENABLE; |
---|
42 | hcrc.Init.DefaultInitValueUse = DEFAULT_INIT_VALUE_ENABLE; |
---|
43 | hcrc.Init.InputDataInversionMode = CRC_INPUTDATA_INVERSION_NONE; |
---|
44 | hcrc.Init.OutputDataInversionMode = CRC_OUTPUTDATA_INVERSION_DISABLE; |
---|
45 | hcrc.InputDataFormat = CRC_INPUTDATA_FORMAT_BYTES; |
---|
46 | if (HAL_CRC_Init(&hcrc) != HAL_OK) |
---|
47 | { |
---|
48 | Error_Handler(); |
---|
49 | } |
---|
50 | /* USER CODE BEGIN CRC_Init 2 */ |
---|
51 | |
---|
52 | /* USER CODE END CRC_Init 2 */ |
---|
53 | |
---|
54 | } |
---|
55 | |
---|
56 | void HAL_CRC_MspInit(CRC_HandleTypeDef* crcHandle) |
---|
57 | { |
---|
58 | |
---|
59 | if(crcHandle->Instance==CRC) |
---|
60 | { |
---|
61 | /* USER CODE BEGIN CRC_MspInit 0 */ |
---|
62 | |
---|
63 | /* USER CODE END CRC_MspInit 0 */ |
---|
64 | /* CRC clock enable */ |
---|
65 | __HAL_RCC_CRC_CLK_ENABLE(); |
---|
66 | /* USER CODE BEGIN CRC_MspInit 1 */ |
---|
67 | |
---|
68 | /* USER CODE END CRC_MspInit 1 */ |
---|
69 | } |
---|
70 | } |
---|
71 | |
---|
72 | void HAL_CRC_MspDeInit(CRC_HandleTypeDef* crcHandle) |
---|
73 | { |
---|
74 | |
---|
75 | if(crcHandle->Instance==CRC) |
---|
76 | { |
---|
77 | /* USER CODE BEGIN CRC_MspDeInit 0 */ |
---|
78 | |
---|
79 | /* USER CODE END CRC_MspDeInit 0 */ |
---|
80 | /* Peripheral clock disable */ |
---|
81 | __HAL_RCC_CRC_CLK_DISABLE(); |
---|
82 | /* USER CODE BEGIN CRC_MspDeInit 1 */ |
---|
83 | |
---|
84 | /* USER CODE END CRC_MspDeInit 1 */ |
---|
85 | } |
---|
86 | } |
---|
87 | |
---|
88 | /* USER CODE BEGIN 1 */ |
---|
89 | |
---|
90 | /* USER CODE END 1 */ |
---|