📄 hostc_callbacks.htm
字号:
<html><!-- InstanceBegin template="/Templates/helpnav.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Host 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" -->Host
Driver Callbacks<!-- InstanceEndEditable --> </p>
</font></td>
<td><!-- InstanceBeginEditable name="NavBack" --><A href="hostc_structure.htm"><img
src="Images/leftarrow.gif" width="27" height="32" border="0" alt=""></A>
<!-- InstanceEndEditable --></td><td><!-- InstanceBeginEditable name="Nav" --><A href="hostc_sd_requests.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" --> <OBJECT
type="application/x-oleobject"
classid="clsid:1e2a7bd0-dab9-11d0-b93a-00c04fc99f9e">
<PARAM name="Keyword" value="Host Driver Callbacks" name="">
</OBJECT>
<p class="BODYTEXT">HCDs provide a hardware-independent
programming interface to the SDIO core through a pair of
callbacks. The core issues generalized SD/SDIO bus and
configuration requests through the
callbacks. HCD carries out the necessary hardware
actions to fullfill the request. </p>
<p class="BODYTEXT"><strong>Configuration:</strong></p>
<p class="BODYTEXT">The configuration request callback has the
following prototype:</p>
<FONT face="Courier New" size="2">
<P>SDIO_STATUS (*<a href="HD_Reference.htm#FUNC_Configure">pConfigure</a>)(struct _SDHCD *pHcd, PSDCONFIG pConfig);</P>
</FONT>
<p class="BODYTEXT">The callback is passed a pointer to the registered
<FONT face="Courier New">SDHCD</FONT> structure and a configuration
request, <FONT face="Courier New">pConfig</FONT>. The HCD
instance specific context is stored in the <FONT face="Courier New">pContext</FONT>
field of the <FONT face="Courier New">SDHCD</FONT> structure
(initialized by the HCD). The configuration request comprises of
three fields: the command code (<FONT face="Courier New">Cmd</FONT>),
the configuration data (<FONT face="Courier New">pData</FONT>) and the
length of the configuration data (<FONT face="Courier New">DataLength</FONT>).
HCDs should cast the <FONT face="Courier New">pData</FONT> field to
the appropriate data type that is specific to the command code.
The HCD should decode the command code and process the request.
The SDIO core guarantees that only one configuration request can be
processed at a time. All configuration requests must be
processed synchronously and completed before the callback returns.</p>
<p class="BODYTEXT">Configuration requests consist of standard and
custom requests. Custom requests can be setup between
peripheral and host controller driver for special
handling/features and are transparent to the SDIO core.
Most configuration requests occur at card setup however some
configurations occur throughout normal operation (i.e. SDIO card
interrupt acknowledgement). Standard configuration requests are
described in the <A href="hostc_configuration.htm">Host Driver
Configuration</A> section.</p>
<P class="BODYTEXT">An example of a typical host configuration
callback can be found in the reference section under: pConfigure.</P>
<P class="BODYTEXT"><STRONG>Requests:</STRONG></P>
<p class="BODYTEXT">The request callback has the following prototype:</p>
<p class="BODYTEXT"><FONT face="Courier New">SDIO_STATUS
(*<a href="HD_Reference.htm#FUNC_Request">pRequest</a>)(struct _SDHCD *pHcd);</FONT></p>
<p class="BODYTEXT">The request callback is called when ever the SDIO
core or peripheral driver(s) has queued a bus request. A bus
request consists of an SD/SDIO command, an expected response and 1 or
more blocks of data (read or write). All bus requests are
serialized through a queue setup for each <FONT face="Courier New">SDHCD</FONT>
structure. Bus requests are generalized transactions and the HCD
relies on upper level software to build the appropriate command
arguments and process the response and/or data. The HCD
is required to program the hardware to issue the command, collect
the response and proceed with the data transfer, if
required. Bus requests are handled asynchronously and
completion must be indicated when the transfer completes.
Details on request processing can be found in the section: <A
href="hostc_sd_requests.htm">Host Driver Request Processing</A>.</p>
<p class="BODYTEXT">An example of a typical host request callback can
be found in the reference section under: pRequest. <br>
</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 + -