Enable clock for RNG
This commit is contained in:
parent
a92d6a372b
commit
f3d1ac6623
@ -24,6 +24,8 @@ pub struct Random<T: Instance> {
|
|||||||
|
|
||||||
impl<T: Instance> Random<T> {
|
impl<T: Instance> Random<T> {
|
||||||
pub fn new(inner: impl Unborrow<Target = T>) -> Self {
|
pub fn new(inner: impl Unborrow<Target = T>) -> Self {
|
||||||
|
T::enable();
|
||||||
|
T::reset();
|
||||||
unborrow!(inner);
|
unborrow!(inner);
|
||||||
let mut random = Self { _inner: inner };
|
let mut random = Self { _inner: inner };
|
||||||
random.reset();
|
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!(
|
crate::pac::peripherals!(
|
||||||
(rng, $inst:ident) => {
|
(rng, $inst:ident) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user