# MI_DmaSend*

## C Specification

      #include <nitro/mi.h>

      void MI_DmaSend32( u32 dmaNo, const void* src, volatile void* dest, u32
      size );
      void MI_DmaSend16( u32 dmaNo, const void* src, volatile void* dest, u32
      size );
      void MI_DmaSend32Async( u32 dmaNo, const void* src, void* dest, u32 size,
      MIDmaCallback callback, void* arg );
      void MI_DmaSend16Async( u32 dmaNo, const void* src, void* dest, u32 size,
      MIDmaCallback callback, void* arg );

## Description

This function uses DMA to send data to the same address.
Without changing the transfer target address, it increments only the transfer source address and repeatedly sends contiguous region data to the same address.

`MI_DmaSend16()` and `MI_DmaSend16Async()` transfer in 16-bit units. The transfer source and destination addresses must be 2-byte aligned.
`MI_DmaSend32()` and `MI_DmaSend32Async()` transfer in 32-bit units. The transfer source and destination addresses must be 4-byte aligned.

The `MI_DmaSend16()` and `MI_DmaSend32()` functions internally wait for DMA to finish.
`MI_DmaSend16Async()` and `MI_DmaSend32Async()` call callback when DMA finishes. Callback is a `MIDmaCallback` type (a void type function that takes one void* argument).

In order to extract Async type API functionality, you must sufficiently understand how it is used.

## Internal Operation

The following IO registers are used: DMAn source register (0x40000B0 + 12n), DMAn destination register (0x40000B4 + 12n), and DMAn control register (0x40000B8 + 12n), where n is the DMA channel that is used.

## Arguments

`dmaNo` | The DMA channel that will be used
`src` | The address of the transfer origin
`dest` | The address of the transfer destination
`size` | The size of the transfer
`callback` | The callback when DMA is finished
`arg` | The callback argument when DMA is finished

## Return Values

None.

## See Also

`MI_DmaCopy*, MI_DmaFill*, MI_DmaClear*, MI_CpuSend*`

## Revision History

10/18/2004 Corrected the C Spec.
01/30/2004 Initial version.