📄 periph_structure.htm
字号:
<html><!-- InstanceBegin template="/Templates/helpnav.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Function Driver</title>
<!-- InstanceEndEditable -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<!-- InstanceParam name="HeaderColor" type="color" value="#0000FF" -->
<!-- InstanceParam name="FooterColor" type="color" value="#0000FF" -->
<!-- InstanceParam name="NavBackgroundColor" type="color" value="#FFFFFF" -->
<!-- InstanceParam name="BodyBackgroundColor" type="color" value="#FFFFFF" -->
<link href="CodeTHelp.css" rel="stylesheet" type="text/css">
</head><a name="TopTopic"></a>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%" border="0" cellspacing="0" cellpadding="4">
<tr>
<td width="40%" rowspan="2" bgcolor="#0000FF"><a href="http://www.codetelligence.com"><img src="Images/codetelligence_lrg.gif" name="image" width="252" height="40" border="0"></a></td>
<td width="60%" height="62" bgcolor="#0000FF">
<font color="#FFFFFF" size="5" face="Arial, Helvetica, sans-serif"><strong>Embedded SDIO Driver Kit Help </strong></font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="10" cellpadding="0">
<tr>
<td width="93%"><font face="Arial, Helvetica, sans-serif">
<p class="Topic"><!-- InstanceBeginEditable name="SubTemplate" -->Function
Driver Structure <!-- InstanceEndEditable --> </p>
</font></td>
<td><!-- InstanceBeginEditable name="NavBack" --><A href="peripheral_development_overview.htm"><img
src="Images/leftarrow.gif" width="27" height="32" border="0" alt=""></A>
<!-- InstanceEndEditable --></td><td><!-- InstanceBeginEditable name="Nav" --><A href="periph_callbacks.htm"><img
src="Images/rightarrow.gif" width="27" height="32" border="0" alt=""></A>
<!-- InstanceEndEditable --></td>
</tr>
</table>
<hr>
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr><td>
<!-- InstanceBeginEditable name="Help Content" -->
<p class="BODYTEXT">A function driver is typically partitioned into OS independent
and dependent portions. The independent portion typically deals with SDIO-specific
initialization and I/O processing
using the SDIO core API's. The dependent portion deals with initial
module loading, function driver registration, SDIO stack callbacks and
with the OS-specific interfaces (ex. network interface, file system,
character driver).</p>
<p class="BODYTEXT">The SDIO stack uses a two step loading process for
function drivers. The first step involves the OS loading the driver
module. This loading mechanism varies greatly between OS's and the
only requirement of the SDIO stack is that sometime during the loading
process a function driver registers a partially initialized <font
face="Courier New, Courier, mono">SDFUNCTION</font> structure using <A
href="PD_Reference.htm#FUNC_SDIO_RegisterFunction"><font
face="Courier New, Courier, mono">SDIO_RegisterFunction()</font></A>.
This structure contains operational parameters, a listing of plug and
play identifiers and a set of callbacks. Conversely, when a driver
unloads, it must call <A
href="PD_Reference.htm#FUNC_SDIO_UnregisterFunction"><font
face="Courier New, Courier, mono">SDIO_UnregisterFunction()</font></A>.
This first loading process, under most OSes, is NOT an indication that
a card function actually exists and should be claimed. It is merely a
method of registering a driver to handle an instance of a card
function when it arrives. The second step in the load process is the
driver acceptance of a card function when it arrives. This is handled
through a registered callback. The callbacks are discussed in the next
section.<br>
<br>
The
key fields of the <font face="Courier New, Courier, mono">SDFUNCTION</font> structure are described in the following table: </p>
<table style="WIDTH: 635px; HEIGHT: 386px" cellspacing="1"
cellpadding="1" width="635" border="1">
<tr>
<td width="161">
<p><font face="Courier New" size="2"><strong>Field</strong></font></p>
</td>
<td width="461"><strong>Description</strong></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">Version</font></p>
</td>
<td><font face="Arial">SDIO Stack version code, the driver should set this
to the value of <font face="Courier New, Courier, mono">CT_SDIO_STACK_VERSION_CODE</font>
from the supplied header files. The bus driver only accepts
function drivers with the same MAJOR version number
and MINOR numbers that are less than or equal to the busdriver's
MINOR version number.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">MaxDevices</font></p>
</td>
<td><font face="Arial">The maximum number of function (or card) instances
this driver supports. Some hosts can support multiple
slots and this field can limit how many
instances of a card are supported in any given system.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">pIds</font></p>
</td>
<td><font face="Arial">Pointer to an array of plug and play ID structures
describing what device classes or card IDs this function
driver should be queried for.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><a href="PD_Reference.htm#FUNC_Probe">pProbe</a></font></p>
</td>
<td><font face="Arial">Function driver's probe callback that should be called
when a card or I/O function matches any of the supplied
plug and play IDs pointed to by <font face="Courier New, Courier, mono">pIds.</font></font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><a href="PD_Reference.htm#FUNC_Remove">pRemove</a></font></p>
</td>
<td><font face="Arial">Function driver's remove callback.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">pSuspend</font></p>
</td>
<td><font face="Arial">Function driver suspend callback (rsvd for future
use)</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">pResume</font></p>
</td>
<td><font face="Arial">Function driver resume callback (rsvd for future
use)</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">pContext</font></p>
</td>
<td><font face="Arial">Function driver specific context to store driver specific
information. Can be obtained from probe and remove callbacks.</font></td>
</tr>
</table>
</p>
<p><br>
</p>
<!-- InstanceEndEditable -->
<br/></table></td></tr>
<table width="100%" border="0" cellspacing="0" cellpadding="2" >
<tr> <td><div align="right"><a href="#TopTopic">Back to top</a></div></td></tr>
<tr bgcolor="#0000FF">
<td>
<font color="#FFFFFF"face="Arial, Helvetica, sans-serif"><strong>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -