Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "std/embedded/chip/esp_rng"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
hal |
std/embedded/hal |
esp_rng.dodo |
mmio |
core/mmio |
esp_rng.dodo |
Rng
Struct · Source
The chip’s random number generator. Implements hal.Rng.
pub struct Rng: hal.Rng {
// Private implementation fields omitted.
}
Rng.take
Function · Source
The generator, with its clock running. SAFETY: call once, from the chip’s take():
fillborrows the SAR ADC whenever no analog input is claimed.
pub unsafe fn take() -> Rng
Requires an unsafe context. Follow the source safety preconditions and the linked guide before calling this API.
Rng.has_noise_source
Function · Source
True when
fillwill mix in the SAR ADC’s noise, making its bytes fit for keys: no analog input and not the temperature sensor is claimed.
pub fn has_noise_source(&self) -> bool
Rng.fill
Function · Source
Fill
bytes, with the SAR ADC’s noise source on unless an analog input is claimed. Bus if the generator repeats a word.
pub fn fill(&mut self, bytes: &mut[u8]) -> void!hal.Error