Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
RNG_Exported_Functions_Group2
[RNG_Exported_Functions]
Management functions. More...
Functions | |
HAL_StatusTypeDef | HAL_RNG_GenerateRandomNumber (RNG_HandleTypeDef *hrng, uint32_t *random32bit) |
Generate a 32-bit random number. | |
HAL_StatusTypeDef | HAL_RNG_GenerateRandomNumber_IT (RNG_HandleTypeDef *hrng) |
Generate a 32-bit random number in interrupt mode. | |
void | HAL_RNG_IRQHandler (RNG_HandleTypeDef *hrng) |
Handle RNG interrupt request. | |
uint32_t | HAL_RNG_GetRandomNumber (RNG_HandleTypeDef *hrng) |
Return generated random number in polling mode (Obsolete). | |
uint32_t | HAL_RNG_GetRandomNumber_IT (RNG_HandleTypeDef *hrng) |
Return a 32-bit random number with interrupt enabled (Obsolete). | |
uint32_t | HAL_RNG_ReadLastRandomNumber (RNG_HandleTypeDef *hrng) |
Read latest generated random number. | |
__weak void | HAL_RNG_ReadyDataCallback (RNG_HandleTypeDef *hrng, uint32_t random32bit) |
Data Ready callback in non-blocking mode. | |
__weak void | HAL_RNG_ErrorCallback (RNG_HandleTypeDef *hrng) |
RNG error callback. |
Detailed Description
Management functions.
=============================================================================== ##### Peripheral Control functions ##### =============================================================================== [..] This section provides functions allowing to: (+) Get the 32 bit Random number (+) Get the 32 bit Random number with interrupt enabled (+) Handle RNG interrupt request
Function Documentation
__weak void HAL_RNG_ErrorCallback | ( | RNG_HandleTypeDef * | hrng ) |
RNG error callback.
- Parameters:
-
hrng,: pointer to a RNG_HandleTypeDef structure.
- Return values:
-
None
Definition at line 462 of file stm32l4xx_hal_rng.c.
HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber | ( | RNG_HandleTypeDef * | hrng, |
uint32_t * | random32bit | ||
) |
Generate a 32-bit random number.
- Note:
- Each time the random number data is read the RNG_FLAG_DRDY flag is automatically cleared.
- Parameters:
-
hrng,: pointer to a RNG_HandleTypeDef structure. random32bit,: pointer to generated random number variable if successful.
- Return values:
-
HAL status
Definition at line 244 of file stm32l4xx_hal_rng.c.
HAL_StatusTypeDef HAL_RNG_GenerateRandomNumber_IT | ( | RNG_HandleTypeDef * | hrng ) |
Generate a 32-bit random number in interrupt mode.
- Parameters:
-
hrng,: pointer to a RNG_HandleTypeDef structure.
- Return values:
-
HAL status
Definition at line 297 of file stm32l4xx_hal_rng.c.
uint32_t HAL_RNG_GetRandomNumber | ( | RNG_HandleTypeDef * | hrng ) |
Return generated random number in polling mode (Obsolete).
- Note:
- Use HAL_RNG_GenerateRandomNumber() API instead.
- Parameters:
-
hrng,: pointer to a RNG_HandleTypeDef structure that contains the configuration information for RNG.
- Return values:
-
random value
Definition at line 389 of file stm32l4xx_hal_rng.c.
uint32_t HAL_RNG_GetRandomNumber_IT | ( | RNG_HandleTypeDef * | hrng ) |
Return a 32-bit random number with interrupt enabled (Obsolete).
- Note:
- Use HAL_RNG_GenerateRandomNumber_IT() API instead.
- Parameters:
-
hrng,: RNG handle
- Return values:
-
32-bit random number
Definition at line 408 of file stm32l4xx_hal_rng.c.
void HAL_RNG_IRQHandler | ( | RNG_HandleTypeDef * | hrng ) |
Handle RNG interrupt request.
- Note:
- In the case of a clock error, the RNG is no more able to generate random numbers because the PLL48CLK clock is not correct. User has to check that the clock controller is correctly configured to provide the RNG clock and clear the CEIS bit using __HAL_RNG_CLEAR_IT(). The clock error has no impact on the previously generated random numbers, and the RNG_DR register contents can be used.
- In the case of a seed error, the generation of random numbers is interrupted as long as the SECS bit is '1'. If a number is available in the RNG_DR register, it must not be used because it may not have enough entropy. In this case, it is recommended to clear the SEIS bit using __HAL_RNG_CLEAR_IT(), then disable and enable the RNG peripheral to reinitialize and restart the RNG.
- User-written HAL_RNG_ErrorCallback() API is called once whether SEIS or CEIS are set.
- Parameters:
-
hrng,: pointer to a RNG_HandleTypeDef structure.
- Return values:
-
None
Definition at line 347 of file stm32l4xx_hal_rng.c.
uint32_t HAL_RNG_ReadLastRandomNumber | ( | RNG_HandleTypeDef * | hrng ) |
Read latest generated random number.
- Parameters:
-
hrng,: pointer to a RNG_HandleTypeDef structure.
- Return values:
-
random value
Definition at line 435 of file stm32l4xx_hal_rng.c.
__weak void HAL_RNG_ReadyDataCallback | ( | RNG_HandleTypeDef * | hrng, |
uint32_t | random32bit | ||
) |
Data Ready callback in non-blocking mode.
- Parameters:
-
hrng,: pointer to a RNG_HandleTypeDef structure. random32bit,: generated random value
- Return values:
-
None
Definition at line 446 of file stm32l4xx_hal_rng.c.
Generated on Tue Jul 12 2022 11:00:17 by
