# MI_SetNDmaInterval

## Syntax

  `#include <twl/mi.h>`
  `void MI_SetNDmaInterval( u32 ndmaNo, u32 intervalTimer, u32 prescaler );`

## Arguments

ndmaNo | DMA number (0-3).
intervalTimer | Block transfer interval value (0-0xFFFF)
prescaler | Prescaler (MI_NDMA_INTERVAL_PS_n).

## Return Values

None.

## Description

Sets the block transfer interval value and prescaler when the TWL's new DMA is run.

The settings are made in the values of the internal DMA config structure (`MINDmaConfig`), and these values will be used thereafter unless the developer designates something else in other code. The target DMA is specified by ndmaNo.

intervalTimer is a down-counter. The larger this value is, the longer the interval will be. If 0, the block DMA will continue to run for the duration of the entire transfer word count.

prescaler is a prescaler for the counter, and takes the following values:

Value | Description
--- | ---
`MI_NDMA_INTERVAL_PS_1` | System clock (33.514 MHz)
`MI_NDMA_INTERVAL_PS_4` | 1/4th of the system clock
`MI_NDMA_INTERVAL_PS_16` | 1/16th of the system clock
`MI_NDMA_INTERVAL_PS_64` | 1/64th of the System Clock

If the DMA enable flag is 1, changes will be ignored.

## Internal Operation

Sets a value in the internal DMA config structure. When DMA is actually run, this will be set in the `DMAxBCNT` register.

## See Also

`MI_GetNDmaIntervalTimer, MI_GetNDmaIntervalPrescaler
`

## Revision History

2007/09/07 Initial version.

CONFIDENTIAL