Peripheral Control functions

Peripheral Control functions. More...

Functions

hal_status_t hal_rng_generate_random_number (rng_handle_t *p_rng, uint16_t *p_seed, uint32_t *p_random32bit)
 Generate a 32-bit random number. More...
 
hal_status_t hal_rng_generate_random_number_it (rng_handle_t *p_rng, uint16_t *p_seed)
 Generate a 32-bit random number in interrupt mode. More...
 
uint32_t hal_rng_read_last_random_number (rng_handle_t *p_rng)
 Read the latest generated random number. More...
 

Detailed Description

Peripheral Control functions.

  ==============================================================================
                      ##### Peripheral Control functions #####
  ==============================================================================
  [..]
    This section provides functions allowing to:
    (+) Generate Random Number.
    (+) Handle RNG interrupt request and associated function callback.

Function Documentation

◆ hal_rng_generate_random_number()

hal_status_t hal_rng_generate_random_number ( rng_handle_t p_rng,
uint16_t *  p_seed,
uint32_t *  p_random32bit 
)

Generate a 32-bit random number.

Parameters
[in]p_rngPointer to a RNG handle which contains the configuration information for the specified RNG module.
[in]p_seeduser configured seeds. the seed is valid when seed_mode member of rng_init_t is configured as RNG_SEED_USER. If 59-bit random number is selected, the seed need to provide [0~58] bit spaces. If 128-bit random number is selected, the seed need to provide [0~127] bit spaces.
[out]p_random32bitPointer to generated random number variable if successful.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rng_generate_random_number_it()

hal_status_t hal_rng_generate_random_number_it ( rng_handle_t p_rng,
uint16_t *  p_seed 
)

Generate a 32-bit random number in interrupt mode.

Parameters
[in]p_rngPointer to a RNG handle which contains the configuration information for the specified RNG module.
[in]p_seeduser configured seeds. the seed is valid when seed_mode member of rng_init_t is configured as RNG_SEED_USER. If 59-bit random number is selected, the seed need to provide [0~58] bit spaces. If 128-bit random number is selected, the seed need to provide [0~127] bit spaces.
Return values
HAL_OKOperation is OK.
HAL_ERRORParameter error or operation not supported.
HAL_BUSYDriver is busy.
HAL_TIMEOUTTimeout occurred.

◆ hal_rng_read_last_random_number()

uint32_t hal_rng_read_last_random_number ( rng_handle_t p_rng)

Read the latest generated random number.

Parameters
[in]p_rngPointer to a RNG handle which contains the configuration information for the specified RNG module.
Return values
randomvalue.