Initialization and de-initialization functions.
More...
Initialization and de-initialization functions.
===============================================================================
##### Initialization and de-initialization functions #####
===============================================================================
[..] This section provides functions allowing to:
(+) Initialize the RNG according to the specified parameters
in the RNG_InitTypeDef and create the associated handle
(+) DeInitialize the RNG peripheral
(+) Initialize the RNG MSP (MCU Specific Package)
(+) DeInitialize the RNG MSP
◆ HAL_RNG_DeInit()
DeInitialize the RNG peripheral.
- Parameters
-
| hrng | pointer to a RNG_HandleTypeDef structure. |
- Return values
-
Definition at line 221 of file stm32l4xx_hal_rng.c.
229 #if defined(RNG_CR_CED) 240 #if (USE_HAL_RNG_REGISTER_CALLBACKS == 1) __IO HAL_RNG_StateTypeDef State
void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng)
DeInitialize the RNG MSP.
CLEAR_BIT(hrtc->Instance->CR, RTC_CR_WUTE)
void(* MspDeInitCallback)(struct __RNG_HandleTypeDef *hrng)
◆ HAL_RNG_Init()
Initialize the RNG peripheral and initialize the associated handle.
- Parameters
-
| hrng | pointer to a RNG_HandleTypeDef structure. |
- Return values
-
Definition at line 154 of file stm32l4xx_hal_rng.c.
163 #if defined(RNG_CR_CED) 167 #if (USE_HAL_RNG_REGISTER_CALLBACKS == 1) 198 #if defined(RNG_CR_CED) 204 __HAL_RNG_ENABLE(hrng);
void(* ErrorCallback)(struct __RNG_HandleTypeDef *hrng)
void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef *hrng, uint32_t random32bit)
Data Ready callback in non-blocking mode.
void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng)
RNG error callback.
__IO HAL_RNG_StateTypeDef State
void(* MspInitCallback)(struct __RNG_HandleTypeDef *hrng)
void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng)
Initialize the RNG MSP.
MODIFY_REG(hrtc->Instance->CR, RTC_CR_WUCKSEL,(uint32_t) WakeUpClock)
void(* ReadyDataCallback)(struct __RNG_HandleTypeDef *hrng, uint32_t random32bit)
assert_param(IS_RTC_WAKEUP_CLOCK(WakeUpClock))
◆ HAL_RNG_MspDeInit()
DeInitialize the RNG MSP.
- Parameters
-
| hrng | pointer to a RNG_HandleTypeDef structure. |
- Return values
-
Definition at line 286 of file stm32l4xx_hal_rng.c.
◆ HAL_RNG_MspInit()
Initialize the RNG MSP.
- Parameters
-
| hrng | pointer to a RNG_HandleTypeDef structure. |
- Return values
-
Definition at line 271 of file stm32l4xx_hal_rng.c.
◆ HAL_RNG_RegisterCallback()
Register a User RNG Callback To be used instead of the weak predefined callback.
- Parameters
-
| hrng | RNG handle |
| CallbackID | ID of the callback to be registered This parameter can be one of the following values:
|
| pCallback | pointer to the Callback function |
- Return values
-
Definition at line 309 of file stm32l4xx_hal_rng.c.
311 HAL_StatusTypeDef status =
HAL_OK;
313 if(pCallback == NULL)
316 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
340 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
360 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
369 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
void(* ErrorCallback)(struct __RNG_HandleTypeDef *hrng)
__IO HAL_RNG_StateTypeDef State
void(* MspDeInitCallback)(struct __RNG_HandleTypeDef *hrng)
void(* MspInitCallback)(struct __RNG_HandleTypeDef *hrng)
◆ HAL_RNG_RegisterReadyDataCallback()
Register Data Ready RNG Callback To be used instead of the weak HAL_RNG_ReadyDataCallback() predefined callback.
- Parameters
-
| hrng | RNG handle |
| pCallback | pointer to the Data Ready Callback function |
- Return values
-
Definition at line 461 of file stm32l4xx_hal_rng.c.
463 HAL_StatusTypeDef status =
HAL_OK;
465 if(pCallback == NULL)
468 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
481 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
__IO HAL_RNG_StateTypeDef State
void(* ReadyDataCallback)(struct __RNG_HandleTypeDef *hrng, uint32_t random32bit)
◆ HAL_RNG_UnRegisterCallback()
Unregister an RNG Callback RNG callabck is redirected to the weak predefined callback.
- Parameters
-
| hrng | RNG handle |
| CallbackID | ID of the callback to be unregistered This parameter can be one of the following values:
|
- Return values
-
Definition at line 390 of file stm32l4xx_hal_rng.c.
392 HAL_StatusTypeDef status =
HAL_OK;
415 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
435 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
444 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
void(* ErrorCallback)(struct __RNG_HandleTypeDef *hrng)
void HAL_RNG_ErrorCallback(RNG_HandleTypeDef *hrng)
RNG error callback.
__IO HAL_RNG_StateTypeDef State
void HAL_RNG_MspDeInit(RNG_HandleTypeDef *hrng)
DeInitialize the RNG MSP.
void(* MspDeInitCallback)(struct __RNG_HandleTypeDef *hrng)
void(* MspInitCallback)(struct __RNG_HandleTypeDef *hrng)
void HAL_RNG_MspInit(RNG_HandleTypeDef *hrng)
Initialize the RNG MSP.
◆ HAL_RNG_UnRegisterReadyDataCallback()
UnRegister the Data Ready RNG Callback Data Ready RNG Callback is redirected to the weak HAL_RNG_ReadyDataCallback() predefined callback.
- Parameters
-
- Return values
-
Definition at line 497 of file stm32l4xx_hal_rng.c.
499 HAL_StatusTypeDef status =
HAL_OK;
511 hrng->
ErrorCode |= HAL_RNG_ERROR_INVALID_CALLBACK;
void HAL_RNG_ReadyDataCallback(RNG_HandleTypeDef *hrng, uint32_t random32bit)
Data Ready callback in non-blocking mode.
__IO HAL_RNG_StateTypeDef State
void(* ReadyDataCallback)(struct __RNG_HandleTypeDef *hrng, uint32_t random32bit)