# MI_DmaClear*

## C Specification

  `#include <nitro/mi.h>`
  `void MI_DmaClear32( u32 dmaNo, void* dest, u32 size );`
  `void MI_DmaClear16( u32 dmaNo, void* dest, u32 size );`
  `void MI_DmaClear32Async( u32 dmaNo, void* dest, u32 size,`
  `MIDmaCallback callback, void* arg );`
  `void MI_DmaClear16Async( u32 dmaNo, void* dest, u32 size,`
  `MIDmaCallback callback, void* arg );`

## Arguments

dmaNo | DMA channel used
dest | The address of the clear destination
size | Clear size
callback | Callback when DMA ends.
arg | Callback argument when DMA ends.

## Return Values

None.

## Description

Uses DMA to zero-clear memory.

`MI_DmaClear16()` and `MI_DmaClear16Async()` fill memory with zeros in 16-bit units. You must 2-byte align the clear destination address. `MI_DmaClear32()` and `MI_DmaClear32Async()` fill memory with zeros in 32-bit units. You must 4-byte align the clear destination address.

`MI_DmaClear16()` and `MI_DmaClear32()` wait within the function until DMA completes. `MI_DmaClear16Async()` and `MI_DmaClear32Async()` call a callback function when DMA ends. 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.

## Internal Operation

This function calls `MI_DmaFill*`.

## See Also

`MI_DmaCopy*`, `MI_DmaFill*`, `MI_DmaSend*`, `MI_CpuClear*`

## Revision History

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