# 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 );`

## Arguments

dmaNo | DMA channel used
src | The transfer source address.
dest | The transfer destination address.
size | Transfer size
callback | Callback when DMA ends.
arg | Callback argument when DMA ends.

## Return Values

None.

## Description

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

`MI_VBlankDmaCopy16()` and `MI_VBlankDmaCopy16Async()` copy in units of 16 bits. Both the transfer source address and the transfer destination address must be 2-byte aligned. `MI_VBlankDmaCopy32()` and `MI_VBlankDmaCopy32Async()` copy in units of 32 bits. Both the transfer source address and the transfer destination address must be 4-byte aligned.

`MI_VBlankDmaCopy16()` and `MI_VBlankDmaCopy32()` start a DMA when a V-Blank is generated, and then wait for it to end. `MI_VBlankDmaCopy16Async()` and `MI_VBlankDmaCopy32Async()` start DMA when a V blank is generated and call a callback, `callback`, when ending DMA. The callback, `callback`, is a `MIDmaCallback` type (a `void` type function which takes one `void*` argument). callback is called from the system DMA interrupt handler and therefore is called while interrupts are prohibited.

It is necessary to understand how to use Async-type APIs in order to obtain maximum functionality.

## Internal Operation

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

## See Also

`MI_DmaCopy*
`

## Revision History

03/08/2005 Standardized the Japanese term for "interrupt."
12/22/2004 Added a description regarding `callback`.
12/01/2003 Initial version.

CONFIDENTIAL