# MI_InitDevice

## Syntax

  `#include <nitro/mi.h>
  void MI_InitDevice(MIDevice *device, void *userdata, MIDeviceReadFunction read, MIDeviceWriteFunction write);`

## Arguments

device | Pointer to the `MIDevice` structure to be initialized.
userdata | Any user-defined value to be linked with the structure.
read | The pointer to the callback function that will be used for read access.
device | The pointer to the callback function that will be used for write access.

## Return Values

None.

## Description

Specifies the callbacks to use for read and write access and a freely configurable argument, and initializes the `MIDevice` structure.
Calling `MI_ReadDevice()` or `MI_WriteDevice()` with this structure will cause the callback functions to be called directly.

This is a utility feature designed to separate the device control component from the module design. For more information, see the reference for the `MIDevice` structure.

## See Also

`MI_ReadDevice, MI_WriteDevice
MIDevice, MIDeviceReadFunction, MIDeviceWriteFunction
`

## Revision History

2007/05/09 Initial version.

CONFIDENTIAL