mirror of
https://github.com/embassy-rs/embassy.git
synced 2025-09-30 13:50:37 +00:00
Expose RCC enable and disable methods
This commit is contained in:
parent
b1902957c9
commit
64b806db0b
@ -119,3 +119,21 @@ mod util {
|
|||||||
pub fn frequency<T: RccPeripheral>() -> Hertz {
|
pub fn frequency<T: RccPeripheral>() -> Hertz {
|
||||||
T::frequency()
|
T::frequency()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Enables and resets peripheral `T`.
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
///
|
||||||
|
/// Peripheral must not be in use.
|
||||||
|
pub unsafe fn enable_and_reset<T: RccPeripheral>() {
|
||||||
|
T::enable_and_reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Disables peripheral `T`.
|
||||||
|
///
|
||||||
|
/// # Safety
|
||||||
|
///
|
||||||
|
/// Peripheral must not be in use.
|
||||||
|
pub unsafe fn disable<T: RccPeripheral>() {
|
||||||
|
T::disable();
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user