⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pd_reference.htm

📁 SDIO Linux documentation
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
<meta content="text/html; charset=iso-8859-1" http-equiv="Content-Type">
<link type="text/css" rel="stylesheet" href="CodeTHelp.css">
</head>
<body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" bgcolor="#FFFFFF">
<a name="FUNC_Probe"></a>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#0000FF" rowspan="2" width="40%"><a href="http://www.codetelligence.com"><img border="0" height="40" width="252" name="image" src="Images/codetelligence_lrg.gif"></a></td><td bgcolor="#0000FF" height="62" width="50%"><font face="Arial, Helvetica, sans-serif" size="5" color="#FFFFFF"><strong>Codetelligence Embedded SDIO Stack<br>Function Driver Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="PD_Reference_overview.htm"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_Remove"><img border="0" height="32" width="27" src="Images/rightarrow.gif"></a></td></td>
</tr>
</table>
<table cellpadding="0" cellspacing="10" border="0" width="100%">
<tr>
<td width="93%"><font face="Arial, Helvetica, sans-serif"><span class="Topic">
<blockquote>
<table width="100%" cellspacing="0" cellpadding="0">
<td>
<br>
<pre>
<span class="FUNCPROTOTYPE">
 BOOL (*pProbe)(struct _SDFUNCTION *pFunction, struct _SDDEVICE *pDevice)
        </span>
</pre>
</td>
</table>
</blockquote>
</span></font></td>
</tr>
</table>
<hr>
<table cellpadding="15" cellspacing="0" border="0" width="100%">
<tr>
<td>
<p class="FUNCHEADINGS">Description:</p>
<blockquote>
<p class="BODYTEXT">This function is called by the Busdriver when a device is inserted that can be supported by this function driver.</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
  pFunction - the function definition structure that was passed to Busdriver
                       via the SDIO_RegisterFunction.
        <br>
  pDevice   - the description of the newly inserted device.            
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT">
 none
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Returns:</p>
<blockquote>
<p class="BODYCODE">
 TRUE  - this function driver will suport this device
           FALSE - this function driver will not support this device
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="FUNCHEADINGS">Notes:</p>
<blockquote>
<p class="BODYTEXT">
 The Busdriver calls the Probe function of a function driver to inform it that device is
          available for the function driver to control. The function driver should initialize the 
          device and be pepared to acceopt any interrupts from the device before returning.
        <br>
</p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>

