STM32L4xx_HAL_Driver  1.14.0
stm32l4xx_ll_rng.c
Go to the documentation of this file.
1 
19 #if defined(USE_FULL_LL_DRIVER)
20 
21 /* Includes ------------------------------------------------------------------*/
22 #include "stm32l4xx_ll_rng.h"
23 #include "stm32l4xx_ll_bus.h"
24 
25 #ifdef USE_FULL_ASSERT
26 #include "stm32_assert.h"
27 #else
28 #define assert_param(expr) ((void)0U)
29 #endif
30 
35 #if defined (RNG)
36 
41 /* Private types -------------------------------------------------------------*/
42 /* Private variables ---------------------------------------------------------*/
43 /* Private constants ---------------------------------------------------------*/
44 /* Private macros ------------------------------------------------------------*/
48 #if defined(RNG_CR_CED)
49 #define IS_LL_RNG_CED(__MODE__) (((__MODE__) == LL_RNG_CED_ENABLE) || \
50  ((__MODE__) == LL_RNG_CED_DISABLE))
51 #endif /* defined(RNG_CR_CED) */
52 
57 /* Private function prototypes -----------------------------------------------*/
58 
59 /* Exported functions --------------------------------------------------------*/
75 ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx)
76 {
77  /* Check the parameters */
78  assert_param(IS_RNG_ALL_INSTANCE(RNGx));
79 
80  /* Enable RNG reset state */
81  LL_AHB2_GRP1_ForceReset(LL_AHB2_GRP1_PERIPH_RNG);
82 
83  /* Release RNG from reset state */
84  LL_AHB2_GRP1_ReleaseReset(LL_AHB2_GRP1_PERIPH_RNG);
85 
86  return (SUCCESS);
87 }
88 
89 #if defined(RNG_CR_CED)
90 
99 ErrorStatus LL_RNG_Init(RNG_TypeDef *RNGx, LL_RNG_InitTypeDef *RNG_InitStruct)
100 {
101  /* Check the parameters */
102  assert_param(IS_RNG_ALL_INSTANCE(RNGx));
103  assert_param(IS_LL_RNG_CED(RNG_InitStruct->ClockErrorDetection));
104 
105  /* Clock Error Detection configuration */
106  MODIFY_REG(RNGx->CR, RNG_CR_CED, RNG_InitStruct->ClockErrorDetection);
107 
108  return (SUCCESS);
109 }
110 
118 {
119  /* Set RNG_InitStruct fields to default values */
120  RNG_InitStruct->ClockErrorDetection = LL_RNG_CED_ENABLE;
121 
122 }
123 #endif /* defined(RNG_CR_CED) */
124 
137 #endif /* defined (RNG) */
138 
143 #endif /* USE_FULL_LL_DRIVER */
144 
145 /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
146 
ErrorStatus LL_RNG_Init(RNG_TypeDef *RNGx, LL_RNG_InitTypeDef *RNG_InitStruct)
Initialize RNG registers according to the specified parameters in RNG_InitStruct. ...
uint32_t ClockErrorDetection
__STATIC_INLINE void LL_AHB2_GRP1_ForceReset(uint32_t Periphs)
Force AHB2 peripherals reset. AHB2RSTR GPIOARST LL_AHB2_GRP1_ForceReset AHB2RSTR GPIOBRST LL_AHB2_G...
void LL_RNG_StructInit(LL_RNG_InitTypeDef *RNG_InitStruct)
Set each LL_RNG_InitTypeDef field to default value.
__STATIC_INLINE void LL_AHB2_GRP1_ReleaseReset(uint32_t Periphs)
Release AHB2 peripherals reset. AHB2RSTR GPIOARST LL_AHB2_GRP1_ReleaseReset AHB2RSTR GPIOBRST LL_AH...
Header file of BUS LL module.
ErrorStatus LL_RNG_DeInit(RNG_TypeDef *RNGx)
De-initialize RNG registers (Registers restored to their default values).
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
LL RNG Init Structure Definition.
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
Header file of RNG LL module.