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

📄 support_reference.htm

📁 SDIO Linux documentation
💻 HTM
📖 第 1 页 / 共 5 页
字号:
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT"></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 macro should only be called by the function associated with
          the helper object.  The function should call this function to suspend (block)
          itself and wait for a wake up signal. The function should always check 
          whether the function should exit by calling SD_IS_HELPER_SHUTTING_DOWN.
        <br>
</p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>
 block on the wake signal
        while(1) {
              status = SD_WAIT_FOR_WAKEUP(pHelper);
              if (!SDIO_SUCCESS(status)) {
                  break;
              }
              if (SD_IS_HELPER_SHUTTING_DOWN(pHelper)) {
                  <font face="Arial, Helvetica, sans-serif" color="#999999">... shutting down
</font>                  break;
              }
        
        </pre>
</p>
</blockquote>
<p class="FUNCHEADINGS">See also:</p>
<blockquote>
<p class="BODYTEXT">
SDLIB_OSCreateHelper , SD_IS_HELPER_SHUTTING_DOWN
        <br>
</p>
</blockquote>
</td>
</tr>
</table>
<a name="FUNC_SD_WAKE_OS_HELPER"></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>Support Functions Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="#FUNC_SD_WAIT_FOR_WAKEUP"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_SDLIB_CreateMessageQueue"><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">
 SD_WAKE_OS_HELPER(POSKERNEL_HELPER pOSHelper)
        </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">Wake the helper thread</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
 pOSHelper - the OS helper object
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT"></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"></p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>
 Waking up a helper thread
        status = SD_WAKE_OS_HELPER(&amp;pInstance-&gt;OSHelper);
        </pre>
</p>
</blockquote>
<p class="FUNCHEADINGS">See also:</p>
<blockquote>
<p class="BODYTEXT">
<a href="#FUNC_SDLIB_OSCreateHelper">
SDLIB_OSCreateHelper
        </a>
<br>
</p>
</blockquote>
</td>
</tr>
</table>
<a name="FUNC_SDLIB_CreateMessageQueue"></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>Support Functions Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="#FUNC_SD_WAKE_OS_HELPER"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_SDLIB_DeleteMessageQueue"><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">
 PSDMESSAGE_QUEUE SDLIB_CreateMessageQueue(INT MaxMessages, INT MaxMessageLength)
        </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">Create a message queue</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
 MaxMessages - Maximum number of messages this queue supports
        <br>
 MaxMessageLength - Maximum size of each message
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT"></p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Returns:</p>
<blockquote>
<p class="BODYCODE">
 Message queue object, NULL on failure
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="FUNCHEADINGS">Notes:</p>
<blockquote>
<p class="BODYTEXT">
  This function creates a simple first-in-first-out message queue.  The caller must determine 
           the maximum number of messages the queue supports and the size of each message.  This
           function will pre-allocate memory for each message. A producer of data posts a message
           using SDLIB_PostMessage with a user defined data structure. A consumer of this data 
           can retrieve the message (in FIFO order) using SDLIB_GetMessage. A message queue does not
           provide a signaling mechanism for notifying a consumer of data. Notifying a consumer is 
           user defined.
        <br>
</p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>

<font face="Arial, Helvetica, sans-serif" color="#FF00FF"> Creating a message queue:</font>
       typedef struct _MyMessage {
           UINT8 Code;
           PVOID pDataBuffer;
       } MyMessage;
            <font face="Arial, Helvetica, sans-serif" color="#999999">// create message queue, 16 messages max.
</font>       pMsgQueue = SDLIB_CreateMessageQueue(16,sizeof(MyMessage));
       if (NULL == pMsgQueue) {
           .. failed
       
        </pre>
</p>
</blockquote>
<p class="FUNCHEADINGS">See also:</p>
<blockquote>
<p class="BODYTEXT">
SDLIB_DeleteMessageQueue, SDLIB_GetMessage, SDLIB_PostMessage.
        <br>
</p>
</blockquote>
</td>
</tr>
</table>
<a name="FUNC_SDLIB_DeleteMessageQueue"></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>Support Functions Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="#FUNC_SDLIB_CreateMessageQueue"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_SDLIB_GetMessage"><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 SDLIB_DeleteMessageQueue(PSDMESSAGE_QUEUE pQueue)
        </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">Delete a message queue</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
 pQueue - message queue to delete
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT"></p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Returns:</p>
<blockquote>
<p class="BODYCODE"></p>
</blockquote>
</blockquote>
</p>
<p class="FUNCHEADINGS">Notes:</p>
<blockquote>
<p class="BODYTEXT">
 This function flushes the message queue and frees all memory allocated for
          messages.
        <br>
</p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>

<font face="Arial, Helvetica, sans-serif" color="#FF00FF"> Deleting a message queue:</font>
       if (pMsgQueue != NULL) {
            SDLIB_DeleteMessageQueue(pMsgQueue);
       
        </pre>
</p>
</blockquote>
<p class="FUNCHEADINGS">See also:</p>
<blockquote>
<p class="BODYTEXT">
<a href="#FUNC_SDLIB_CreateMessageQueue">
SDLIB_CreateMessageQueue
        </a>
<br>
</p>
</blockquote>
</td>
</tr>
</table>
<a name="FUNC_SDLIB_GetMessage"></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>Support Functions Documentation</strong></font></td><td bgcolor="#0000FF" height="62" width="10%"><td><a href="#FUNC_SDLIB_DeleteMessageQueue"><img border="0" height="32" width="27" src="Images/leftarrow.gif"></a></td><td><a href="#FUNC_SDLIB_IsQueueEmpty"><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">
 SDIO_STATUS SDLIB_GetMessage(PSDMESSAGE_QUEUE pQueue, PVOID pData, INT *pBufferLength) 
        </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">Get a message from a message queue</p>
</blockquote>
<p class="FUNCHEADINGS">Parameters:</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Inputs:</p>
<blockquote>
<p class="BODYTEXT">
 pQueue - message queue to retreive a message from
        <br>
 pBufferLength - on entry, the length of the data buffer
        <br>
</p>
</blockquote>
</blockquote>
</p>
<p class="BODYTEXT">
<blockquote>
<p class="BODYTEXT">Outputs:</p>
<blockquote>
<p class="BODYTEXT">
 pData - buffer to hold the message
        <br>
 pBufferLength - on return, contains the number of bytes copied
        <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">
 The message queue uses an internal list of user defined message structures.  The message is
          dequeued (FIFO order) and copied to the callers buffer.  The internal allocation for the message
          is returned back to the message queue. This function returns SDIO_STATUS_NO_MORE_MESSAGES
          if the message queue is empty. If the length of the buffer is smaller than the length of 
          the message at the head of the queue,this function returns SDIO_STATUS_BUFFER_TOO_SMALL and
          returns the required length in pBufferLength.
        <br>
</p>
</blockquote>
<p class="FUNCHEADINGS">Example: </p>
<blockquote>
<p class="BODYCODE">
<pre>
 Getting a message
       MyMessage message;

⌨️ 快捷键说明

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