diff options
Diffstat (limited to 'embassy-stm32/src/timer/mod.rs')
| -rw-r--r-- | embassy-stm32/src/timer/mod.rs | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index 2f5d5770a..8be96b414 100644 --- a/embassy-stm32/src/timer/mod.rs +++ b/embassy-stm32/src/timer/mod.rs | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | // | +--------------------------------------|-----------+ | 12 | // | +--------------------------------------|-----------+ |
| 13 | // +----------------------------------------------------+ | 13 | // +----------------------------------------------------+ |
| 14 | 14 | ||
| 15 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 15 | pub mod complementary_pwm; | 16 | pub mod complementary_pwm; |
| 16 | pub mod qei; | 17 | pub mod qei; |
| 17 | pub mod simple_pwm; | 18 | pub mod simple_pwm; |
| @@ -163,6 +164,7 @@ pub(crate) mod sealed { | |||
| 163 | }; | 164 | }; |
| 164 | } | 165 | } |
| 165 | 166 | ||
| 167 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 166 | macro_rules! add_complementary_capture_compare_methods { | 168 | macro_rules! add_complementary_capture_compare_methods { |
| 167 | ($regs:ident) => { | 169 | ($regs:ident) => { |
| 168 | /// Set complementary output polarity. | 170 | /// Set complementary output polarity. |
| @@ -374,6 +376,7 @@ pub(crate) mod sealed { | |||
| 374 | add_capture_compare_dma_methods!(regs_gp16); | 376 | add_capture_compare_dma_methods!(regs_gp16); |
| 375 | } | 377 | } |
| 376 | 378 | ||
| 379 | #[cfg(not(any(stm32l0)))] | ||
| 377 | /// Gneral-purpose 32-bit timer instance. | 380 | /// Gneral-purpose 32-bit timer instance. |
| 378 | pub trait GeneralPurpose32bitInstance: GeneralPurpose16bitInstance { | 381 | pub trait GeneralPurpose32bitInstance: GeneralPurpose16bitInstance { |
| 379 | /// Get access to the general purpose 32bit timer registers. | 382 | /// Get access to the general purpose 32bit timer registers. |
| @@ -434,6 +437,7 @@ pub(crate) mod sealed { | |||
| 434 | } | 437 | } |
| 435 | } | 438 | } |
| 436 | 439 | ||
| 440 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 437 | /// Gneral-purpose 1 channel with one complementary 16-bit timer instance. | 441 | /// Gneral-purpose 1 channel with one complementary 16-bit timer instance. |
| 438 | pub trait GeneralPurpose1ChannelComplementaryInstance: BasicNoCr2Instance + GeneralPurpose1ChannelInstance { | 442 | pub trait GeneralPurpose1ChannelComplementaryInstance: BasicNoCr2Instance + GeneralPurpose1ChannelInstance { |
| 439 | /// Get access to the general purpose 1 channel with one complementary 16bit timer registers. | 443 | /// Get access to the general purpose 1 channel with one complementary 16bit timer registers. |
| @@ -462,6 +466,7 @@ pub(crate) mod sealed { | |||
| 462 | add_complementary_capture_compare_methods!(regs_1ch_cmp); | 466 | add_complementary_capture_compare_methods!(regs_1ch_cmp); |
| 463 | } | 467 | } |
| 464 | 468 | ||
| 469 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 465 | /// Gneral-purpose 2 channel with one complementary 16-bit timer instance. | 470 | /// Gneral-purpose 2 channel with one complementary 16-bit timer instance. |
| 466 | pub trait GeneralPurpose2ChannelComplementaryInstance: | 471 | pub trait GeneralPurpose2ChannelComplementaryInstance: |
| 467 | BasicInstance + GeneralPurpose2ChannelInstance + GeneralPurpose1ChannelComplementaryInstance | 472 | BasicInstance + GeneralPurpose2ChannelInstance + GeneralPurpose1ChannelComplementaryInstance |
| @@ -477,6 +482,7 @@ pub(crate) mod sealed { | |||
| 477 | add_complementary_capture_compare_methods!(regs_2ch_cmp); | 482 | add_complementary_capture_compare_methods!(regs_2ch_cmp); |
| 478 | } | 483 | } |
| 479 | 484 | ||
| 485 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 480 | /// Advanced control timer instance. | 486 | /// Advanced control timer instance. |
| 481 | pub trait AdvancedControlInstance: | 487 | pub trait AdvancedControlInstance: |
| 482 | GeneralPurpose2ChannelComplementaryInstance + GeneralPurpose16bitInstance | 488 | GeneralPurpose2ChannelComplementaryInstance + GeneralPurpose16bitInstance |
| @@ -699,18 +705,21 @@ pub trait GeneralPurpose16bitInstance: | |||
| 699 | { | 705 | { |
| 700 | } | 706 | } |
| 701 | 707 | ||
| 708 | #[cfg(not(stm32l0))] | ||
| 702 | /// Gneral-purpose 32-bit timer instance. | 709 | /// Gneral-purpose 32-bit timer instance. |
| 703 | pub trait GeneralPurpose32bitInstance: | 710 | pub trait GeneralPurpose32bitInstance: |
| 704 | sealed::GeneralPurpose32bitInstance + GeneralPurpose16bitInstance + 'static | 711 | sealed::GeneralPurpose32bitInstance + GeneralPurpose16bitInstance + 'static |
| 705 | { | 712 | { |
| 706 | } | 713 | } |
| 707 | 714 | ||
| 715 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 708 | /// General-purpose 1 channel with one complementary 16-bit timer instance. | 716 | /// General-purpose 1 channel with one complementary 16-bit timer instance. |
| 709 | pub trait GeneralPurpose1ChannelComplementaryInstance: | 717 | pub trait GeneralPurpose1ChannelComplementaryInstance: |
| 710 | sealed::GeneralPurpose1ChannelComplementaryInstance + GeneralPurpose1ChannelInstance + 'static | 718 | sealed::GeneralPurpose1ChannelComplementaryInstance + GeneralPurpose1ChannelInstance + 'static |
| 711 | { | 719 | { |
| 712 | } | 720 | } |
| 713 | 721 | ||
| 722 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 714 | /// General-purpose 2 channel with one complementary 16-bit timer instance. | 723 | /// General-purpose 2 channel with one complementary 16-bit timer instance. |
| 715 | pub trait GeneralPurpose2ChannelComplementaryInstance: | 724 | pub trait GeneralPurpose2ChannelComplementaryInstance: |
| 716 | sealed::GeneralPurpose2ChannelComplementaryInstance | 725 | sealed::GeneralPurpose2ChannelComplementaryInstance |
| @@ -721,6 +730,7 @@ pub trait GeneralPurpose2ChannelComplementaryInstance: | |||
| 721 | { | 730 | { |
| 722 | } | 731 | } |
| 723 | 732 | ||
| 733 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 724 | /// Advanced control timer instance. | 734 | /// Advanced control timer instance. |
| 725 | pub trait AdvancedControlInstance: | 735 | pub trait AdvancedControlInstance: |
| 726 | sealed::AdvancedControlInstance + GeneralPurpose2ChannelComplementaryInstance + GeneralPurpose16bitInstance + 'static | 736 | sealed::AdvancedControlInstance + GeneralPurpose2ChannelComplementaryInstance + GeneralPurpose16bitInstance + 'static |
| @@ -738,18 +748,28 @@ pin_trait!(ExternalTriggerPin, GeneralPurpose16bitInstance); | |||
| 738 | #[cfg(stm32l0)] | 748 | #[cfg(stm32l0)] |
| 739 | pin_trait!(ExternalTriggerPin, GeneralPurpose2ChannelInstance); | 749 | pin_trait!(ExternalTriggerPin, GeneralPurpose2ChannelInstance); |
| 740 | 750 | ||
| 751 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 741 | pin_trait!(Channel1ComplementaryPin, GeneralPurpose1ChannelComplementaryInstance); | 752 | pin_trait!(Channel1ComplementaryPin, GeneralPurpose1ChannelComplementaryInstance); |
| 753 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 742 | pin_trait!(Channel2ComplementaryPin, GeneralPurpose2ChannelComplementaryInstance); | 754 | pin_trait!(Channel2ComplementaryPin, GeneralPurpose2ChannelComplementaryInstance); |
| 755 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 743 | pin_trait!(Channel3ComplementaryPin, AdvancedControlInstance); | 756 | pin_trait!(Channel3ComplementaryPin, AdvancedControlInstance); |
| 757 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 744 | pin_trait!(Channel4ComplementaryPin, AdvancedControlInstance); | 758 | pin_trait!(Channel4ComplementaryPin, AdvancedControlInstance); |
| 745 | 759 | ||
| 760 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 746 | pin_trait!(BreakInputPin, GeneralPurpose1ChannelComplementaryInstance); | 761 | pin_trait!(BreakInputPin, GeneralPurpose1ChannelComplementaryInstance); |
| 762 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 747 | pin_trait!(BreakInput2Pin, GeneralPurpose2ChannelComplementaryInstance); | 763 | pin_trait!(BreakInput2Pin, GeneralPurpose2ChannelComplementaryInstance); |
| 748 | 764 | ||
| 765 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 749 | pin_trait!(BreakInputComparator1Pin, GeneralPurpose1ChannelComplementaryInstance); | 766 | pin_trait!(BreakInputComparator1Pin, GeneralPurpose1ChannelComplementaryInstance); |
| 767 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 750 | pin_trait!(BreakInputComparator2Pin, AdvancedControlInstance); | 768 | pin_trait!(BreakInputComparator2Pin, AdvancedControlInstance); |
| 751 | 769 | ||
| 770 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 752 | pin_trait!(BreakInput2Comparator1Pin, AdvancedControlInstance); | 771 | pin_trait!(BreakInput2Comparator1Pin, AdvancedControlInstance); |
| 772 | #[cfg(not(any(stm32l0, stm32l1)))] | ||
| 753 | pin_trait!(BreakInput2Comparator2Pin, AdvancedControlInstance); | 773 | pin_trait!(BreakInput2Comparator2Pin, AdvancedControlInstance); |
| 754 | 774 | ||
| 755 | #[allow(unused)] | 775 | #[allow(unused)] |
