1 /**
2   ******************************************************************************
3   * @file    stm32f2xx_ll_rng.c
4   * @author  MCD Application Team
5   * @brief   RNG LL module driver.
6   ******************************************************************************
7   * @attention
8   *
9   * Copyright (c) 2016 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 "stm32f2xx_ll_rng.h"
22 #include "stm32f2xx_ll_bus.h"
23 
24 #ifdef  USE_FULL_ASSERT
25 #include "stm32_assert.h"
26 #else
27 #define assert_param(expr) ((void)0U)
28 #endif /* USE_FULL_ASSERT */
29 
30 /** @addtogroup STM32F2xx_LL_Driver
31   * @{
32   */
33 
34 #if defined (RNG)
35 
36 /** @addtogroup RNG_LL
37   * @{
38   */
39 
40 /* Private types -------------------------------------------------------------*/
41 /* Private variables ---------------------------------------------------------*/
42 /* Private constants ---------------------------------------------------------*/
43 /* Private macros ------------------------------------------------------------*/
44 /* Private function prototypes -----------------------------------------------*/
45 
46 /* Exported functions --------------------------------------------------------*/
47 /** @addtogroup RNG_LL_Exported_Functions
48   * @{
49   */
50 
51 /** @addtogroup RNG_LL_EF_Init
52   * @{
53   */
54 
55 /**
56   * @brief  De-initialize RNG registers (Registers restored to their default values).
57   * @param  RNGx RNG Instance
58   * @retval An ErrorStatus enumeration value:
59   *          - SUCCESS: RNG registers are de-initialized
60   *          - ERROR: not applicable
61   */
LL_RNG_DeInit(const RNG_TypeDef * RNGx)62 ErrorStatus LL_RNG_DeInit(const RNG_TypeDef *RNGx)
63 {
64   ErrorStatus status = SUCCESS;
65 
66   /* Check the parameters */
67   assert_param(IS_RNG_ALL_INSTANCE(RNGx));
68   if (RNGx == RNG)
69   {
70     /* Enable RNG reset state */
71     LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG);
72 
73     /* Release RNG from reset state */
74     LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG);
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 /* RNG */
97 
98 /**
99   * @}
100   */
101 
102 #endif /* USE_FULL_LL_DRIVER */
103 
104