Enable clock for RNG

This commit is contained in:
Ulf Lilleengen 2021-06-09 13:54:53 +02:00
parent a92d6a372b
commit f3d1ac6623

View File

@ -24,6 +24,8 @@ pub struct Random<T: Instance> {
impl<T: Instance> Random<T> {
pub fn new(inner: impl Unborrow<Target = T>) -> Self {
T::enable();
T::reset();
unborrow!(inner);
let mut random = Self { _inner: inner };
random.reset();
@ -133,7 +135,7 @@ pub(crate) mod sealed {
}
}
pub trait Instance: sealed::Instance {}
pub trait Instance: sealed::Instance + crate::rcc::RccPeripheral {}
crate::pac::peripherals!(
(rng, $inst:ident) => {