diff options
| author | r.marple <[email protected]> | 2025-09-03 15:53:50 +1000 |
|---|---|---|
| committer | r.marple <[email protected]> | 2025-09-03 16:14:08 +1000 |
| commit | 089b6722c6c58a023beccdd8f15695f1df0fe117 (patch) | |
| tree | 36eb66b23a396af2ca496f90681c83eb80956cab /embassy-stm32/src/timer/complementary_pwm.rs | |
| parent | 2ef9dfb5122f602255eaa0b3cef440f6f84af33e (diff) | |
Added timer set polarity functions for main and complementary outputs individually
Diffstat (limited to 'embassy-stm32/src/timer/complementary_pwm.rs')
| -rw-r--r-- | embassy-stm32/src/timer/complementary_pwm.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/embassy-stm32/src/timer/complementary_pwm.rs b/embassy-stm32/src/timer/complementary_pwm.rs index b291fc155..7d6c2273e 100644 --- a/embassy-stm32/src/timer/complementary_pwm.rs +++ b/embassy-stm32/src/timer/complementary_pwm.rs | |||
| @@ -185,6 +185,16 @@ impl<'d, T: AdvancedInstance4Channel> ComplementaryPwm<'d, T> { | |||
| 185 | self.inner.set_complementary_output_polarity(channel, polarity); | 185 | self.inner.set_complementary_output_polarity(channel, polarity); |
| 186 | } | 186 | } |
| 187 | 187 | ||
| 188 | /// Set the main output polarity for a given channel. | ||
| 189 | pub fn set_main_polarity(&mut self, channel: Channel, polarity: OutputPolarity) { | ||
| 190 | self.inner.set_output_polarity(channel, polarity); | ||
| 191 | } | ||
| 192 | |||
| 193 | /// Set the complementary output polarity for a given channel. | ||
| 194 | pub fn set_complementary_polarity(&mut self, channel: Channel, polarity: OutputPolarity) { | ||
| 195 | self.inner.set_complementary_output_polarity(channel, polarity); | ||
| 196 | } | ||
| 197 | |||
| 188 | /// Set the dead time as a proportion of max_duty | 198 | /// Set the dead time as a proportion of max_duty |
| 189 | pub fn set_dead_time(&mut self, value: u16) { | 199 | pub fn set_dead_time(&mut self, value: u16) { |
| 190 | let (ckd, value) = compute_dead_time_value(value); | 200 | let (ckd, value) = compute_dead_time_value(value); |
