raspberrypi / pico-sdk

BSD 3-Clause "New" or "Revised" License
3.25k stars 838 forks source link

dma_timer_set_fraction() inline docs refer to the fraction as a divider, but actually it's a multiplier #1677

Open myklemykle opened 3 months ago

myklemykle commented 3 months ago

Calling the fraction a divider insinuates that this function is analogous to, for instance, pwm_config_set_clkdiv_int_frac() . But that function divides clk_sys by a fraction, while dma_timer_set_fraction() multiplies clk_sys by a fraction.

I find it a little bit counterintuitive that RP2040 scales DMA timers with a multiplier and PWM timers with a divider, but that's what the datasheet says it does.

lurch commented 3 months ago

Links to #1678