Struct stm32_hal2::rng::Rng
source · [−]pub struct Rng {
pub regs: RNG,
}
Expand description
Represents a RNG peripheral.
Fields
regs: RNG
Implementations
sourceimpl 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.
Auto Trait Implementations
impl RefUnwindSafe for Rng
impl Send for Rng
impl !Sync for Rng
impl Unpin for Rng
impl UnwindSafe for Rng
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more