Functions
Peripheral State functions
Peripheral Driver » HAL Driver » RNG » Functions

RNG State functions. More...

## Functions
hal_rng_state_t | hal_rng_get_state (rng_handle_t *p_rng)
| Return the RNG handle state. More...
hal_status_t | hal_rng_suspend_reg (rng_handle_t *p_rng)
| Suspend some registers related to RNG configuration before sleep. More...
hal_status_t | hal_rng_resume_reg (rng_handle_t *p_rng)
| Restore some registers related to RNG configuration after sleep. This function must be used in conjunction with the hal_rng_resume_reg(). More...
hal_status_t | hal_is_rng_force_clk_enable (void)
| check the force off rng clk has been set or not More...
hal_status_t | hal_is_rng_wfi_clk_enable (void)
| check the rng wif clk has been set or not More...
hal_status_t | hal_rng_clk_recover (uint8_t rng_force_clk_flag, uint8_t rng_wfi_clk_flag)
| recover rng clk More...

## Detailed Description

RNG State functions.

     ===============================================================================
                          ##### Peripheral State functions #####
     ===============================================================================
        [..]
        This subsection provides a set of functions allowing to control the RNG.
         (+) hal_rng_get_state() API can be helpful to check in run-time the state of the RNG peripheral.

## Function Documentation

## ◆ hal_is_rng_force_clk_enable()

hal_status_t hal_is_rng_force_clk_enable | ( | void |  | ) |

check the force off rng clk has been set or not

Return values

  HAL_OK | rng force off clk has been set.
  HAL_ERROR | rng force off clk has not been set.

## ◆ hal_is_rng_wfi_clk_enable()

hal_status_t hal_is_rng_wfi_clk_enable | ( | void |  | ) |

check the rng wif clk has been set or not

Return values

  HAL_OK | rng wfi clk has been set.
  HAL_ERROR | rng wfi clk has not been set.

## ◆ hal_rng_clk_recover()

hal_status_t hal_rng_clk_recover | ( | uint8_t | rng_force_clk_flag,
|  | uint8_t | rng_wfi_clk_flag
| ) |  |

recover rng clk

Parameters

  [in] | rng_force_clk_flag | rng force clk set flag
  [in] | rng_wfi_clk_flag | rng wfi clk set flag

Return values

  HAL_OK | rng wfi clk has been set.
  HAL_ERROR | rng wfi clk has not been set.

## ◆ hal_rng_get_state()

hal_rng_state_t hal_rng_get_state | ( | rng_handle_t * | p_rng | ) |

Return the RNG handle state.

Parameters

  [in] | p_rng | Pointer to a RNG handle which contains the configuration information for the specified HMAC module.

Return values

  HAL_RNG_STATE_RESET | Peripheral not initialized.
  HAL_RNG_STATE_READY | Peripheral initialized and ready for use.
  HAL_RNG_STATE_BUSY | Peripheral in indirect mode and busy.
  HAL_RNG_STATE_ERROR | Peripheral in error.
  HAL_RNG_STATE_TIMEOUT | Peripheral in timeout.

## ◆ hal_rng_resume_reg()

hal_status_t hal_rng_resume_reg | ( | rng_handle_t * | p_rng | ) |

Restore some registers related to RNG configuration after sleep. This function must be used in conjunction with the hal_rng_resume_reg().

Parameters

  [in] | p_rng | Pointer to a RNG handle which contains the configuration information for the specified RNG module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.

## ◆ hal_rng_suspend_reg()

hal_status_t hal_rng_suspend_reg | ( | rng_handle_t * | p_rng | ) |

Suspend some registers related to RNG configuration before sleep.

Parameters

  [in] | p_rng | Pointer to a RNG handle which contains the configuration information for the specified RNG module.

Return values

  HAL_OK | Operation is OK.
  HAL_ERROR | Parameter error or operation not supported.
  HAL_BUSY | Driver is busy.
  HAL_TIMEOUT | Timeout occurred.