mirror of
https://github.com/raspberrypi/pico-sdk.git
synced 2025-12-10 07:14:36 +01:00
Clarify that DMA timer fraction must be <= 1 (#1723)
This commit is contained in:
parent
0e5cef3ffa
commit
5be87f1e22
1 changed files with 3 additions and 1 deletions
|
|
@ -867,7 +867,8 @@ bool dma_timer_is_claimed(uint timer);
|
||||||
* \ingroup hardware_dma
|
* \ingroup hardware_dma
|
||||||
*
|
*
|
||||||
* The timer will run at the system_clock_freq * numerator / denominator, so this is the speed
|
* 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 timer the dma timer
|
||||||
* \param numerator the fraction's numerator
|
* \param numerator the fraction's numerator
|
||||||
|
|
@ -875,6 +876,7 @@ bool dma_timer_is_claimed(uint timer);
|
||||||
*/
|
*/
|
||||||
static inline void dma_timer_set_fraction(uint timer, uint16_t numerator, uint16_t denominator) {
|
static inline void dma_timer_set_fraction(uint timer, uint16_t numerator, uint16_t denominator) {
|
||||||
check_dma_timer_param(timer);
|
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);
|
dma_hw->timer[timer] = (((uint32_t)numerator) << DMA_TIMER0_X_LSB) | (((uint32_t)denominator) << DMA_TIMER0_Y_LSB);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue