Struct stm32_hal2::rng::Rng
source · pub struct Rng {
pub regs: RNG,
}
Expand description
Represents a RNG peripheral.
Fields§
§regs: RNG
Implementations§
source§impl Rng
impl Rng
sourcepub fn new(regs: RNG) -> Self
pub fn new(regs: RNG) -> Self
Initialize a RNG peripheral, including configuration register writes, and enabling and resetting its RCC peripheral clock.
sourcepub fn reading_ready(&mut self) -> bool
pub fn reading_ready(&mut self) -> bool
Return true if a reading is available.
sourcepub fn enable_interrupt(&mut self)
pub fn enable_interrupt(&mut self)
Enable an interrupt. An interrupt isgenerated when a random number is ready or when an error occurs. Therefore at each interrupt, check that: No error occured (SEIS and CEIS bits should be set to 0 in the RNG_SR register. A random number is ready. The DRDY bit must be set to 1 in the RNG_SR register.