STM32F4xx_HAL_Driver  1.8.3
stm32f4xx_ll_rng.h
Go to the documentation of this file.
1 
19 /* Define to prevent recursive inclusion -------------------------------------*/
20 #ifndef STM32F4xx_LL_RNG_H
21 #define STM32F4xx_LL_RNG_H
22 
23 #ifdef __cplusplus
24 extern "C" {
25 #endif
26 
27 /* Includes ------------------------------------------------------------------*/
28 #include "stm32f4xx.h"
29 
34 #if defined (RNG)
35 
40 /* Private types -------------------------------------------------------------*/
41 /* Private defines -----------------------------------------------------------*/
42 /* Private variables ---------------------------------------------------------*/
43 /* Private constants ---------------------------------------------------------*/
44 /* Private macros ------------------------------------------------------------*/
45 
46 /* Exported types ------------------------------------------------------------*/
47 /* Exported constants --------------------------------------------------------*/
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
70 #define LL_RNG_CR_IE RNG_CR_IE
79 /* Exported macro ------------------------------------------------------------*/
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__)
113 /* Exported functions --------------------------------------------------------*/
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 
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 
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 
297 __STATIC_INLINE uint32_t LL_RNG_ReadRandData32(const RNG_TypeDef *RNGx)
298 {
299  return (uint32_t)(READ_REG(RNGx->DR));
300 }
301 
306 #if defined(USE_FULL_LL_DRIVER)
310 ErrorStatus LL_RNG_DeInit(const RNG_TypeDef *RNGx);
311 
315 #endif /* USE_FULL_LL_DRIVER */
316 
325 #endif /* RNG */
326 
331 #ifdef __cplusplus
332 }
333 #endif
334 
335 #endif /* __STM32F4xx_LL_RNG_H */
336 
__STATIC_INLINE void LL_RNG_Enable(RNG_TypeDef *RNGx)
Enable Random Number Generation @rmtoll CR RNGEN LL_RNG_Enable.
__STATIC_INLINE uint32_t LL_RNG_IsEnabled(const RNG_TypeDef *RNGx)
Check if Random Number Generator is enabled @rmtoll CR RNGEN LL_RNG_IsEnabled.
__STATIC_INLINE void LL_RNG_Disable(RNG_TypeDef *RNGx)
Disable Random Number Generation @rmtoll CR RNGEN LL_RNG_Disable.
__STATIC_INLINE uint32_t LL_RNG_ReadRandData32(const RNG_TypeDef *RNGx)
Return32-bit Random Number value @rmtoll DR RNDATA LL_RNG_ReadRandData32.
__STATIC_INLINE void LL_RNG_ClearFlag_CEIS(RNG_TypeDef *RNGx)
Clear Clock Error interrupt Status (CEIS) Flag @rmtoll SR CEIS LL_RNG_ClearFlag_CEIS.
__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_CEIS(const RNG_TypeDef *RNGx)
Indicate if the Clock Error Interrupt Status Flag is set or not @rmtoll SR CEIS LL_RNG_IsActiveFlag_C...
__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_DRDY(const RNG_TypeDef *RNGx)
Indicate if the RNG Data ready Flag is set or not @rmtoll SR DRDY LL_RNG_IsActiveFlag_DRDY.
__STATIC_INLINE void LL_RNG_ClearFlag_SEIS(RNG_TypeDef *RNGx)
Clear Seed Error interrupt Status (SEIS) Flag @rmtoll SR SEIS LL_RNG_ClearFlag_SEIS.
__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_SECS(const RNG_TypeDef *RNGx)
Indicate if the Seed Error Current Status Flag is set or not @rmtoll SR SECS LL_RNG_IsActiveFlag_SECS...
__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_SEIS(const RNG_TypeDef *RNGx)
Indicate if the Seed Error Interrupt Status Flag is set or not @rmtoll SR SEIS LL_RNG_IsActiveFlag_SE...
__STATIC_INLINE uint32_t LL_RNG_IsActiveFlag_CECS(const RNG_TypeDef *RNGx)
Indicate if the Clock Error Current Status Flag is set or not @rmtoll SR CECS LL_RNG_IsActiveFlag_CEC...
__STATIC_INLINE uint32_t LL_RNG_IsEnabledIT(const RNG_TypeDef *RNGx)
Check if Random Number Generator Interrupt is enabled (applies for either Seed error,...
__STATIC_INLINE void LL_RNG_EnableIT(RNG_TypeDef *RNGx)
Enable Random Number Generator Interrupt (applies for either Seed error, Clock Error or Data ready in...
__STATIC_INLINE void LL_RNG_DisableIT(RNG_TypeDef *RNGx)
Disable Random Number Generator Interrupt (applies for either Seed error, Clock Error or Data ready i...
ErrorStatus LL_RNG_DeInit(const RNG_TypeDef *RNGx)
De-initialize RNG registers (Registers restored to their default values).