Revert "Make advanced timer trait not require general purpose timer trait as the timers are too different."

This reverts commit 4988dfe981.
This commit is contained in:
chemicstry 2022-07-12 15:06:16 +03:00
parent 2adee4af38
commit 2df665da8a
2 changed files with 13 additions and 3 deletions

View file

@ -54,7 +54,7 @@ impl From<OutputCompareMode> for stm32_metapac::timer::vals::Ocm {
pub(crate) mod sealed {
use super::*;
pub trait CaptureCompare16bitInstance: crate::timer::sealed::Basic16bitInstance {
pub trait CaptureCompare16bitInstance: crate::timer::sealed::GeneralPurpose16bitInstance {
/// Global output enable. Does not do anything on non-advanced timers.
unsafe fn enable_outputs(&mut self, enable: bool);
@ -79,7 +79,7 @@ pub(crate) mod sealed {
}
pub trait CaptureCompare16bitInstance:
sealed::CaptureCompare16bitInstance + crate::timer::Basic16bitInstance + 'static
sealed::CaptureCompare16bitInstance + crate::timer::GeneralPurpose16bitInstance + 'static
{
}
pub trait CaptureCompare32bitInstance:

View file

@ -40,7 +40,7 @@ pub(crate) mod sealed {
fn set_frequency(&mut self, frequency: Hertz);
}
pub trait AdvancedControlInstance: Basic16bitInstance {
pub trait AdvancedControlInstance: GeneralPurpose16bitInstance {
fn regs_advanced() -> crate::pac::timer::TimAdv;
}
}
@ -204,11 +204,21 @@ foreach_interrupt! {
impl Basic16bitInstance for crate::peripherals::$inst {
}
impl sealed::GeneralPurpose16bitInstance for crate::peripherals::$inst {
fn regs_gp16() -> crate::pac::timer::TimGp16 {
crate::pac::timer::TimGp16(crate::pac::$inst.0)
}
}
impl GeneralPurpose16bitInstance for crate::peripherals::$inst {
}
impl sealed::AdvancedControlInstance for crate::peripherals::$inst {
fn regs_advanced() -> crate::pac::timer::TimAdv {
crate::pac::$inst
}
}
impl AdvancedControlInstance for crate::peripherals::$inst {
}
};