# MI_SetNDmaArbitrament

## Syntax

  `#include <twl/mi.h>`
  `void MI_SetNDmaArbitrament( u32 mode, u32 cycle );`

## Arguments

mode | The arbitration method of new DMA.
cycle | The number of cycles (only valid when the arbitration method of the new DMA is round-robin).

## Return Values

None.

## Description

Specifies the DMA arbitration method for the TWL's new DMA.

In mode, specify the arbitration method.

`MI_NDMA_ARBITRAMENT_FIX` | Fixed method
`MI_NDMA_ARBITRAMENT_ROUND` | Round-robin method

cycle is meaningful when the round-robin method is specified as the mode. When using the fixed method, it has no meaning regardless of the value.

`MI_NDMA_RCYCLE_0` | 0 cycles
`MI_NDMA_RCYCLE_1` | 1 cycle
`MI_NDMA_RCYCLE_2` | 2 cycles
`MI_NDMA_RCYCLE_4` | 4 cycles
`MI_NDMA_RCYCLE_8` | 8 cycles
`MI_NDMA_RCYCLE_16` | 16 cycles
`MI_NDMA_RCYCLE_32` | 32 cycles
`MI_NDMA_RCYCLE_64` | 64 cycles
`MI_NDMA_RCYCLE_128` | 128 cycles
`MI_NDMA_RCYCLE_256` | 256 cycles
`MI_NDMA_RCYCLE_512` | 512 cycles
`MI_NDMA_RCYCLE_1024` | 1024 cycles
`MI_NDMA_RCYCLE_2048` | 2048 cycles
`MI_NDMA_RCYCLE_4096` | 4096 cycles
`MI_NDMA_RCYCLE_8192` | 8192 cycles
`MI_NDMA_RCYCLE_16384` | 16384 cycles

cycle will be reflected in the actual setting at the point in time when there are no DMA startup requests for any of the DMA channels.

> Example:
> `//---- Fixed method
> MI_SetNDmaArbitrament(MI_NDMA_ARBITRAMENT_FIX, 0/*dummy*/);
> //---- Round-robin method
> MI_SetNDmaArbitrament(MI_NDMA_ARBITRAMENT_ROUND, MI_NDMA_RCYCLE_32);`

## Internal Operation

Accesses the DMA_GCNT register.

## See Also

`MI_GetNDmaArbitrament, MI_GetNDmaArbitramentRoundRobinCycle
`

## Revision History

2007/09/07 Initial version.

CONFIDENTIAL