Merge pull request #2807 from chemicstry/rcc_methods

Expose RCC enable and disable methods
This commit is contained in:
Dario Nieuwenhuis 2024-04-14 20:14:46 +00:00 committed by GitHub
commit 87b79d4499
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -119,3 +119,21 @@ mod util {
pub fn frequency<T: RccPeripheral>() -> Hertz {
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();
}