diff options
Diffstat (limited to 'embassy-stm32/src/timer/mod.rs')
| -rw-r--r-- | embassy-stm32/src/timer/mod.rs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/embassy-stm32/src/timer/mod.rs b/embassy-stm32/src/timer/mod.rs index d07fd2776..957098cde 100644 --- a/embassy-stm32/src/timer/mod.rs +++ b/embassy-stm32/src/timer/mod.rs | |||
| @@ -311,6 +311,26 @@ pub(crate) mod sealed { | |||
| 311 | .ccmr_output(channel_index / 2) | 311 | .ccmr_output(channel_index / 2) |
| 312 | .modify(|w| w.set_ocpe(channel_index % 2, preload)); | 312 | .modify(|w| w.set_ocpe(channel_index % 2, preload)); |
| 313 | } | 313 | } |
| 314 | |||
| 315 | /// Get capture compare DMA selection | ||
| 316 | fn get_cc_dma_selection(&self) -> super::vals::Ccds { | ||
| 317 | Self::regs_gp16().cr2().read().ccds() | ||
| 318 | } | ||
| 319 | |||
| 320 | /// Set capture compare DMA selection | ||
| 321 | fn set_cc_dma_selection(&mut self, ccds: super::vals::Ccds) { | ||
| 322 | Self::regs_gp16().cr2().modify(|w| w.set_ccds(ccds)) | ||
| 323 | } | ||
| 324 | |||
| 325 | /// Get capture compare DMA enable state | ||
| 326 | fn get_cc_dma_enable_state(&self, channel: Channel) -> bool { | ||
| 327 | Self::regs_gp16().dier().read().ccde(channel.index()) | ||
| 328 | } | ||
| 329 | |||
| 330 | /// Set capture compare DMA enable state | ||
| 331 | fn set_cc_dma_enable_state(&mut self, channel: Channel, ccde: bool) { | ||
| 332 | Self::regs_gp16().dier().modify(|w| w.set_ccde(channel.index(), ccde)) | ||
| 333 | } | ||
| 314 | } | 334 | } |
| 315 | 335 | ||
| 316 | /// Capture/Compare 16-bit timer instance with complementary pin support. | 336 | /// Capture/Compare 16-bit timer instance with complementary pin support. |
| @@ -705,3 +725,8 @@ foreach_interrupt! { | |||
| 705 | 725 | ||
| 706 | // Update Event trigger DMA for every timer | 726 | // Update Event trigger DMA for every timer |
| 707 | dma_trait!(UpDma, Basic16bitInstance); | 727 | dma_trait!(UpDma, Basic16bitInstance); |
| 728 | |||
| 729 | dma_trait!(Ch1Dma, CaptureCompare16bitInstance); | ||
| 730 | dma_trait!(Ch2Dma, CaptureCompare16bitInstance); | ||
| 731 | dma_trait!(Ch3Dma, CaptureCompare16bitInstance); | ||
| 732 | dma_trait!(Ch4Dma, CaptureCompare16bitInstance); | ||
