Skip to content

Commit e4f5986

Browse files
Merge pull request #262 from victorpv/timer_dma
Timer dma from @victorpv
2 parents 2dbf8b7 + e7abad6 commit e4f5986

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

  • STM32F1/system/libmaple/include/libmaple

STM32F1/system/libmaple/include/libmaple/timer.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,22 @@ static inline void timer_dma_disable_trg_req(timer_dev *dev) {
785785
*bb_perip(&(dev->regs).gen->DIER, TIMER_DIER_TDE_BIT) = 0;
786786
}
787787

788+
/**
789+
* @brief Enable a timer's update DMA request
790+
* @param dev Timer device, must have type TIMER_ADVANCED or TIMER_GENERAL
791+
*/
792+
static inline void timer_dma_enable_upd_req(timer_dev *dev) {
793+
*bb_perip(&(dev->regs).gen->DIER, TIMER_DIER_UDE_BIT) = 1;
794+
}
795+
796+
/**
797+
* @brief Disable a timer's update DMA request
798+
* @param dev Timer device, must have type TIMER_ADVANCED or TIMER_GENERAL
799+
*/
800+
static inline void timer_dma_disable_upd_req(timer_dev *dev) {
801+
*bb_perip(&(dev->regs).gen->DIER, TIMER_DIER_UDE_BIT) = 0;
802+
}
803+
788804
/**
789805
* @brief Enable a timer channel's DMA request.
790806
* @param dev Timer device, must have type TIMER_ADVANCED or TIMER_GENERAL

0 commit comments

Comments
 (0)