add is_enabled() function

This commit is contained in:
Martin Marmsoler 2024-01-26 22:09:49 +01:00
parent c26e62e4f4
commit 2809d3bd45

View File

@ -715,6 +715,13 @@ impl<'d, T: Instance> SimplePwm<'d, T> {
pwm
}
/// Returns the enable state of the pwm counter
#[inline(always)]
pub fn is_enabled(&self) -> bool {
let r = T::regs();
r.enable.read().enable().bit_is_set()
}
/// Enables the PWM generator.
#[inline(always)]
pub fn enable(&self) {