ra_hal/module_stop.rs
1//! Module stop (`MSTP`).
2//!
3//! The `RA4M1` supports clock gating via four (4) "module stop" registers.
4//! After reset only the `DMAC`, `DTC`, and `SRAM` peripherals are enabled.
5//! To enable additional peripherals use the `start_module` function.
6//!
7//! # Notes
8//! - Some peripheral instances (e.g. `GPT`) share the same gate.
9//! - See ยง10.4.
10
11/// A trait that provides a consistent interface to "module stop" functionality.
12#[allow(private_bounds)]
13pub trait ModuleStop: SealedModuleStop {
14 /// Returns `true` if the peripheral's clock is enabled.
15 fn active() -> bool;
16
17 /// Enables the peripheral clock.
18 fn start_module();
19
20 /// Disables the peripheral clock.
21 fn stop_module();
22}
23
24pub(crate) trait SealedModuleStop {}