1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html>
3<head>
4<META http-equiv="Content-Type" content="text/html; charset=windows-1252">
5<META name="GENERATOR" content="IBM WebSphere Studio Homepage Builder Version 7.0.0.0 for Windows">
6<META http-equiv="Content-Style-Type" content="text/css">
7<title>MI_ReadDevice</title>
8<link rel="stylesheet" href="../../css/nitro.css" type="text/css" />
9</head>
10<body>
11<h1>MI_ReadDevice <IMG src="../../image/NTR.gif" align="middle"><IMG src="../../image/TWL.gif" align="middle"></h1>
12<h2>Syntax</h2>
13<dl>
14  <dd>
15<code>#include &lt;nitro/mi.h&gt;<br />
16  <br />
17  int MI_ReadDevice(<A href="MIDevice.html">MIDevice</A> *device, void *buffer, u32 offset, u32 length);</code></dd>
18</dl>
19
20<h2>Arguments</h2>
21<table border="1" width="100%">
22  <tbody>
23    <tr>
24      <td width="13%"><em><strong>device</strong></em></td>
25      <td width="87%">Pointer to the <A href="MIDevice.html"><CODE>MIDevice</CODE></A> structure to access.<br />
26      The device must have been initialized using <A href="MI_InitDevice.html"><CODE>MI_InitDevice()</CODE></A>.</td>
27    </tr>
28    <tr>
29      <td width="13%"><em><strong>buffer</strong></em></td>
30      <td width="87%">The destination memory to store the loaded data.</td>
31    </tr>
32    <tr>
33      <td width="13%"><em><strong>offset</strong></em></td>
34      <td width="87%">The start address of the device to which data should be read.</td>
35    </tr>
36    <tr>
37      <td width="13%"><em><strong>length</strong></em></td>
38      <td width="87%">Data size to load.</td>
39    </tr>
40  </TBODY>
41</table>
42
43<h2>Return Values</h2>
44<p>If the function succeeds, it will return the actual amount of data that has been read. If it fails, it will return a negative value.</p>
45
46<h2>Description</h2>
47<p>Reads data from a device using the <A href="MIDevice.html"><CODE>MIDevice</CODE></A> structure.<br />Internally, this just calls the callback function for reads specified in <A href="MI_InitDevice.html"><CODE>MI_InitDevice()</CODE></A>.</p>
48<p>
49This is a utility feature designed to separate the device control component from the module design. For more information, see the reference for the <a href="MIDevice.html"><CODE>MIDevice</CODE></a> structure.
50</p>
51
52<h2>See Also</h2>
53<p><code><a href="MI_InitDevice.html">MI_InitDevice</a>, <a href="MI_WriteDevice.html">MI_WriteDevice</a><br /> <a href="MIDevice.html">MIDevice</a>, <a href="MIDeviceReadFunction.html">MIDeviceReadFunction</a>, <a href="MIDeviceWriteFunction.html">MIDeviceWriteFunction</a><br /></code></p>
54<h2>Revision History</h2>
55<p>
562007/05/09 Initial version.
57</p>
58<hr><p>CONFIDENTIAL</p></body>
59</html>
60