MI_DmaCopy

# MI_VBlankDmaCopy*

## C Specification

      #include <nitro/mi.h>

      void MI_VBlankDmaCopy32( u32 dmaNo, const void* src, void* dest, u32 size );

      void MI_VBlankDmaCopy16( u32 dmaNo, const void* src, void* dest, u32 size );

      void MI_VBlankDmaCopy32Async( u32 dmaNo, const void* src, void* dest, u32 size,
                            MIDmaCallback callback, void* arg );

      void MI_VBlankDmaCopy16Async( u32 dmaNo, const void* src, void* dest, u32 size,
                            MIDmaCallback callback, void* arg );

## Description

This function uses DMA to copy a V-Blank. When a V-Blank starts, DMA starts.

- `MI_VBlankDmaCopy16()` and `MI_VBlankDmaCopy16Async()` copy in units of 16 bits. The transfer source and transfer destination addresses must be 2-byte aligned.

- `MI_VBlankDmaCopy32()` and `MI_VBlankDmaCopy32Async()` copy in units of 32 bits. The transfer source address and transfer destination address must be 4-byte aligned.

- `MI_VBlankDmaCopy16()` and `MI_VBlankDmaCopy32()` start DMA and end it when a V-blank is generated.

- `MI_VBlankDmaCopy16Async()` and `MI_VBlankDmaCopy32Async()` start DMA when a V-blank is generated and call a callback when ending DMA. The callback is the `MIDmaCallback` type (a void-type function that takes one void* argument).

To fully exploit the features of an Async-type API, you must understand how to use it.

## Internal Operation

Uses the following IO registers:

- DMAn source register (0x40000B0 + 12n)
- DMAn destination register (0x40000B4 + 12n)
- DMAn control register (0x40000B8 + 12n)
  (n is the DMA channel used)

## Arguments

`dmaNo` | DMA channel used
`src` | Transfer source address
`dest` | Transfer destination address
`size` | Transfer size
`callback` | Callback when ending DMA
`arg` | Callback argument when ending DMA

## Return Values

None.

## See Also

`MI_DmaCopy*`

## Revision History

10/18/2004 Added 2 arguments and expanded the C Spec and Description.
12/01/2003 Initial version.