📄 hostc_structure.htm
字号:
<html><!-- InstanceBegin template="/Templates/helpnav.dwt" codeOutsideHTMLIsLocked="false" -->
<head>
<!-- InstanceBeginEditable name="doctitle" -->
<title>Host 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" -->Host
Controller Driver Structure <!-- InstanceEndEditable --> </p>
</font></td>
<td><!-- InstanceBeginEditable name="NavBack" --><A href="hostc_development_overview.htm"><img
src="Images/leftarrow.gif" width="27" height="32" border="0" alt=""></A>
<!-- InstanceEndEditable --></td><td><!-- InstanceBeginEditable name="Nav" --><A href="hostc_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 host controller driver is typically
partitioned into OS independent and dependent portions. The
independent portion deals with the SDIO Core (bus driver) interfaces;
primarily the SDIO configuration and SD request processing. The
OS-dependent portion deals with host driver registration, hardware
resources and OS-specific interfaces (ex. module
registration, interrupt handling and interrupt
synchronization). Some hardware access can be performed in the
OS-independent portion as shown in some of the sample
drivers. </p>
<p class="BODYTEXT">HCDs are software modules, loaded by the operating
system, that registers with the SDIO core using the <font
face="Courier New"><a href="HD_Reference.htm#FUNC_SDIO_RegisterHostController">SDIO_RegisterHostController</a></font>()
API.
HCDs are drivers in themselves and are subordinate to the bus in which
their controller resides on (local bus, PCI bus). Each
operating system will require the HCD to perform some amount of
registration and resource acquisition. The HCD should register
with the SDIO core only after it has successfully
performed all the necessary initialization tasks and
should expect configuration and SD bus requests before the <font
face="Courier New"><a href="HD_Reference.htm#FUNC_SDIO_RegisterHostController">SDIO_RegisterHostController()</a></font> function
returns. An HCD can deregister itself (for unloading purposes)
using the <font face="Courier New"><a href="HD_Reference.htm#FUNC_SDIO_UnregisterHostController">SDIO_UnregisterHostController()</a></font>
function. </p>
<p class="BODYTEXT">The SDIO stack can accept an unlimited number of
host controller drivers with each host registering a
separate <font face="Courier New">SDHCD</font> structure
. The SDIO stack supports a point-to-point bus
implementation where only one card can be present in any
given electrical interface. In a multi-slot
implementation a host interface exists on each slot that contains a
separate clock, command/data signals and power control. If
a controller implements multiple
and electrically independent slot interfaces (i.e. Standard
Host Controller), the HCD must report and register each slot as a separate
host controller instance, even if all slots share the same
capabilities. The SDIO core uses a 1-to-1 relationship
between cards and host controller instances. </p>
<p class="BODYTEXT"><a name="SDHCDStruct"><strong>SDHCD Structure:</strong></a><strong>
</strong></p>
<p class="BODYTEXT">The <font face="Courier New">SDHCD</font>
structure is allocated by the HCD and registered with
the SDIO core. The structure contains flags and fields
describing the host controller hardware capabilities
and callbacks for configuration and request processing. The
key fields of the <font face="Courier New, Courier, mono">SDHCD</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>
<p><font face="Courier New" size="2"><strong>Field</strong></font></p>
</td>
<td><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
host controller 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">Attributes</font></p>
</td>
<td><font face="Arial">Host Controller attribute flags.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">MaxBytesPerBlock</font></p>
</td>
<td><font face="Arial">Maximum number of bytes per block for
read/write transactions.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2">MaxBlocksPerTrans</font></p>
</td>
<td><font face="Arial">Maximum number of blocks per SD bus request.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><font size="2">MaxSlotCurrent</font></font></p>
</td>
<td><font face="Arial">Maximum slot current (in mA).</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><font size="2">MaxClockRate</font></font></p>
</td>
<td><font face="Arial">Maximum SD/SDIO bus clock rate.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><font size="2">SlotVoltageCaps</font></font></p>
</td>
<td><font face="Arial">Slot voltage capabilities mask.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><font size="2">SlotVoltagePreferred</font></font></p>
</td>
<td><font face="Arial">Preferred slot voltage.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><font size="2">pContext</font></font></p>
</td>
<td><font face="Arial">Driver specific context for this host
controller structure instance.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><font size="2">pRequest</font></font></p>
</td>
<td><font face="Arial">SD Bus request callback function pointer.</font></td>
</tr>
<tr>
<td>
<p><font face="Courier New" size="2"><font size="2">pConfigure</font></font></p>
</td>
<td><font face="Arial">HCD configuration callback function pointer.</font></td>
</tr>
<tr>
<td><font size="2" face="Courier New, Courier, mono">pDmaDescription</font></td>
<td><font face="Arial, Helvetica, sans-serif">Pointer to an OS-dependent
DMA description structure (see DMA section)</font></td>
</tr>
</table>
<br>
<br>
<p class="BODYTEXT"><strong>Host Controller Attributes:</strong></p>
<p class="BODYTEXT">The SDIO stack can interface to host drivers
with varying hardware capabilities. Most hardware
capabilities are reported as a set of flags in the <font
face="Courier New">Attributes</font> field. The following table
of attribute flags can be OR'd together :</p>
<table style="WIDTH: 628px; HEIGHT: 279px" cellspacing="1"
cellpadding="1" width="628" border="1">
<tr>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -