# WM_Initialize

## C Specification

      #include <nitro/wm.h>

      WMErrCode WM_Initialize(
              void*           wmSysBuf ,
              WMCallbackFunc  callback ,
              u16             dmaNo );

## Description

Initializes the WM library and starts the wireless hardware

If the return value is `WM_ERRCODE_OPERATING`, a callback is generated after the initialization process is complete. This function changes the WM from the `READY` state to the `IDLE` state.

Do not free `wmSysBuf` until `WM_Finish` or `WM_End` ends successfully.

Note that this function calls `WM_PowerOff`, `WM_Disable`, and `WM_Finish`. Use these functions separately for low-level control of the termination process.

## Arguments

`wmSysBuf` | A pointer to the buffer that was allocated by the caller. The buffer size must be `WM_SYSTEM_BUF_SIZE` and 32-byte aligned.
`callback` | The callback function to call when this asynchronous process completes.
`dmaNo` | The DMA number that the WM uses.

## Return Values

Returns the process result as a `WMErrCode` enumerated value.

## Callback

If the API's return value is `WM_ERRCODE_OPERATING`, a callback is generated after the initialization process completes.

## See Also

`WM_SetIndCallback`, `WM_Reset`, `WM_End`, `WM_Init`, `WM_Enable`, `WM_PowerOn`

## Revision History

10/22/2004 Changed return value type
07/29/2004 Added descriptions
07/23/2004 Initial version