diff options
| author | Martin Marmsoler <[email protected]> | 2024-01-26 22:09:49 +0100 |
|---|---|---|
| committer | Martin Marmsoler <[email protected]> | 2024-01-26 22:09:49 +0100 |
| commit | 2809d3bd45c9d469ae398d55f8d2c4bfda33c9dd (patch) | |
| tree | b35a7f3714e0c057af606f76cd57bad241cd4220 /embassy-nrf/src | |
| parent | c26e62e4f4a17e4c7165b7e2b9fc7c7b0f670960 (diff) | |
add is_enabled() function
Diffstat (limited to 'embassy-nrf/src')
| -rw-r--r-- | embassy-nrf/src/pwm.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index 03354abf8..856e12024 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs | |||
| @@ -715,6 +715,13 @@ impl<'d, T: Instance> SimplePwm<'d, T> { | |||
| 715 | pwm | 715 | pwm |
| 716 | } | 716 | } |
| 717 | 717 | ||
| 718 | /// Returns the enable state of the pwm counter | ||
| 719 | #[inline(always)] | ||
| 720 | pub fn is_enabled(&self) -> bool { | ||
| 721 | let r = T::regs(); | ||
| 722 | r.enable.read().enable().bit_is_set() | ||
| 723 | } | ||
| 724 | |||
| 718 | /// Enables the PWM generator. | 725 | /// Enables the PWM generator. |
| 719 | #[inline(always)] | 726 | #[inline(always)] |
| 720 | pub fn enable(&self) { | 727 | pub fn enable(&self) { |
