📄 periph_callbacks.htm
字号:
<html><!-- InstanceBegin template="/Templates/helpnav.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Function Driver Callbacks</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 Callbacks<!-- InstanceEndEditable --> </p>
</font></td>
<td><!-- InstanceBeginEditable name="NavBack" --><a href="periph_structure.htm"><img src="Images/leftarrow.gif" width="27" height="32" border="0"></a><!-- InstanceEndEditable --></td><td><!-- InstanceBeginEditable name="Nav" --><a href="periph_io_requests.htm"><img src="Images/rightarrow.gif" width="27" height="32" border="0"></a><!-- InstanceEndEditable --></td>
</tr>
</table>
<hr>
<table width="100%" border="0" cellspacing="0" cellpadding="15">
<tr><td>
<!-- InstanceBeginEditable name="Help Content" -->
<OBJECT type="application/x-oleobject" classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<param name="Keyword" value="Function Driver Callbacks">
</OBJECT>
<p class="BODYTEXT">Once registered, the card function driver can expect one
or more callbacks to be called. The callbacks are provides in an <font face="Courier New, Courier, mono">SDFUNCTION</font> structure
provided by the driver. Each callback is described below:</p>
<p class="BODYTEXT"><strong>Probe:</strong></p>
<p class="BODYTEXT">The probe function is called when the driver's registered
plug and play identifiers match a function(s) on any cards present
in the system. The
plug and play identifier can be based on a function class, ManufacturerID/CardID/Function
Index combination, or card type (MMC or SDIO). The job of the function driver
in it's probe callback is to determine whether it will accept the card (returns
TRUE). The probe callback also provides an opportunity for the driver to initialize
the card function and setup any OS or application specific interfaces. Because
of this, most probe functions are implemented in the OS-dependent portion of
a
driver. The probe function is passed a reference to the <font face="Courier New, Courier, mono">SDFUNCTION</font> structure
that was registered and a new <font face="Courier New, Courier, mono">PSDDEVICE</font> reference.
This reference points to an internal structure and should be treated as an
opaque object and should
only be accessed through stack supplied functions and macros. This reference
is used in many SDIO core functions to configure and issue I/O requests. </p>
<p class="BODYTEXT">The probe callback is where the function driver initializes
function-specific registers and enables the card. The first thing a driver
must do before accessing function-specific registers is to enable the card.
This sets the I/O enable bit in the card-wide enable register. The driver must
issue a <font face="Courier New, Courier, mono">SDCONFIG_FUNC_ENABLE_DISABLE</font> configuration
request with an <font face="Courier New, Courier, mono">SDCONFIG_FUNC_ENABLE_DISABLE_DATA</font> structure
specifying the timeout to use in polling for the function ready bit. Function
drivers should not set or poll these registers directly and should leave that
to the SDIO Core.</p>
<p class="BODYTEXT">.The driver can also search for function-specific tuples
using the<font face="Courier New, Courier, mono"> <a href="PD_Reference.htm#FUNC_SDLIB_FindTuple">SDLIB_FindTuple()</a> </font>method.
The caller must pass in the starting CIS address obtained from it's <font face="Courier New, Courier, mono">PSDDEVICE</font> reference.
This address can be obtained using the macro <font face="Courier New, Courier, mono"><a href="PD_Reference.htm#FUNC_SDDEVICE_GET_SDIO_FUNC_CISPTR">SDDEVICE_GET_SDIO_FUNC_CISPTR()</a></font>. </p>
<p class="BODYTEXT"><strong>Remove:</strong></p>
<p class="BODYTEXT">The remove function is the converse of Probe. The driver
is passed the <font face="Courier New, Courier, mono">PSDDEVICE</font> reference that represents the instance that was removed.
The function driver must cleanup (undo) what was performed in the probe function.</p>
<p class="BODYTEXT"><strong>Interrupts:</strong></p>
<p class="BODYTEXT">SDIO function drivers can register an interrupt handler to
be called when a card function generates an interrupt request. The registration
of this handler is done with the <font face="Courier New, Courier, mono">PSDDEVICE</font> reference
obtained from the Probe function. A function driver associates each <font face="Courier New, Courier, mono">PSDDEVICE</font> with an interrupt handler. A discussion of interrupt processing is provided
in later topics.</p>
<p class="BODYTEXT">See Also: <a href="PD_Reference.htm#FUNC_Probe">Probe()</a>, <a href="PD_Reference.htm#FUNC_Remove">Remove()</a></p>
<p class="BODYTEXT"> </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 + -