Merge maintenance-8.x.x fixes into master
[inav.git] / lib / main / STM32H7 / Drivers / STM32H7xx_HAL_Driver / Src / stm32h7xx_ll_crc.c
blob34f0dd117dcb7f70180d5d5a5d873f7104d8e772
1 /**
2 ******************************************************************************
3 * @file stm32h7xx_ll_crc.c
4 * @author MCD Application Team
5 * @brief CRC LL module driver.
6 ******************************************************************************
7 * @attention
9 * Copyright (c) 2017 STMicroelectronics.
10 * All rights reserved.
12 * This software is licensed under terms that can be found in the LICENSE file
13 * in the root directory of this software component.
14 * If no LICENSE file comes with this software, it is provided AS-IS.
16 ******************************************************************************
18 #if defined(USE_FULL_LL_DRIVER)
20 /* Includes ------------------------------------------------------------------*/
21 #include "stm32h7xx_ll_crc.h"
22 #include "stm32h7xx_ll_bus.h"
24 #ifdef USE_FULL_ASSERT
25 #include "stm32_assert.h"
26 #else
27 #define assert_param(expr) ((void)0U)
28 #endif /* USE_FULL_ASSERT */
30 /** @addtogroup STM32H7xx_LL_Driver
31 * @{
34 #if defined (CRC)
36 /** @addtogroup CRC_LL
37 * @{
40 /* Private types -------------------------------------------------------------*/
41 /* Private variables ---------------------------------------------------------*/
42 /* Private constants ---------------------------------------------------------*/
43 /* Private macros ------------------------------------------------------------*/
44 /* Private function prototypes -----------------------------------------------*/
46 /* Exported functions --------------------------------------------------------*/
47 /** @addtogroup CRC_LL_Exported_Functions
48 * @{
51 /** @addtogroup CRC_LL_EF_Init
52 * @{
55 /**
56 * @brief De-initialize CRC registers (Registers restored to their default values).
57 * @param CRCx CRC Instance
58 * @retval An ErrorStatus enumeration value:
59 * - SUCCESS: CRC registers are de-initialized
60 * - ERROR: CRC registers are not de-initialized
62 ErrorStatus LL_CRC_DeInit(const CRC_TypeDef *CRCx)
64 ErrorStatus status = SUCCESS;
66 /* Check the parameters */
67 assert_param(IS_CRC_ALL_INSTANCE(CRCx));
69 if (CRCx == CRC)
71 #if defined(LL_AHB4_GRP1_PERIPH_CRC)
72 /* Force CRC reset */
73 LL_AHB4_GRP1_ForceReset(LL_AHB4_GRP1_PERIPH_CRC);
75 /* Release CRC reset */
76 LL_AHB4_GRP1_ReleaseReset(LL_AHB4_GRP1_PERIPH_CRC);
77 #else
78 /* Force CRC reset */
79 LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CRC);
81 /* Release CRC reset */
82 LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CRC);
83 #endif /*LL_AHB4_GRP1_PERIPH_CRC)*/
85 else
87 status = ERROR;
90 return (status);
93 /**
94 * @}
97 /**
98 * @}
102 * @}
105 #endif /* defined (CRC) */
108 * @}
111 #endif /* USE_FULL_LL_DRIVER */