Skip to content

Commit

Permalink
Clarify that DMA timer fraction must be <= 1 (#1723)
Browse files Browse the repository at this point in the history
  • Loading branch information
lurch authored Jun 21, 2024
1 parent 0e5cef3 commit 5be87f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/rp2_common/hardware_dma/include/hardware/dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -867,14 +867,16 @@ bool dma_timer_is_claimed(uint timer);
* \ingroup hardware_dma
*
* The timer will run at the system_clock_freq * numerator / denominator, so this is the speed
* that data elements will be transferred at via a DMA channel using this timer as a DREQ
* that data elements will be transferred at via a DMA channel using this timer as a DREQ. The
* multiplier must be less than or equal to one.
*
* \param timer the dma timer
* \param numerator the fraction's numerator
* \param denominator the fraction's denominator
*/
static inline void dma_timer_set_fraction(uint timer, uint16_t numerator, uint16_t denominator) {
check_dma_timer_param(timer);
invalid_params_if(DMA, numerator > denominator);
dma_hw->timer[timer] = (((uint32_t)numerator) << DMA_TIMER0_X_LSB) | (((uint32_t)denominator) << DMA_TIMER0_Y_LSB);
}

Expand Down

0 comments on commit 5be87f1

Please sign in to comment.