1 /**
2   ******************************************************************************
3   * @file    stm32h5xx_ll_cordic.c
4   * @author  MCD Application Team
5   * @brief   CORDIC LL module driver.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2022 STMicroelectronics.
10   * All rights reserved.
11   *
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.
15   *
16   ******************************************************************************
17   */
18 #if defined(USE_FULL_LL_DRIVER)
19 
20 /* Includes ------------------------------------------------------------------*/
21 #include "stm32h5xx_ll_cordic.h"
22 #include "stm32h5xx_ll_bus.h"
23 #ifdef  USE_FULL_ASSERT
24 #include "stm32_assert.h"
25 #else
26 #define assert_param(expr) ((void)0U)
27 #endif /* USE_FULL_ASSERT */
28 
29 /** @addtogroup STM32H5xx_LL_Driver
30   * @{
31   */
32 
33 #if defined(CORDIC)
34 
35 /** @addtogroup CORDIC_LL
36   * @{
37   */
38 
39 /* Private types -------------------------------------------------------------*/
40 /* Private variables ---------------------------------------------------------*/
41 /* Private constants ---------------------------------------------------------*/
42 /* Private macros ------------------------------------------------------------*/
43 /* Private function prototypes -----------------------------------------------*/
44 
45 /* Exported functions --------------------------------------------------------*/
46 /** @addtogroup CORDIC_LL_Exported_Functions
47   * @{
48   */
49 
50 /** @addtogroup CORDIC_LL_EF_Init
51   * @{
52   */
53 
54 /**
55   * @brief  De-Initialize CORDIC peripheral registers to their default reset values.
56   * @param  CORDICx CORDIC Instance
57   * @retval An ErrorStatus enumeration value:
58   *          - SUCCESS: CORDIC registers are de-initialized
59   *          - ERROR: CORDIC registers are not de-initialized
60   */
LL_CORDIC_DeInit(const CORDIC_TypeDef * CORDICx)61 ErrorStatus LL_CORDIC_DeInit(const CORDIC_TypeDef *CORDICx)
62 {
63   ErrorStatus status = SUCCESS;
64 
65   /* Check the parameters */
66   assert_param(IS_CORDIC_ALL_INSTANCE(CORDICx));
67 
68   if (CORDICx == CORDIC)
69   {
70     /* Force CORDIC reset */
71     LL_AHB1_GRP1_ForceReset(LL_AHB1_GRP1_PERIPH_CORDIC);
72 
73     /* Release CORDIC reset */
74     LL_AHB1_GRP1_ReleaseReset(LL_AHB1_GRP1_PERIPH_CORDIC);
75   }
76   else
77   {
78     status = ERROR;
79   }
80 
81   return (status);
82 }
83 
84 /**
85   * @}
86   */
87 
88 /**
89   * @}
90   */
91 
92 /**
93   * @}
94   */
95 
96 #endif /* defined(CORDIC) */
97 
98 /**
99   * @}
100   */
101 
102 #endif /* USE_FULL_LL_DRIVER */
103