diff options
Diffstat (limited to 'embassy-stm32/src/timer/low_level.rs')
| -rw-r--r-- | embassy-stm32/src/timer/low_level.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/embassy-stm32/src/timer/low_level.rs b/embassy-stm32/src/timer/low_level.rs index dc8ceb725..01bf60869 100644 --- a/embassy-stm32/src/timer/low_level.rs +++ b/embassy-stm32/src/timer/low_level.rs | |||
| @@ -686,6 +686,16 @@ impl<'d, T: AdvancedInstance1Channel> Timer<'d, T> { | |||
| 686 | self.regs_1ch_cmp().bdtr().modify(|w| w.set_dtg(value)); | 686 | self.regs_1ch_cmp().bdtr().modify(|w| w.set_dtg(value)); |
| 687 | } | 687 | } |
| 688 | 688 | ||
| 689 | /// Set state of OSSI-bit in BDTR register | ||
| 690 | pub fn set_ossi(&self, val: vals::Ossi) { | ||
| 691 | self.regs_1ch_cmp().bdtr().modify(|w| w.set_ossi(val)); | ||
| 692 | } | ||
| 693 | |||
| 694 | /// Set state of OSSR-bit in BDTR register | ||
| 695 | pub fn set_ossr(&self, val: vals::Ossr) { | ||
| 696 | self.regs_1ch_cmp().bdtr().modify(|w| w.set_ossr(val)); | ||
| 697 | } | ||
| 698 | |||
| 689 | /// Set state of MOE-bit in BDTR register to en-/disable output | 699 | /// Set state of MOE-bit in BDTR register to en-/disable output |
| 690 | pub fn set_moe(&self, enable: bool) { | 700 | pub fn set_moe(&self, enable: bool) { |
| 691 | self.regs_1ch_cmp().bdtr().modify(|w| w.set_moe(enable)); | 701 | self.regs_1ch_cmp().bdtr().modify(|w| w.set_moe(enable)); |
| @@ -725,4 +735,19 @@ impl<'d, T: AdvancedInstance4Channel> Timer<'d, T> { | |||
| 725 | .ccer() | 735 | .ccer() |
| 726 | .modify(|w| w.set_ccne(channel.index(), enable)); | 736 | .modify(|w| w.set_ccne(channel.index(), enable)); |
| 727 | } | 737 | } |
| 738 | |||
| 739 | /// Set Output Idle State | ||
| 740 | pub fn set_ois(&self, channel: Channel, val: bool) { | ||
| 741 | self.regs_advanced().cr2().modify(|w| w.set_ois(channel.index(), val)); | ||
| 742 | } | ||
| 743 | /// Set Output Idle State Complementary Channel | ||
| 744 | pub fn set_oisn(&self, channel: Channel, val: bool) { | ||
| 745 | self.regs_advanced().cr2().modify(|w| w.set_oisn(channel.index(), val)); | ||
| 746 | } | ||
| 747 | |||
| 748 | /// Trigger software break 1 or 2 | ||
| 749 | /// Setting this bit generates a break event. This bit is automatically cleared by the hardware. | ||
| 750 | pub fn trigger_software_break(&self, n: usize) { | ||
| 751 | self.regs_advanced().egr().write(|r| r.set_bg(n, true)); | ||
| 752 | } | ||
| 728 | } | 753 | } |
