STM32F4xx HAL Driver master
STM32CubeF4 HAL / LL Drivers API Reference
Loading...
Searching...
No Matches
stm32f4xx_ll_rng.h
Go to the documentation of this file.
1
18
19/* Define to prevent recursive inclusion -------------------------------------*/
20#ifndef STM32F4xx_LL_RNG_H
21#define STM32F4xx_LL_RNG_H
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
27/* Includes ------------------------------------------------------------------*/
28#include "stm32f4xx.h"
29
33
34#if defined (RNG)
35
39
40/* Private types -------------------------------------------------------------*/
41/* Private defines -----------------------------------------------------------*/
42/* Private variables ---------------------------------------------------------*/
43/* Private constants ---------------------------------------------------------*/
44/* Private macros ------------------------------------------------------------*/
45
46/* Exported types ------------------------------------------------------------*/
47/* Exported constants --------------------------------------------------------*/
51
52
57#define LL_RNG_SR_DRDY RNG_SR_DRDY
58#define LL_RNG_SR_CECS RNG_SR_CECS
59#define LL_RNG_SR_SECS RNG_SR_SECS
60#define LL_RNG_SR_CEIS RNG_SR_CEIS
61#define LL_RNG_SR_SEIS RNG_SR_SEIS
65
70#define LL_RNG_CR_IE RNG_CR_IE
74
78
79/* Exported macro ------------------------------------------------------------*/
83
87
95#define LL_RNG_WriteReg(__INSTANCE__, __REG__, __VALUE__) WRITE_REG(__INSTANCE__->__REG__, (__VALUE__))
96
103#define LL_RNG_ReadReg(__INSTANCE__, __REG__) READ_REG(__INSTANCE__->__REG__)
107
111
112
113/* Exported functions --------------------------------------------------------*/
120
127__STATIC_INLINE void LL_RNG_Enable(RNG_TypeDef *RNGx)
128{
129 SET_BIT(RNGx->CR, RNG_CR_RNGEN);
130}
131
138__STATIC_INLINE void LL_RNG_Disable(RNG_TypeDef *RNGx)
139{
140 CLEAR_BIT(RNGx->CR, RNG_CR_RNGEN);
141}
142
149__STATIC_INLINE uint32_t LL_RNG_IsEnabled(const RNG_TypeDef *RNGx)
150{
151 return ((READ_BIT(RNGx->CR, RNG_CR_RNGEN) == (RNG_CR_RNGEN)) ? 1UL : 0UL);
152}
153
157
161
168__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_DRDY(const RNG_TypeDef *RNGx)
169{
170 return ((READ_BIT(RNGx->SR, RNG_SR_DRDY) == (RNG_SR_DRDY)) ? 1UL : 0UL);
171}
172
179__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_CECS(const RNG_TypeDef *RNGx)
180{
181 return ((READ_BIT(RNGx->SR, RNG_SR_CECS) == (RNG_SR_CECS)) ? 1UL : 0UL);
182}
183
190__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_SECS(const RNG_TypeDef *RNGx)
191{
192 return ((READ_BIT(RNGx->SR, RNG_SR_SECS) == (RNG_SR_SECS)) ? 1UL : 0UL);
193}
194
201__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_CEIS(const RNG_TypeDef *RNGx)
202{
203 return ((READ_BIT(RNGx->SR, RNG_SR_CEIS) == (RNG_SR_CEIS)) ? 1UL : 0UL);
204}
205
212__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_SEIS(const RNG_TypeDef *RNGx)
213{
214 return ((READ_BIT(RNGx->SR, RNG_SR_SEIS) == (RNG_SR_SEIS)) ? 1UL : 0UL);
215}
216
223__STATIC_INLINE void LL_RNG_ClearFlag_CEIS(RNG_TypeDef *RNGx)
224{
225 WRITE_REG(RNGx->SR, ~RNG_SR_CEIS);
226}
227
234__STATIC_INLINE void LL_RNG_ClearFlag_SEIS(RNG_TypeDef *RNGx)
235{
236 WRITE_REG(RNGx->SR, ~RNG_SR_SEIS);
237}
238
242
246
254__STATIC_INLINE void LL_RNG_EnableIT(RNG_TypeDef *RNGx)
255{
256 SET_BIT(RNGx->CR, RNG_CR_IE);
257}
258
266__STATIC_INLINE void LL_RNG_DisableIT(RNG_TypeDef *RNGx)
267{
268 CLEAR_BIT(RNGx->CR, RNG_CR_IE);
269}
270
278__STATIC_INLINE uint32_t LL_RNG_IsEnabledIT(const RNG_TypeDef *RNGx)
279{
280 return ((READ_BIT(RNGx->CR, RNG_CR_IE) == (RNG_CR_IE)) ? 1UL : 0UL);
281}
282
286
290
297__STATIC_INLINE uint32_t LL_RNG_ReadRandData32(const RNG_TypeDef *RNGx)
298{
299 return (uint32_t)(READ_REG(RNGx->DR));
300}
301
305
306#if defined(USE_FULL_LL_DRIVER)
310ErrorStatus LL_RNG_DeInit(const RNG_TypeDef *RNGx);
311
315#endif /* USE_FULL_LL_DRIVER */
316
320
324
325#endif /* RNG */
326
330
331#ifdef __cplusplus
332}
333#endif
334
335#endif /* __STM32F4xx_LL_RNG_H */
336