<font face="Arial, Helvetica, sans-serif" color="#FF00FF"> Example of typical Probe function callback:</font>
  static BOOL Probe(PSDFUNCTION pFunction, PSDDEVICE pDevice) { 
       <font face="Arial, Helvetica, sans-serif" color="#999999">...get the our context info passed into the SDIO_RegisterFunction
</font>    PSDXXX_DRIVER_CONTEXT pFunctionContext = 
                                (PSDXXX_DRIVER_CONTEXT)pFunction-&gt;pContext;
    SDIO_STATUS status;
       <font face="Arial, Helvetica, sans-serif" color="#999999">//test the identification of this device and ensure we want to support it
</font>       <font face="Arial, Helvetica, sans-serif" color="#999999">// we can test based on class, or use more specific tests on SDIO_ManufacturerID, etc.
</font>    if (pDevice-&gt;pId[0].SDIO_FunctionClass == XXX) {
        DBG_PRINT(SDDBG_TRACE, ("SDIO XXX Function: Probe - card matched (0x%X/0x%X/0x%X)\n",
                                pDevice-&gt;pId[0].SDIO_ManufacturerID,
                                pDevice-&gt;pId[0].SDIO_ManufacturerCode,
                                pDevice-&gt;pId[0].SDIO_FunctionNo));
        ..
        </pre>
</p>
</blockquote>
<p class="FUNCHEADINGS">See also:</p>
<blockquote>
<p class="BODYTEXT">
<a href="#FUNC_SDIO_RegisterFunction">
SDIO_RegisterFunction
        </a>
<br>
<a href="#FUNC_Remove">
Remove
        </a>
<br>
</p>
</blockquote>
</td>
</tr>
</table>
<a name="FUNC_Remove"></a>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#0000FF" rowspan="2" width="40%"><a href="http://www.codetelligence.com"><img border="0" height="40" width="252" name="image" src="Images/codetelligence_lrg.gif"></a></td><td bgcolor="#0000FF" height="62" width="50%"><font face="Arial, Helvetica, sans-serif" size="5" color="#FFFFFF"><strong>Codetelligence Embedded SDIO Stack<br>Function Driver Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="#FUNC_Probe"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_SDCONFIG_BUS_MODE_CTRL"><img border="0" height="32" width="27" src="Images/rightarrow.gif"></a></td></td>
</tr>
</table>
<table cellpadding="0" cellspacing="10" border="0" width="100%">
<tr>
<td width="93%"><font face="Arial, Helvetica, sans-serif"><span class="Topic">
<blockquote>
<table width="100%" cellspacing="0" cellpadding="0">
<td>
<br>
<pre>
<span class="FUNCPROTOTYPE">
 void (*pRemove)(struct _SDFUNCTION *pFunction, struct _SDDEVICE *pDevice)
        </span>
</pre>
</td>
</table>
</blockquote>
</span></font></td>
</tr>
</table>
<hr>
<table cellpadding="15" cellspacing="0" border="0" width="100%">
<tr>
<td>
<p class="FUNCHEADINGS">Description:</p>
<blockquote>
<p class="BODYTEXT">This function is called by the Busdriver when a device controlled by this function              function driver is removed.</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
  pFunction - the function definition structure that was passed to Busdriver
                       via the SDIO_RegisterFunction.
        <br>
  pDevice   - the description of the device being removed.
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT">
 none
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Returns:</p>
<blockquote>
<p class="BODYCODE">
 none
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="FUNCHEADINGS">Notes:</p>
<blockquote>
<p class="BODYTEXT">
 The Busdriver calls the Remove function of a function driver to inform it that device it
          was supporting has been removed. The device has already been removed, so no further I/O
          to the device can be performed.
        <br>
</p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>

<font face="Arial, Helvetica, sans-serif" color="#FF00FF"> Example of typical Remove function callback:</font>
    void Remove(PSDFUNCTION pFunction, PSDDEVICE pDevice) {
            <font face="Arial, Helvetica, sans-serif" color="#999999">// get the our context info passed into the SDIO_RegisterFunction
</font>        PSDXXX_DRIVER_CONTEXT pFunctionContext = 
                             (PSDXXX_DRIVER_CONTEXT)pFunction-&gt;pContext;
           <font face="Arial, Helvetica, sans-serif" color="#999999">...free any acquired resources</font>s
        </pre>
</p>
</blockquote>
<p class="FUNCHEADINGS">See also:</p>
<blockquote>
<p class="BODYTEXT">
<a href="#FUNC_SDIO_RegisterFunction">
SDIO_RegisterFunction
        </a>
<br>
<a href="#FUNC_Probe">
Probe
        </a>
<br>
</p>
</blockquote>
</td>
</tr>
</table>
<a name="FUNC_SDCONFIG_BUS_MODE_CTRL"></a>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#0000FF" rowspan="2" width="40%"><a href="http://www.codetelligence.com"><img border="0" height="40" width="252" name="image" src="Images/codetelligence_lrg.gif"></a></td><td bgcolor="#0000FF" height="62" width="50%"><font face="Arial, Helvetica, sans-serif" size="5" color="#FFFFFF"><strong>Codetelligence Embedded SDIO Stack<br>Function Driver Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="#FUNC_Remove"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_SDCONFIG_FUNC_ACK_IRQ"><img border="0" height="32" width="27" src="Images/rightarrow.gif"></a></td></td>
</tr>
</table>
<table cellpadding="0" cellspacing="10" border="0" width="100%">
<tr>
<td width="93%"><font face="Arial, Helvetica, sans-serif"><span class="Topic">
<blockquote>
<table width="100%" cellspacing="0" cellpadding="0">
<td>
<br>
<pre>
<span class="FUNCPROTOTYPE">
 SDCONFIG_BUS_MODE_CTRL
        </span>
</pre>
</td>
</table>
</blockquote>
</span></font></td>
</tr>
</table>
<hr>
<table cellpadding="15" cellspacing="0" border="0" width="100%">
<tr>
<td>
<p class="FUNCHEADINGS">Description:</p>
<blockquote>
<p class="BODYTEXT">Set the bus mode for the SD/SDIO card.</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
  none
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT">
 none
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Returns:</p>
<blockquote>
<p class="BODYCODE">
 SDIO Status
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="FUNCHEADINGS">Notes:</p>
<blockquote>
<p class="BODYTEXT">
     This command code is used in the SDLIB_IssueConfig() API.  The command
          alters the card's bus mode (width and clock rate) to a driver specified
          value.  The driver must read the current bus mode flags, modify if necessary
          and pass the value in the SDCONFIG_BUS_MODE_DATA structure. 
              If the bus width is changed (1 or 4 bit) the caller must adjust the mode flags 
          for the new width. Cards cannot be switched between 1/4 bit and SPI mode.  
          Switching to or from SPI mode requires a power cycle. Adjustments to the clock 
          rate is immediate on the next bus transaction.  The actual clock rate value is
          limited by the host controller and is reported in the ClockRate field when the
          command completes successfully.          
              The bus mode change is card wide and may affect other SDIO functions on 
          multi-function cards. Use this feature with caution. This feature should NOT be
          used to dynamically control clock rates during runtime and should only be used
          at card initialization.
        <br>
</p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>

<font face="Arial, Helvetica, sans-serif" color="#FF00FF"> Example of changing the clock rate:</font>
    SDCONFIG_BUS_MODE_DATA  busSettings;
    ZERO_OBJECT(busSettings);
       <font face="Arial, Helvetica, sans-serif" color="#999999">// get current bus flags and keep the same bus width
</font>    busSettings.BusModeFlags = SDDEVICE_GET_BUSMODE_FLAGS(pInstance-&gt;pDevice);
    busSettings.ClockRate = 8000000;  <font face="Arial, Helvetica, sans-serif" color="#999999">// adjust clock to 8 Mhz
</font>       <font face="Arial, Helvetica, sans-serif" color="#999999">// issue config request to override clock rate
</font>    status = SDLIB_IssueConfig(pInstance-&gt;pDevice,
                               SDCONFIG_BUS_MODE_CTRL
                               &amp;busSettings
                               sizeof(SDCONFIG_BUS_MODE_DATA));
        </pre>
</p>
</blockquote>
<p class="FUNCHEADINGS">See also:</p>
<blockquote>
<p class="BODYTEXT">
<a href="#FUNC_SDDEVICE_GET_BUSMODE_FLAGS">
SDDEVICE_GET_BUSMODE_FLAGS
        </a>
<br>
<a href="#FUNC_SDLIB_IssueConfig">
SDLIB_IssueConfig
        </a>
<br>
</p>
</blockquote>
</td>
</tr>
</table>
<a name="FUNC_SDCONFIG_FUNC_ACK_IRQ"></a>
<table cellpadding="4" cellspacing="0" border="0" width="100%">
<tr>
<td bgcolor="#0000FF" rowspan="2" width="40%"><a href="http://www.codetelligence.com"><img border="0" height="40" width="252" name="image" src="Images/codetelligence_lrg.gif"></a></td><td bgcolor="#0000FF" height="62" width="50%"><font face="Arial, Helvetica, sans-serif" size="5" color="#FFFFFF"><strong>Codetelligence Embedded SDIO Stack<br>Function Driver Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="#FUNC_SDCONFIG_BUS_MODE_CTRL"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_SDCONFIG_FUNC_ALLOC_SLOT_CURRENT"><img border="0" height="32" width="27" src="Images/rightarrow.gif"></a></td></td>
</tr>
</table>
<table cellpadding="0" cellspacing="10" border="0" width="100%">
<tr>
<td width="93%"><font face="Arial, Helvetica, sans-serif"><span class="Topic">
<blockquote>
<table width="100%" cellspacing="0" cellpadding="0">
<td>
<br>
<pre>
<span class="FUNCPROTOTYPE">
 SDCONFIG_FUNC_ACK_IRQ 
        </span>
</pre>
</td>
</table>
</blockquote>
</span></font></td>
</tr>
</table>
<hr>
<table cellpadding="15" cellspacing="0" border="0" width="100%">
<tr>
<td>
<p class="FUNCHEADINGS">Description:</p>
<blockquote>
<p class="BODYTEXT">Acknowledge that the function's IRQ has been handled</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
  none
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT">
 none
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Returns:</p>
<blockquote>
<p class="BODYCODE">
 SDIO Status

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -