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

## Description

This function uses DMA to zero-clear memory.

`MI_DmaClear16()` and `MI_DmaClear16Async()` fill memory with zeros in 16-bit units. The clear destination address must be 2-byte aligned.

`MI_DmaClear32()` and `MI_DmaClear32Async()` fill memory with zeros in 32-bit units. The clear destination address must be 4-byte aligned.

`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 function is a `MIDmaCallback` type (a `void` type function with an argument removed from `void*`).

## Internal Operation

This function calls `MI_DmaFill*`.

## Arguments

`dmaNo` | DMA channel used.
`dest` | Clear destination address.
`size` | Clear size.
`callback` | Callback when DMA ends.
`arg` | Callback argument when DMA ends.

## Return Values

None

## See Also

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

## Revision History

10/18/2004 Abbreviated the Internal Operation text.
12/01/2003 Initial version.