Added DMA enable and disable functions to hardware timers, thanks to @stevstrong
This commit is contained in:
parent
05f008acbe
commit
4a3e23949b
|
@ -138,6 +138,15 @@ void HardwareTimer::detachInterrupt(int channel) {
|
|||
timer_detach_interrupt(this->dev, (uint8)channel);
|
||||
}
|
||||
|
||||
|
||||
void HardwareTimer::enableDMA(int channel) {
|
||||
timer_dma_enable_req(this->dev, (uint8)channel);
|
||||
}
|
||||
|
||||
void HardwareTimer::disableDMA(int channel) {
|
||||
timer_dma_disable_req(this->dev, (uint8)channel);
|
||||
}
|
||||
|
||||
void HardwareTimer::refresh(void) {
|
||||
timer_generate_update(this->dev);
|
||||
}
|
||||
|
|
|
@ -246,6 +246,12 @@ public:
|
|||
/* Escape hatch */
|
||||
|
||||
/**
|
||||
* @brief Enable/disable DMA request for the input channel.
|
||||
*/
|
||||
void enableDMA(int channel);
|
||||
void disableDMA(int channel);
|
||||
|
||||
/**
|
||||
* @brief Get a pointer to the underlying libmaple timer_dev for
|
||||
* this HardwareTimer instance.
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue