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

RNG State functions. More...

## Functions
hal_rng_state_t | hal_rng_get_state (const rng_handle_t *p_rng)
| Return the RNG handle state. More...
void | hal_rng_suspend_reg (rng_handle_t *p_rng)
| Suspend some registers related to RNG configuration before sleep. More...
void | hal_rng_resume_reg (const 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...
hal_pm_status_t | hal_pm_rng_suspend (rng_handle_t *p_rng)
| Suspend the specified RNG. More...
void | hal_pm_rng_resume (rng_handle_t *p_rng)
| Resume the specified RNG. 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_pm_rng_resume()

void hal_pm_rng_resume | ( | rng_handle_t * | p_rng | ) |

Resume the specified RNG.

Parameters

  [in] | p_rng | Pointer to a RNG handle

Return values

  ::None |

## ◆ hal_pm_rng_suspend()

hal_pm_status_t hal_pm_rng_suspend | ( | rng_handle_t * | p_rng | ) |

Suspend the specified RNG.

Parameters

  [in] | p_rng | Pointer to a RNG handle

Return values

  HAL_PM_ACTIVE | Device is active, not allow sleep.
  HAL_PM_SLEEP | Allow sleep.

## ◆ 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 | ( | const 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()

void hal_rng_resume_reg | ( | const 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

  None |

## ◆ hal_rng_suspend_reg()

void 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

  None |