EasyManuals Logo

ST STM32F2 User Manual

ST STM32F2
1371 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #461 background imageLoading...
Page #461 background image
UM1940
HAL RNG Generic Driver
DocID028236 Rev 2
461/1371
Function description
Generates a 32-bit random number in interrupt mode.
Parameters
hrng: pointer to a RNG_HandleTypeDef structure that
contains the configuration information for RNG.
Return values
HAL: status
HAL_RNG_ReadLastRandomNumber
Function name
uint32_t HAL_RNG_ReadLastRandomNumber
(RNG_HandleTypeDef * hrng)
Function description
Read latest generated random number.
Parameters
hrng: pointer to a RNG_HandleTypeDef structure that
contains the configuration information for RNG.
Return values
random: value
HAL_RNG_IRQHandler
Function name
void HAL_RNG_IRQHandler (RNG_HandleTypeDef * hrng)
Function description
Handles RNG interrupt request.
Parameters
hrng: pointer to a RNG_HandleTypeDef structure that
contains the configuration information for RNG.
Return values
None:
Notes
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.
HAL_RNG_ErrorCallback
Function name
void HAL_RNG_ErrorCallback (RNG_HandleTypeDef * hrng)
Function description
RNG error callbacks.
Parameters
hrng: pointer to a RNG_HandleTypeDef structure that
contains the configuration information for RNG.
Return values
None:

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the ST STM32F2 and is the answer not in the manual?

ST STM32F2 Specifications

General IconGeneral
BrandST
ModelSTM32F2
CategoryMicrocontrollers
LanguageEnglish

Related product manuals