code
stringlengths
1
1.05M
repo_name
stringlengths
6
83
path
stringlengths
3
242
language
stringclasses
222 values
license
stringclasses
20 values
size
int64
1
1.05M
var group__CMSIS__RTOS__Definitions_unionosEvent_8def = [ [ "mail_id", "group__CMSIS__RTOS__Definitions.html#a57aa2b69577037fb2428bc48a9fb1038", null ], [ "message_id", "group__CMSIS__RTOS__Definitions.html#a4ccaa172acbdcbf38fa0ea0ef0229c49", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Definitions_unionosEvent_8def.js
JavaScript
apache-2.0
260
var group__CMSIS__RTOS__Definitions_unionosEvent_8value = [ [ "p", "group__CMSIS__RTOS__Definitions.html#a83878c91171338902e0fe0fb97a8c47a", null ], [ "signals", "group__CMSIS__RTOS__Definitions.html#aa8420f8bebd6d9578b405b6bbaa813d9", null ], [ "v", "group__CMSIS__RTOS__Definitions.html#a9e3669d19b675bd57058fd4664205d2a", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Definitions_unionosEvent_8value.js
JavaScript
apache-2.0
346
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Inter-Thread Communication and Resource Sharing</title> <title>CMSIS-RTOS: Inter-Thread Communication and Resource Sharing</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__InterThread.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#groups">Content</a> </div> <div class="headertitle"> <div class="title">Inter-Thread Communication and Resource Sharing<div class="ingroups"><a class="el" href="group__CMSIS__RTOS.html">CMSIS-RTOS API</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Functions for inter-thread communication. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="groups"></a> Content</h2></td></tr> <tr class="memitem:group__CMSIS__RTOS__SignalMgmt"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SignalMgmt.html">Signal Events</a></td></tr> <tr class="memdesc:group__CMSIS__RTOS__SignalMgmt"><td class="mdescLeft">&#160;</td><td class="mdescRight">Synchronize threads using signals. <br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:group__CMSIS__RTOS__Message"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Message.html">Message Queue</a></td></tr> <tr class="memdesc:group__CMSIS__RTOS__Message"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exchange messages between threads in a FIFO-like operation. <br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:group__CMSIS__RTOS__PoolMgmt"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html">Memory Pool</a></td></tr> <tr class="memdesc:group__CMSIS__RTOS__PoolMgmt"><td class="mdescLeft">&#160;</td><td class="mdescRight">Manage thread-safe fixed-size blocks of dynamic memory. <br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:group__CMSIS__RTOS__Mail"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html">Mail Queue</a></td></tr> <tr class="memdesc:group__CMSIS__RTOS__Mail"><td class="mdescLeft">&#160;</td><td class="mdescRight">Exchange data between threads using a queue of memory blocks. <br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:group__CMSIS__RTOS__MutexMgmt"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html">Mutexes</a></td></tr> <tr class="memdesc:group__CMSIS__RTOS__MutexMgmt"><td class="mdescLeft">&#160;</td><td class="mdescRight">Synchronize resource access using Mutual Exclusion (Mutex). <br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:group__CMSIS__RTOS__SemaphoreMgmt"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html">Semaphores</a></td></tr> <tr class="memdesc:group__CMSIS__RTOS__SemaphoreMgmt"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access shared resources simultaneously from different threads. <br/></td></tr> <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>In most applications, threads need to <b>communicate</b> <b>with</b> <b>each</b> <b>other</b> or <b>access</b> <b>shared</b> <b>resources</b> together. There are many ways to exchange data between threads, for example using shared data, polling loops and message passing.</p> <p>Many resources in a microcontroller can be considered as <b>serially-reusable</b>. This means that they can be used repeatedly by different threads, but only by <b>one</b> <b>thread</b> <b>at</b> <b>a</b> <b>time</b> (for example communication peripherals such as <b>UARTs</b>, <b>memory</b>, and <b>files</b> that need to be modified).</p> <p>The CMSIS-RTOS API provides different means to pass messages between threads to make inter-thread communication more efficient. Also, resource sharing is inherently supported. The following methods are available to the user: </p> <h2>Inter-Thread Communication </h2> <ul> <li><a class="el" href="group__CMSIS__RTOS__SignalMgmt.html">Signal Events</a></li> <li><a class="el" href="group__CMSIS__RTOS__Message.html">Message Queue</a></li> <li><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html">Memory Pool</a></li> <li><a class="el" href="group__CMSIS__RTOS__Mail.html">Mail Queue</a></li> </ul> <h2>Resource Sharing </h2> <ul> <li><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html">Mutexes</a></li> <li><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html">Semaphores</a> </li> </ul> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__InterThread.html
HTML
apache-2.0
11,114
var group__CMSIS__RTOS__InterThread = [ [ "Signal Events", "group__CMSIS__RTOS__SignalMgmt.html", "group__CMSIS__RTOS__SignalMgmt" ], [ "Message Queue", "group__CMSIS__RTOS__Message.html", "group__CMSIS__RTOS__Message" ], [ "Memory Pool", "group__CMSIS__RTOS__PoolMgmt.html", "group__CMSIS__RTOS__PoolMgmt" ], [ "Mail Queue", "group__CMSIS__RTOS__Mail.html", "group__CMSIS__RTOS__Mail" ], [ "Mutexes", "group__CMSIS__RTOS__MutexMgmt.html", "group__CMSIS__RTOS__MutexMgmt" ], [ "Semaphores", "group__CMSIS__RTOS__SemaphoreMgmt.html", "group__CMSIS__RTOS__SemaphoreMgmt" ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__InterThread.js
JavaScript
apache-2.0
597
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Kernel Information and Control</title> <title>CMSIS-RTOS: Kernel Information and Control</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__KernelCtrl.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Kernel Information and Control<div class="ingroups"><a class="el" href="group__CMSIS__RTOS.html">CMSIS-RTOS API</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Provide version/system information and start the RTOS Kernel. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga22f7d235bc9f783933bd5a981fd79696"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga22f7d235bc9f783933bd5a981fd79696">osFeature_MainThread</a>&#160;&#160;&#160;1</td></tr> <tr class="memdesc:ga22f7d235bc9f783933bd5a981fd79696"><td class="mdescLeft">&#160;</td><td class="mdescRight">main thread 1=main can be thread, 0=not available <a href="#ga22f7d235bc9f783933bd5a981fd79696">More...</a><br/></td></tr> <tr class="separator:ga22f7d235bc9f783933bd5a981fd79696"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gae554ec16c23c5b7d65affade2a351891"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae554ec16c23c5b7d65affade2a351891">osFeature_SysTick</a>&#160;&#160;&#160;1</td></tr> <tr class="memdesc:gae554ec16c23c5b7d65affade2a351891"><td class="mdescLeft">&#160;</td><td class="mdescRight">osKernelSysTick functions: 1=available, 0=not available <a href="#gae554ec16c23c5b7d65affade2a351891">More...</a><br/></td></tr> <tr class="separator:gae554ec16c23c5b7d65affade2a351891"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga702196bacccbb978620c736b209387f1"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga702196bacccbb978620c736b209387f1">osCMSIS</a>&#160;&#160;&#160;0x10002</td></tr> <tr class="memdesc:ga702196bacccbb978620c736b209387f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">API version (main [31:16] .sub [15:0]) <a href="#ga702196bacccbb978620c736b209387f1">More...</a><br/></td></tr> <tr class="separator:ga702196bacccbb978620c736b209387f1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gab78dce646fabec479c5f34bc5175b7de"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gab78dce646fabec479c5f34bc5175b7de">osCMSIS_KERNEL</a>&#160;&#160;&#160;0x10000</td></tr> <tr class="memdesc:gab78dce646fabec479c5f34bc5175b7de"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTOS identification and version (main [31:16] .sub [15:0]) <a href="#gab78dce646fabec479c5f34bc5175b7de">More...</a><br/></td></tr> <tr class="separator:gab78dce646fabec479c5f34bc5175b7de"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga47cf03658f01cdffca688e9096b58289"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga47cf03658f01cdffca688e9096b58289">osKernelSystemId</a>&#160;&#160;&#160;&quot;KERNEL V1.00&quot;</td></tr> <tr class="memdesc:ga47cf03658f01cdffca688e9096b58289"><td class="mdescLeft">&#160;</td><td class="mdescRight">RTOS identification string. <a href="#ga47cf03658f01cdffca688e9096b58289">More...</a><br/></td></tr> <tr class="separator:ga47cf03658f01cdffca688e9096b58289"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga9e0954d52722673e2031233a2ab99960"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960">osKernelSysTickFrequency</a>&#160;&#160;&#160;100000000</td></tr> <tr class="memdesc:ga9e0954d52722673e2031233a2ab99960"><td class="mdescLeft">&#160;</td><td class="mdescRight">The RTOS kernel system timer frequency in Hz. <a href="#ga9e0954d52722673e2031233a2ab99960">More...</a><br/></td></tr> <tr class="separator:ga9e0954d52722673e2031233a2ab99960"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gae12c190af42d7310d8006d64f4ed5a88"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88">osKernelSysTickMicroSec</a>(microsec)&#160;&#160;&#160;(((uint64_t)microsec * (<a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960">osKernelSysTickFrequency</a>)) / 1000000)</td></tr> <tr class="memdesc:gae12c190af42d7310d8006d64f4ed5a88"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert a microseconds value to a RTOS kernel system timer value. <a href="#gae12c190af42d7310d8006d64f4ed5a88">More...</a><br/></td></tr> <tr class="separator:gae12c190af42d7310d8006d64f4ed5a88"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga53d078a801022e202e8115c083ece68e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> (void)</td></tr> <tr class="memdesc:ga53d078a801022e202e8115c083ece68e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the RTOS Kernel for creating objects. <a href="#ga53d078a801022e202e8115c083ece68e">More...</a><br/></td></tr> <tr class="separator:ga53d078a801022e202e8115c083ece68e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaab668ffd2ea76bb0a77ab0ab385eaef2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a> (void)</td></tr> <tr class="memdesc:gaab668ffd2ea76bb0a77ab0ab385eaef2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start the RTOS Kernel. <a href="#gaab668ffd2ea76bb0a77ab0ab385eaef2">More...</a><br/></td></tr> <tr class="separator:gaab668ffd2ea76bb0a77ab0ab385eaef2"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga3b571de44cd3094c643247a7397f86b5"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga3b571de44cd3094c643247a7397f86b5">osKernelRunning</a> (void)</td></tr> <tr class="memdesc:ga3b571de44cd3094c643247a7397f86b5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Check if the RTOS kernel is already started. <a href="#ga3b571de44cd3094c643247a7397f86b5">More...</a><br/></td></tr> <tr class="separator:ga3b571de44cd3094c643247a7397f86b5"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gad0262e4688e95d1e9038afd9bcc16001"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001">osKernelSysTick</a> (void)</td></tr> <tr class="memdesc:gad0262e4688e95d1e9038afd9bcc16001"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the RTOS kernel system timer counter. <a href="#gad0262e4688e95d1e9038afd9bcc16001">More...</a><br/></td></tr> <tr class="separator:gad0262e4688e95d1e9038afd9bcc16001"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>The Kernel Information and Control function group allows to:</p> <ul> <li>obtain information about the system and the underlying kernel.</li> <li>obtain version information about the CMSIS-RTOS API.</li> <li>initialize of the RTOS kernel for creating objects.</li> <li>start the RTOS kernel and thread switching.</li> <li>check the execution status of the RTOS kernel.</li> </ul> <p>The function <b>main</b> is a special thread function that may be started at system initialization. In this case it has the initial priority <em>osPriorityNormal</em>.</p> <p>When reaching <b>main</b>, it is necessary to:</p> <ol type="1"> <li>Call <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e" title="Initialize the RTOS Kernel for creating objects. ">osKernelInitialize()</a> to initialize the CMSIS-RTOS Kernel</li> <li>Setup device peripherals and create other RTOS objects using the <b>os*Create</b> functions.</li> <li>Start the Kernel and begin thread switching by calling <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2" title="Start the RTOS Kernel. ">osKernelStart()</a>.</li> </ol> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="keywordtype">int</span> main (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> (); <span class="comment">// initialize CMSIS-RTOS</span></div> <div class="line"> </div> <div class="line"> <span class="comment">// initialize peripherals here</span></div> <div class="line"> </div> <div class="line"> <span class="comment">// create &#39;thread&#39; functions that start executing,</span></div> <div class="line"> <span class="comment">// example: tid_name = osThreadCreate (osThread(name), NULL);</span></div> <div class="line"> </div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a> (); <span class="comment">// start thread execution </span></div> <div class="line">}</div> </div><!-- fragment --> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga702196bacccbb978620c736b209387f1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osCMSIS&#160;&#160;&#160;0x10002</td> </tr> </table> </div><div class="memdoc"> <p>Version information of the CMSIS-RTOS API whereby major version is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.</p> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osCMSIS</b> identifies the CMSIS-RTOS API version. </dd></dl> </div> </div> <a class="anchor" id="gab78dce646fabec479c5f34bc5175b7de"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osCMSIS_KERNEL&#160;&#160;&#160;0x10000</td> </tr> </table> </div><div class="memdoc"> <p>Identifies the underlying RTOS kernel and version number. The actual name of that define depends on the RTOS Kernel used in the implementation. For example, <b>osCMSIS_FreeRTOS</b> identifies the FreeRTOS kernel and the value indicates the version number of that kernel whereby the major version is in bits [31:16] and sub version in bits [15:0]. The value 0x10000 represents version 1.00.</p> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: <b>osCMSIS_KERNEL</b> identifies the underlying RTOS kernel and version number. </dd></dl> </div> </div> <a class="anchor" id="ga22f7d235bc9f783933bd5a981fd79696"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_MainThread&#160;&#160;&#160;1</td> </tr> </table> </div><div class="memdoc"> <p>A CMSIS-RTOS implementation may support to start thread execution with the function 'main'.</p> <ul> <li>When <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga22f7d235bc9f783933bd5a981fd79696">osFeature_MainThread</a> is 1 the RTOS offers to start with 'main'. The RTOS kernel is in this case already started.</li> <li>When <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga22f7d235bc9f783933bd5a981fd79696">osFeature_MainThread</a> is 0 the RTOS requires explicit start with <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a>.</li> </ul> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_MainThread</b> is 1</p> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osFeature_xxx</b> shall be consistent in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="gae554ec16c23c5b7d65affade2a351891"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_SysTick&#160;&#160;&#160;1</td> </tr> </table> </div><div class="memdoc"> <p>A CMSIS-RTOS implementation may provide access to the RTOS kernel system timer.</p> <ul> <li>When <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae554ec16c23c5b7d65affade2a351891">osFeature_SysTick</a> is 1 access to the RTOS kernel system timer is provided with <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001">osKernelSysTick</a>, <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960">osKernelSysTickFrequency</a>, and <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88">osKernelSysTickMicroSec</a>.</li> <li>When <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae554ec16c23c5b7d65affade2a351891">osFeature_SysTick</a> is 0 access to the RTOS kernel system timer is not implemented.</li> </ul> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_SysTick</b> is 1 </p> </div> </div> <a class="anchor" id="ga47cf03658f01cdffca688e9096b58289"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osKernelSystemId&#160;&#160;&#160;&quot;KERNEL V1.00&quot;</td> </tr> </table> </div><div class="memdoc"> <p>Defines a string that identifies the underlying RTOS Kernel and provides version information. The length of that string is limited to 21 bytes. A valid identification string is for example, <b>"FreeRTOS V1.00"</b>.</p> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osKernelSystemId</b> shall be consistent in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="ga9e0954d52722673e2031233a2ab99960"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osKernelSysTickFrequency&#160;&#160;&#160;100000000</td> </tr> </table> </div><div class="memdoc"> <p>Specifies the frequency of the Kernel SysTick timer in Hz. The value is typically use to scale a time value and is for example used in <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88">osKernelSysTickMicroSec</a>.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001" title="Get the RTOS kernel system timer counter. ">osKernelSysTick</a></dd></dl> <dl class="section note"><dt>Note</dt><dd>Reflects the system timer setting and is typically defined in a configuration file. </dd></dl> </div> </div> <a class="anchor" id="gae12c190af42d7310d8006d64f4ed5a88"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osKernelSysTickMicroSec</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">microsec</td><td>)</td> <td>&#160;&#160;&#160;(((uint64_t)microsec * (<a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960">osKernelSysTickFrequency</a>)) / 1000000)</td> </tr> </table> </div><div class="memdoc"> <p>Allows you to scale a microsecond value to the frequency of the Kernel SysTick timer. This macro is typically used to check for short timeouts in polling loops.</p> <dl class="section see"><dt>See Also</dt><dd><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001" title="Get the RTOS kernel system timer counter. ">osKernelSysTick</a></dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">microsec</td><td>time value in microseconds. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>time value normalized to the <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960">osKernelSysTickFrequency</a> </dd></dl> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga53d078a801022e202e8115c083ece68e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osKernelInitialize </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osKernelInitialize</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Initialize of the RTOS Kernel to allow peripheral setup and creation of other RTOS objects with the functions:</p> <ul> <li><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> : Create a thread function.</li> <li><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> : Define attributes of the timer callback function.</li> <li><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a> : Define and initialize a mutex.</li> <li><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a> : Define and initialize a semaphore.</li> <li><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a> : Define and initialize a fix-size memory pool.</li> <li><a class="el" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a> : Define and initialize a message queue.</li> <li><a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a> : Define and initialize a mail queue with fix-size memory blocks.</li> </ul> <p>The RTOS kernel does not start thread switching until the function <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a> is called.</p> <dl class="section note"><dt>Note</dt><dd>In case that the RTOS Kernel starts thread execution with the function <em>main</em> the function osKernelInitialize stops thread switching. This allows you to setup the system to a defined state before thread switching is resumed with <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">int</span> main (<span class="keywordtype">void</span>) {</div> <div class="line"> <span class="keywordflow">if</span> (!<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga3b571de44cd3094c643247a7397f86b5">osKernelRunning</a> ()) { <span class="comment">// if kernel is not running, initialize the kernel</span></div> <div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> () != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) { <span class="comment">// check osStatus for other possible valid values</span></div> <div class="line"> <span class="comment">// exit with an error message</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga3b571de44cd3094c643247a7397f86b5"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int32_t osKernelRunning </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osKernelRunning</b> shall be consistent in every CMSIS-RTOS. </dd></dl> <dl class="section return"><dt>Returns</dt><dd>0 RTOS is not started, 1 RTOS is started.</dd></dl> <p>Identifies if the RTOS kernel is started. For systems with the option to start the <em>main</em> function as a thread this allows you to identify that the RTOS kernel is already running.</p> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">int</span> main (<span class="keywordtype">void</span>) { <span class="comment">// program execution starts here</span></div> <div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga3b571de44cd3094c643247a7397f86b5">osKernelRunning</a> ()) { </div> <div class="line"> : <span class="comment">// main is already a thread function</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gaab668ffd2ea76bb0a77ab0ab385eaef2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osKernelStart </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osKernelStart</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Start the RTOS Kernel and begin thread switching.</p> <dl class="section note"><dt>Note</dt><dd>When the CMSIS-RTOS starts thread execution with the function <em>main</em> this function resumes thread switching. The <em>main</em> thread will continue executing after <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a>.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the RTOS kernel has been successfully started.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">int</span> main (<span class="keywordtype">void</span>) {</div> <div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> () != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) { <span class="comment">// check osStatus for other possible valid values</span></div> <div class="line"> <span class="comment">// exit with an error message</span></div> <div class="line"> }</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (!<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga3b571de44cd3094c643247a7397f86b5">osKernelRunning</a> ()) { <span class="comment">// is the kernel running ?</span></div> <div class="line"> <span class="keywordflow">if</span> (<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a> () != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) { <span class="comment">// start the kernel</span></div> <div class="line"> <span class="comment">// kernel could not be started</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gad0262e4688e95d1e9038afd9bcc16001"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">uint32_t osKernelSysTick </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osKernelSysTick</b> shall be consistent in every CMSIS-RTOS. </dd></dl> <dl class="section return"><dt>Returns</dt><dd>RTOS kernel system timer as 32-bit value</dd></dl> <p>Get the value of the Kernel SysTick timer for time comparison. The value is a rolling 32-bit counter that is typically composed of the kernel system interrupt timer value and an counter that counts these interrupts.</p> <p>This function allows the implementation of timeout checks. These are for example required when checking for a busy status in a device or peripheral initialization routine.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> SetupDevice (<span class="keywordtype">void</span>) {</div> <div class="line"> uint32_t tick;</div> <div class="line"> </div> <div class="line"> tick = <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001">osKernelSysTick</a>(); <span class="comment">// get start value of the Kernel system tick</span></div> <div class="line"> Device.Setup (); <span class="comment">// initialize a device or peripheral</span></div> <div class="line"> <span class="keywordflow">do</span> { <span class="comment">// poll device busy status for 100 microseconds</span></div> <div class="line"> <span class="keywordflow">if</span> (!Device.Busy) <span class="keywordflow">break</span>; <span class="comment">// check if device is correctly initialized</span></div> <div class="line"> } <span class="keywordflow">while</span> ((<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001">osKernelSysTick</a>() - tick) &lt; <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88">osKernelSysTickMicroSec</a>(100)); </div> <div class="line"> <span class="keywordflow">if</span> (Device.Busy) { </div> <div class="line"> ; <span class="comment">// in case device still busy, signal error</span></div> <div class="line"> }</div> <div class="line"> <span class="comment">// start interacting with device</span></div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__KernelCtrl.html
HTML
apache-2.0
35,990
var group__CMSIS__RTOS__KernelCtrl = [ [ "osCMSIS", "group__CMSIS__RTOS__KernelCtrl.html#ga702196bacccbb978620c736b209387f1", null ], [ "osCMSIS_KERNEL", "group__CMSIS__RTOS__KernelCtrl.html#gab78dce646fabec479c5f34bc5175b7de", null ], [ "osFeature_MainThread", "group__CMSIS__RTOS__KernelCtrl.html#ga22f7d235bc9f783933bd5a981fd79696", null ], [ "osFeature_SysTick", "group__CMSIS__RTOS__KernelCtrl.html#gae554ec16c23c5b7d65affade2a351891", null ], [ "osKernelSystemId", "group__CMSIS__RTOS__KernelCtrl.html#ga47cf03658f01cdffca688e9096b58289", null ], [ "osKernelSysTickFrequency", "group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960", null ], [ "osKernelSysTickMicroSec", "group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88", null ], [ "osKernelInitialize", "group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e", null ], [ "osKernelRunning", "group__CMSIS__RTOS__KernelCtrl.html#ga3b571de44cd3094c643247a7397f86b5", null ], [ "osKernelStart", "group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2", null ], [ "osKernelSysTick", "group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__KernelCtrl.js
JavaScript
apache-2.0
1,234
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Mail Queue</title> <title>CMSIS-RTOS: Mail Queue</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__Mail.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Mail Queue<div class="ingroups"><a class="el" href="group__CMSIS__RTOS__InterThread.html">Inter-Thread Communication and Resource Sharing</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Exchange data between threads using a queue of memory blocks. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:gaceb2e0071ce160d153047f2eac1aca8e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#gaceb2e0071ce160d153047f2eac1aca8e">osFeature_MailQ</a>&#160;&#160;&#160;1</td></tr> <tr class="memdesc:gaceb2e0071ce160d153047f2eac1aca8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mail Queues: 1=available, 0=not available. <a href="#gaceb2e0071ce160d153047f2eac1aca8e">More...</a><br/></td></tr> <tr class="separator:gaceb2e0071ce160d153047f2eac1aca8e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga58d712b16c0c6668059f509386d1e55b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#ga58d712b16c0c6668059f509386d1e55b">osMailQDef</a>(name, queue_sz, type)</td></tr> <tr class="memdesc:ga58d712b16c0c6668059f509386d1e55b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a Mail Queue Definition. <a href="#ga58d712b16c0c6668059f509386d1e55b">More...</a><br/></td></tr> <tr class="separator:ga58d712b16c0c6668059f509386d1e55b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gad2deeb66d51ade54e63d8f87ff2ec9d2"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2">osMailQ</a>(name)&#160;&#160;&#160;&amp;os_mailQ_def_##name</td></tr> <tr class="memdesc:gad2deeb66d51ade54e63d8f87ff2ec9d2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access a Mail Queue Definition. <a href="#gad2deeb66d51ade54e63d8f87ff2ec9d2">More...</a><br/></td></tr> <tr class="separator:gad2deeb66d51ade54e63d8f87ff2ec9d2"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gaa177e7fe5820dd70d8c9e46ded131174"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a> (const <a class="el" href="cmsis__os_8h.html#structosMailQDef__t">osMailQDef_t</a> *queue_def, <a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id)</td></tr> <tr class="memdesc:gaa177e7fe5820dd70d8c9e46ded131174"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create and Initialize mail queue. <a href="#gaa177e7fe5820dd70d8c9e46ded131174">More...</a><br/></td></tr> <tr class="separator:gaa177e7fe5820dd70d8c9e46ded131174"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gadf5ce811bd6a56e617e902a1db6c2194"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#gadf5ce811bd6a56e617e902a1db6c2194">osMailAlloc</a> (<a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> queue_id, uint32_t millisec)</td></tr> <tr class="memdesc:gadf5ce811bd6a56e617e902a1db6c2194"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate a memory block from a mail. <a href="#gadf5ce811bd6a56e617e902a1db6c2194">More...</a><br/></td></tr> <tr class="separator:gadf5ce811bd6a56e617e902a1db6c2194"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8fde74f6fe5b9e88f75cc5eb8f2124fd"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#ga8fde74f6fe5b9e88f75cc5eb8f2124fd">osMailCAlloc</a> (<a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> queue_id, uint32_t millisec)</td></tr> <tr class="memdesc:ga8fde74f6fe5b9e88f75cc5eb8f2124fd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate a memory block from a mail and set memory block to zero. <a href="#ga8fde74f6fe5b9e88f75cc5eb8f2124fd">More...</a><br/></td></tr> <tr class="separator:ga8fde74f6fe5b9e88f75cc5eb8f2124fd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga485ef6f81854ebda8ffbce4832181e02"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02">osMailPut</a> (<a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> queue_id, void *mail)</td></tr> <tr class="memdesc:ga485ef6f81854ebda8ffbce4832181e02"><td class="mdescLeft">&#160;</td><td class="mdescRight">Put a mail to a queue. <a href="#ga485ef6f81854ebda8ffbce4832181e02">More...</a><br/></td></tr> <tr class="separator:ga485ef6f81854ebda8ffbce4832181e02"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac6ad7e6e7d6c4a80e60da22c57a42ccd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd">osMailGet</a> (<a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> queue_id, uint32_t millisec)</td></tr> <tr class="memdesc:gac6ad7e6e7d6c4a80e60da22c57a42ccd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a mail from a queue. <a href="#gac6ad7e6e7d6c4a80e60da22c57a42ccd">More...</a><br/></td></tr> <tr class="separator:gac6ad7e6e7d6c4a80e60da22c57a42ccd"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga27c1060cf21393f96b4fd1ed1c0167cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Mail.html#ga27c1060cf21393f96b4fd1ed1c0167cc">osMailFree</a> (<a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> queue_id, void *mail)</td></tr> <tr class="memdesc:ga27c1060cf21393f96b4fd1ed1c0167cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Free a memory block from a mail. <a href="#ga27c1060cf21393f96b4fd1ed1c0167cc">More...</a><br/></td></tr> <tr class="separator:ga27c1060cf21393f96b4fd1ed1c0167cc"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>A <b>mail</b> <b>queue</b> resembles a <a class="el" href="group__CMSIS__RTOS__Message.html">Message Queue</a>, but the data that is being transferred consists of memory blocks that need to be allocated (before putting data in) and freed (after taking data out). The mail queue uses a <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html">Memory Pool</a> to create formatted memory blocks and passes pointers to these blocks in a message queue. This allows the data to stay in an allocated memory block while only a pointer is moved between the separate threads. This is an advantage over <a class="el" href="group__CMSIS__RTOS__Message.html">messages</a> that can transfer only a 32-bit value or a pointer. Using the mail queue functions, you can control, send, receive, or wait for mail.</p> <div class="image"> <img src="MailQueue.png" alt="MailQueue.png"/> <div class="caption"> CMSIS-RTOS Mail Queue</div></div> <h2>Working with Mail Queues </h2> <p>Follow these steps to create and use a mail queue:</p> <ol type="1"> <li>Declare a data structure that combines a number of elements: <div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div> <div class="line"> uint32_t length;</div> <div class="line"> uint32_t width;</div> <div class="line"> uint32_t height;</div> <div class="line"> uint32_t weight;</div> <div class="line">} properties_t;</div> </div><!-- fragment --></li> <li>Declare a mail queue made up of these objects: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__Mail.html#ga58d712b16c0c6668059f509386d1e55b">osMailQDef</a> (object_pool_q, 10, properties_t); <span class="comment">// Declare mail queue</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> (object_pool_q_id); <span class="comment">// Mail queue ID</span></div> </div><!-- fragment --></li> <li>Then, create the mail pool in a thread: <div class="fragment"><div class="line">object_pool_q_id = <a class="code" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>(<a class="code" href="group__CMSIS__RTOS__Mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2">osMailQ</a>(object_pool_q), NULL);</div> </div><!-- fragment --></li> <li>Allocate the mail queue within a thread and fill it with data: <div class="fragment"><div class="line">properties_t *object_data;</div> <div class="line"> object_data = (properties_t *) <a class="code" href="group__CMSIS__RTOS__Mail.html#gadf5ce811bd6a56e617e902a1db6c2194">osMailAlloc</a>(object_pool_q_id, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div> <div class="line"> </div> <div class="line">object_data-&gt;length = 100;</div> <div class="line">object_data-&gt;width = 10;</div> <div class="line">object_data-&gt;height = 23;</div> <div class="line">object_data-&gt;weight = 1000;</div> </div><!-- fragment --></li> <li>Pass the pointer to the mail queue to another thread: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02">osMailPut</a>(object_pool_q_id, object_data);</div> </div><!-- fragment --></li> <li>Access the data in another thread: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> <span class="keyword">event</span> = <a class="code" href="group__CMSIS__RTOS__Mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd">osMailGet</a>(properties_q_id, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div> <div class="line">properties_t *received = (properties_t *)event.value.p; <span class="comment">// &quot;.p&quot; indicates that the message is a pointer</span></div> <div class="line">my_length(received-&gt;length);</div> </div><!-- fragment --></li> <li>Once the data has been used, the memory block must be freed so that the memory pool can be reused <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__Mail.html#ga27c1060cf21393f96b4fd1ed1c0167cc">osMailFree</a>(object_pool_q_id, received);</div> </div><!-- fragment --> </li> </ol> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="gaceb2e0071ce160d153047f2eac1aca8e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_MailQ&#160;&#160;&#160;1</td> </tr> </table> </div><div class="memdoc"> <p>A CMSIS-RTOS implementation may support mail queues.</p> <ul> <li>When <a class="el" href="group__CMSIS__RTOS__Mail.html#gaceb2e0071ce160d153047f2eac1aca8e">osFeature_MailQ</a> is 1 mail queues are supported.</li> <li>When <a class="el" href="group__CMSIS__RTOS__Mail.html#gaceb2e0071ce160d153047f2eac1aca8e">osFeature_MailQ</a> is 0 no mail queues are supported.</li> </ul> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_MailQ</b> is 1 </p> </div> </div> <a class="anchor" id="gad2deeb66d51ade54e63d8f87ff2ec9d2"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osMailQ</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;&amp;os_mailQ_def_##name</td> </tr> </table> </div><div class="memdoc"> <p>Access to the mail queue definition for the function <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the queue </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osMailQ</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="ga58d712b16c0c6668059f509386d1e55b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osMailQDef</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">queue_sz, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">type&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Define the attributes of a mail queue that can by the function <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a> using <a class="el" href="group__CMSIS__RTOS__Mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2">osMailQ</a>.</p> <dl class="section note"><dt>Note</dt><dd>The parameter <em>thread</em> registers the receiving thread for a mail and is needed for the general <a class="el" href="technicalData.html#osWait">osWait</a> function to deliver the mail.</dd></dl> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the queue </td></tr> <tr><td class="paramname">queue_sz</td><td>maximum number of messages in queue </td></tr> <tr><td class="paramname">type</td><td>data type of a single message element </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osMailQDef</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="gadf5ce811bd6a56e617e902a1db6c2194"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void * osMailAlloc </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a>&#160;</td> <td class="paramname"><em>queue_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_id</td><td>mail queue ID obtained with <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>pointer to memory block that can be filled with mail or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMailAlloc</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Allocate a memory block from the mail queue that is filled with the mail information.</p> <p>The argument <em>queue_id</em> specifies a mail queue identifier that is obtain with <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>.</p> <p>The argument <em>millisec</em> specifies how long the system waits for a mail slot to become available. While the system waits the thread calling this function is put into the state <b>WAITING</b>. The <em>millisec</em> timeout can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until a mail slot can be allocated.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <dl class="section note"><dt>Note</dt><dd>The parameter <em>millisec</em> must be 0 for using this function in an ISR. </dd> <dd> <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p>A NULL pointer is returned when no memory slot can be obtained or <em>queue</em> specifies an illegal parameter. </p> </div> </div> <a class="anchor" id="ga8fde74f6fe5b9e88f75cc5eb8f2124fd"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void * osMailCAlloc </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a>&#160;</td> <td class="paramname"><em>queue_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_id</td><td>mail queue ID obtained with <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>pointer to memory block that can be filled with mail or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMailCAlloc</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Allocate a memory block from the mail queue that is filled with the mail information. The memory block returned is cleared.</p> <p>The argument <em>queue_id</em> specifies a mail queue identifier that is obtain with <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>.</p> <p>The argument <em>millisec</em> specifies how long the system waits for a mail slot to become available. While the system waits the thread that is calling this function is put into the state <b>WAITING</b>. The <em>millisec</em> timeout can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until a mail slot can be allocated.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <dl class="section note"><dt>Note</dt><dd>The parameter <em>millisec</em> must be 0 for using this function in an ISR. </dd> <dd> <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p>A NULL pointer is returned when no memory block can be obtained or <em>queue</em> specifies an illegal parameter. </p> </div> </div> <a class="anchor" id="gaa177e7fe5820dd70d8c9e46ded131174"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> osMailCreate </td> <td>(</td> <td class="paramtype">const <a class="el" href="cmsis__os_8h.html#structosMailQDef__t">osMailQDef_t</a> *&#160;</td> <td class="paramname"><em>queue_def</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td> <td class="paramname"><em>thread_id</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_def</td><td>reference to the mail queue definition obtain with <a class="el" href="group__CMSIS__RTOS__Mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2">osMailQ</a> </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">thread_id</td><td>thread ID (obtained by <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> or <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a>) or NULL. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>mail queue ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMailCreate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Initialize and create a mail queue.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> tid_thread1; <span class="comment">// ID for thread 1</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> tid_thread2; <span class="comment">// ID for thread 2</span></div> <div class="line"> </div> <div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{ <span class="comment">// Mail object structure</span></div> <div class="line"> <span class="keywordtype">float</span> voltage; <span class="comment">// AD result of measured voltage</span></div> <div class="line"> <span class="keywordtype">float</span> current; <span class="comment">// AD result of measured current</span></div> <div class="line"> <span class="keywordtype">int</span> counter; <span class="comment">// A counter value</span></div> <div class="line">} T_MEAS;</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__Mail.html#ga58d712b16c0c6668059f509386d1e55b">osMailQDef</a>(mail, 16, T_MEAS); <span class="comment">// Define mail queue</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a> mail;</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> send_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument); <span class="comment">// forward reference</span></div> <div class="line"><span class="keywordtype">void</span> recv_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument);</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a>(send_thread, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 1, 0); <span class="comment">// thread definitions</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a>(recv_thread, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 1, 2000);</div> <div class="line"> </div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="comment">// Thread 1: Send thread</span></div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="keywordtype">void</span> send_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument) {</div> <div class="line"> T_MEAS *mptr;</div> <div class="line"> </div> <div class="line"> mptr = <a class="code" href="group__CMSIS__RTOS__Mail.html#gadf5ce811bd6a56e617e902a1db6c2194">osMailAlloc</a>(mail, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// Allocate memory</span></div> <div class="line"> mptr-&gt;voltage = 223.72; <span class="comment">// Set the mail content</span></div> <div class="line"> mptr-&gt;current = 17.54;</div> <div class="line"> mptr-&gt;counter = 120786;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02">osMailPut</a>(mail, mptr); <span class="comment">// Send Mail</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a>(100);</div> <div class="line"> </div> <div class="line"> mptr = <a class="code" href="group__CMSIS__RTOS__Mail.html#gadf5ce811bd6a56e617e902a1db6c2194">osMailAlloc</a>(mail, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// Allocate memory</span></div> <div class="line"> mptr-&gt;voltage = 227.23; <span class="comment">// Prepare 2nd mail</span></div> <div class="line"> mptr-&gt;current = 12.41;</div> <div class="line"> mptr-&gt;counter = 170823;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02">osMailPut</a>(mail, mptr); <span class="comment">// Send Mail</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233">osThreadYield</a>(); <span class="comment">// Cooperative multitasking</span></div> <div class="line"> <span class="comment">// We are done here, exit this thread</span></div> <div class="line">}</div> <div class="line"> </div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="comment">// Thread 2: Receive thread</span></div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="keywordtype">void</span> recv_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument) {</div> <div class="line"> T_MEAS *rptr;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> evt;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">for</span> (;;) {</div> <div class="line"> evt = <a class="code" href="group__CMSIS__RTOS__Mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd">osMailGet</a>(mail, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// wait for mail</span></div> <div class="line"> <span class="keywordflow">if</span> (evt.<a class="code" href="group__CMSIS__RTOS__Definitions.html#ad477a289f1f03ac45407b64268d707d3">status</a> == <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926">osEventMail</a>) {</div> <div class="line"> rptr = evt.<a class="code" href="group__CMSIS__RTOS__Definitions.html#a0b9f8fd3645f01d8cb09cae82add2d7f">value</a>.p;</div> <div class="line"> printf (<span class="stringliteral">&quot;\nVoltage: %.2f V\n&quot;</span>, rptr-&gt;voltage);</div> <div class="line"> printf (<span class="stringliteral">&quot;Current: %.2f A\n&quot;</span>, rptr-&gt;current);</div> <div class="line"> printf (<span class="stringliteral">&quot;Number of cycles: %d\n&quot;</span>, rptr-&gt;counter);</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Mail.html#ga27c1060cf21393f96b4fd1ed1c0167cc">osMailFree</a>(mail, rptr); <span class="comment">// free memory allocated for mail</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> StartApplication (<span class="keywordtype">void</span>) {</div> <div class="line"> mail = <a class="code" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>(<a class="code" href="group__CMSIS__RTOS__Mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2">osMailQ</a>(mail), NULL); <span class="comment">// create mail queue</span></div> <div class="line"> </div> <div class="line"> tid_thread1 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>(<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(send_thread), NULL);</div> <div class="line"> tid_thread2 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>(<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(recv_thread), NULL);</div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga27c1060cf21393f96b4fd1ed1c0167cc"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osMailFree </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a>&#160;</td> <td class="paramname"><em>queue_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void *&#160;</td> <td class="paramname"><em>mail</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_id</td><td>mail queue ID obtained with <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">mail</td><td>pointer to the memory block that was obtained with <a class="el" href="group__CMSIS__RTOS__Mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd">osMailGet</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMailFree</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Free the memory block specified by <em>mail</em> and return it to the mail queue.</p> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the <em>mail</em> block is released.</li> <li><em>osErrorValue:</em> <em>mail</em> block does not belong to the mail queue pool.</li> <li><em>osErrorParameter:</em> the value to the parameter <em>queue_id</em> is incorrect. </li> </ul> </div> </div> <a class="anchor" id="gac6ad7e6e7d6c4a80e60da22c57a42ccd"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> osMailGet </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a>&#160;</td> <td class="paramname"><em>queue_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_id</td><td>mail queue ID obtained with <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>event that contains mail information or error code. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMailGet</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Suspend the execution of the current <b>RUNNING</b> thread until a mail arrives. When a mail is already in the queue, the function returns instantly with the mail information.</p> <p>The argument <em>millisec</em> specifies how long the system waits for a mail to arrive. While the system waits the thread that is calling this function is put into the state <b>WAITING</b>. The <em>millisec</em> timeout can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until a mail arrives.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <dl class="section note"><dt>Note</dt><dd>The parameter <em>millisec</em> must be 0 for using this function in an ISR. </dd> <dd> <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> no mail is available in the queue and no timeout was specified</li> <li><em>osEventTimeout:</em> no mail has arrived during the given timeout period.</li> <li><em>osEventMail:</em> mail received, <em>value.p</em> contains the pointer to mail content.</li> <li><em>osErrorParameter:</em> a parameter is invalid or outside of a permitted range. </li> </ul> </div> </div> <a class="anchor" id="ga485ef6f81854ebda8ffbce4832181e02"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osMailPut </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a1dac049fb7725a8af8b26c71cbb373b5">osMailQId</a>&#160;</td> <td class="paramname"><em>queue_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void *&#160;</td> <td class="paramname"><em>mail</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_id</td><td>mail queue ID obtained with <a class="el" href="group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174">osMailCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">mail</td><td>memory block previously allocated with <a class="el" href="group__CMSIS__RTOS__Mail.html#gadf5ce811bd6a56e617e902a1db6c2194">osMailAlloc</a> or <a class="el" href="group__CMSIS__RTOS__Mail.html#ga8fde74f6fe5b9e88f75cc5eb8f2124fd">osMailCAlloc</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMailPut</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Put the memory block specified with <em>mail</em> into the mail queue specified by <em>queue</em>.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the message is put into the queue.</li> <li><em>osErrorValue:</em> <em>mail</em> was previously not allocated as memory slot.</li> <li><em>osErrorParameter:</em> a parameter is invalid or outside of a permitted range.</li> </ul> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function. </dd></dl> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Mail.html
HTML
apache-2.0
45,549
var group__CMSIS__RTOS__Mail = [ [ "osFeature_MailQ", "group__CMSIS__RTOS__Mail.html#gaceb2e0071ce160d153047f2eac1aca8e", null ], [ "osMailQ", "group__CMSIS__RTOS__Mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2", null ], [ "osMailQDef", "group__CMSIS__RTOS__Mail.html#ga58d712b16c0c6668059f509386d1e55b", null ], [ "osMailAlloc", "group__CMSIS__RTOS__Mail.html#gadf5ce811bd6a56e617e902a1db6c2194", null ], [ "osMailCAlloc", "group__CMSIS__RTOS__Mail.html#ga8fde74f6fe5b9e88f75cc5eb8f2124fd", null ], [ "osMailCreate", "group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174", null ], [ "osMailFree", "group__CMSIS__RTOS__Mail.html#ga27c1060cf21393f96b4fd1ed1c0167cc", null ], [ "osMailGet", "group__CMSIS__RTOS__Mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd", null ], [ "osMailPut", "group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Mail.js
JavaScript
apache-2.0
903
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Message Queue</title> <title>CMSIS-RTOS: Message Queue</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__Message.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Message Queue<div class="ingroups"><a class="el" href="group__CMSIS__RTOS__InterThread.html">Inter-Thread Communication and Resource Sharing</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Exchange messages between threads in a FIFO-like operation. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga479a6561f859e3d4818e25708593d203"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Message.html#ga479a6561f859e3d4818e25708593d203">osFeature_MessageQ</a>&#160;&#160;&#160;1</td></tr> <tr class="memdesc:ga479a6561f859e3d4818e25708593d203"><td class="mdescLeft">&#160;</td><td class="mdescRight">Message Queues: 1=available, 0=not available. <a href="#ga479a6561f859e3d4818e25708593d203">More...</a><br/></td></tr> <tr class="separator:ga479a6561f859e3d4818e25708593d203"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac9a6a6276c12609793e7701afcc82326"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Message.html#gac9a6a6276c12609793e7701afcc82326">osMessageQDef</a>(name, queue_sz, type)</td></tr> <tr class="memdesc:gac9a6a6276c12609793e7701afcc82326"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a Message Queue Definition. <a href="#gac9a6a6276c12609793e7701afcc82326">More...</a><br/></td></tr> <tr class="separator:gac9a6a6276c12609793e7701afcc82326"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga2d446a0b4bb90bf05d6f92eedeaabc97"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97">osMessageQ</a>(name)&#160;&#160;&#160;&amp;os_messageQ_def_##name</td></tr> <tr class="memdesc:ga2d446a0b4bb90bf05d6f92eedeaabc97"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access a Message Queue Definition. <a href="#ga2d446a0b4bb90bf05d6f92eedeaabc97">More...</a><br/></td></tr> <tr class="separator:ga2d446a0b4bb90bf05d6f92eedeaabc97"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gaf3b9345cf426304d46565152bc26fb78"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a> (const <a class="el" href="cmsis__os_8h.html#structosMessageQDef__t">osMessageQDef_t</a> *queue_def, <a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id)</td></tr> <tr class="memdesc:gaf3b9345cf426304d46565152bc26fb78"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create and Initialize a Message Queue. <a href="#gaf3b9345cf426304d46565152bc26fb78">More...</a><br/></td></tr> <tr class="separator:gaf3b9345cf426304d46565152bc26fb78"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac0dcf462fc92de8ffaba6cc004514a6d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Message.html#gac0dcf462fc92de8ffaba6cc004514a6d">osMessagePut</a> (<a class="el" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a> queue_id, uint32_t info, uint32_t millisec)</td></tr> <tr class="memdesc:gac0dcf462fc92de8ffaba6cc004514a6d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Put a Message to a Queue. <a href="#gac0dcf462fc92de8ffaba6cc004514a6d">More...</a><br/></td></tr> <tr class="separator:gac0dcf462fc92de8ffaba6cc004514a6d"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga6c6892b8f2296cca6becd57ca2d7e1ae"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Message.html#ga6c6892b8f2296cca6becd57ca2d7e1ae">osMessageGet</a> (<a class="el" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a> queue_id, uint32_t millisec)</td></tr> <tr class="memdesc:ga6c6892b8f2296cca6becd57ca2d7e1ae"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a Message or Wait for a Message from a Queue. <a href="#ga6c6892b8f2296cca6becd57ca2d7e1ae">More...</a><br/></td></tr> <tr class="separator:ga6c6892b8f2296cca6becd57ca2d7e1ae"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p><b>Message</b> <b>passing</b> is another basic communication model between threads. In the message passing model, one thread sends data explicitly, while another thread receives it. The operation is more like some kind of I/O rather than a direct access to information to be shared. In CMSIS-RTOS, this mechanism is called s <b>message</b> <b>queue</b>. The data is passed from one thread to another in a FIFO-like operation. Using message queue functions, you can control, send, receive, or wait for messages. The data to be passed can be of integer or pointer type:</p> <div class="image"> <img src="MessageQueue.png" alt="MessageQueue.png"/> <div class="caption"> CMSIS-RTOS Message Queue</div></div> <p> Compared to a <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html">Memory Pool</a>, message queues are less efficient in general, but solve a broader range of problems. Sometimes, threads do not have a common address space or the use of shared memory raises problems, such as mutual exclusion.</p> <h2>Working with Message Queues </h2> <p>Follow these steps to create and use a message queue:</p> <ol type="1"> <li>Setup the message queue: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__Message.html#gac9a6a6276c12609793e7701afcc82326">osMessageQDef</a>(message_q, 5, uint32_t); <span class="comment">// Declare a message queue</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a> (message_q_id); <span class="comment">// Declare an ID for the message queue</span></div> </div><!-- fragment --></li> <li>Then, create the message queue in a thread: <div class="fragment"><div class="line">message_q_id = <a class="code" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a>(<a class="code" href="group__CMSIS__RTOS__Message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97">osMessageQ</a>(message_q), NULL);</div> </div><!-- fragment --></li> <li>Fill the message queue with data: <div class="fragment"><div class="line">uint32_t data = 512;</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02">osMailPut</a>(message_q_id, data, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div> </div><!-- fragment --></li> <li>From the receiving thread access the data using: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> <span class="keyword">event</span> = <a class="code" href="group__CMSIS__RTOS__Message.html#ga6c6892b8f2296cca6becd57ca2d7e1ae">osMessageGet</a>(message_q_id, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div> </div><!-- fragment --> </li> </ol> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga479a6561f859e3d4818e25708593d203"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_MessageQ&#160;&#160;&#160;1</td> </tr> </table> </div><div class="memdoc"> <p>A CMSIS-RTOS implementation may support message queues.</p> <ul> <li>When <a class="el" href="group__CMSIS__RTOS__Mail.html#gaceb2e0071ce160d153047f2eac1aca8e">osFeature_MailQ</a> is 1 message queues are supported.</li> <li>When <a class="el" href="group__CMSIS__RTOS__Mail.html#gaceb2e0071ce160d153047f2eac1aca8e">osFeature_MailQ</a> is 0 no message queues are supported.</li> </ul> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_MessageQ</b> is 1 </p> </div> </div> <a class="anchor" id="ga2d446a0b4bb90bf05d6f92eedeaabc97"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osMessageQ</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;&amp;os_messageQ_def_##name</td> </tr> </table> </div><div class="memdoc"> <p>Access to the message queue definition for the function <a class="el" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the queue </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osMessageQ</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="gac9a6a6276c12609793e7701afcc82326"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osMessageQDef</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">queue_sz, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">type&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Define the attributes of a message queue created by the function <a class="el" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a> using <a class="el" href="group__CMSIS__RTOS__Message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97">osMessageQ</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the queue. </td></tr> <tr><td class="paramname">queue_sz</td><td>maximum number of messages in the queue. </td></tr> <tr><td class="paramname">type</td><td>data type of a single message element (for debugger). </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osMessageQDef</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="gaf3b9345cf426304d46565152bc26fb78"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a> osMessageCreate </td> <td>(</td> <td class="paramtype">const <a class="el" href="cmsis__os_8h.html#structosMessageQDef__t">osMessageQDef_t</a> *&#160;</td> <td class="paramname"><em>queue_def</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td> <td class="paramname"><em>thread_id</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_def</td><td>queue definition referenced with <a class="el" href="group__CMSIS__RTOS__Message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97">osMessageQ</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">thread_id</td><td>thread ID (obtained by <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> or <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a>) or NULL. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>message queue ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMessageCreate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Create and initialize a message queue. The parameter <em>thread_id</em> registers the receiving thread for a message and is needed for the general <a class="el" href="technicalData.html#osWait">osWait</a> function to deliver the message.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> tid_thread1; <span class="comment">// ID for thread 1</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> tid_thread2; <span class="comment">// for thread 2</span></div> <div class="line"> </div> <div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{ <span class="comment">// Message object structure</span></div> <div class="line"> <span class="keywordtype">float</span> voltage; <span class="comment">// AD result of measured voltage</span></div> <div class="line"> <span class="keywordtype">float</span> current; <span class="comment">// AD result of measured current</span></div> <div class="line"> <span class="keywordtype">int</span> counter; <span class="comment">// A counter value</span></div> <div class="line">} T_MEAS;</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b">osPoolDef</a>(mpool, 16, T_MEAS); <span class="comment">// Define memory pool</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> mpool;</div> <div class="line"><a class="code" href="group__CMSIS__RTOS__Message.html#gac9a6a6276c12609793e7701afcc82326">osMessageQDef</a>(MsgBox, 16, &amp;T_MEAS); <span class="comment">// Define message queue</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a> MsgBox;</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> send_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument); <span class="comment">// forward reference</span></div> <div class="line"><span class="keywordtype">void</span> recv_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument); <span class="comment">// forward reference</span></div> <div class="line"> <span class="comment">// Thread definitions</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a>(send_thread, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 1, 0);</div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a>(recv_thread, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 1, 2000);</div> <div class="line"> </div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="comment">// Thread 1: Send thread</span></div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="keywordtype">void</span> send_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument) {</div> <div class="line"> T_MEAS *mptr;</div> <div class="line"> </div> <div class="line"> mptr = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543">osPoolAlloc</a>(mpool); <span class="comment">// Allocate memory for the message</span></div> <div class="line"> mptr-&gt;voltage = 223.72; <span class="comment">// Set the message content</span></div> <div class="line"> mptr-&gt;current = 17.54;</div> <div class="line"> mptr-&gt;counter = 120786;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Message.html#gac0dcf462fc92de8ffaba6cc004514a6d">osMessagePut</a>(MsgBox, (uint32_t)mptr, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// Send Message</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a>(100);</div> <div class="line"> </div> <div class="line"> mptr = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543">osPoolAlloc</a>(mpool); <span class="comment">// Allocate memory for the message</span></div> <div class="line"> mptr-&gt;voltage = 227.23; <span class="comment">// Prepare a 2nd message</span></div> <div class="line"> mptr-&gt;current = 12.41;</div> <div class="line"> mptr-&gt;counter = 170823;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Message.html#gac0dcf462fc92de8ffaba6cc004514a6d">osMessagePut</a>(MsgBox, (uint32_t)mptr, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// Send Message</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233">osThreadYield</a>(); <span class="comment">// Cooperative multitasking</span></div> <div class="line"> <span class="comment">// We are done here, exit this thread</span></div> <div class="line">}</div> <div class="line"> </div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="comment">// Thread 2: Receive thread</span></div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="keywordtype">void</span> recv_thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument) {</div> <div class="line"> T_MEAS *rptr;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> evt;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">for</span> (;;) {</div> <div class="line"> evt = <a class="code" href="group__CMSIS__RTOS__Message.html#ga6c6892b8f2296cca6becd57ca2d7e1ae">osMessageGet</a>(MsgBox, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// wait for message</span></div> <div class="line"> <span class="keywordflow">if</span> (evt.<a class="code" href="group__CMSIS__RTOS__Definitions.html#ad477a289f1f03ac45407b64268d707d3">status</a> == <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342">osEventMessage</a>) {</div> <div class="line"> rptr = evt.<a class="code" href="group__CMSIS__RTOS__Definitions.html#a0b9f8fd3645f01d8cb09cae82add2d7f">value</a>.p;</div> <div class="line"> printf (<span class="stringliteral">&quot;\nVoltage: %.2f V\n&quot;</span>, rptr-&gt;voltage);</div> <div class="line"> printf (<span class="stringliteral">&quot;Current: %.2f A\n&quot;</span>, rptr-&gt;current);</div> <div class="line"> printf (<span class="stringliteral">&quot;Number of cycles: %d\n&quot;</span>, rptr-&gt;counter);</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga4a861e9c469c9d0daf5721bf174f8e54">osPoolFree</a>(mpool, rptr); <span class="comment">// free memory allocated for message</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> StartApplication (<span class="keywordtype">void</span>) {</div> <div class="line"> mpool = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a>(<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a>(mpool)); <span class="comment">// create memory pool</span></div> <div class="line"> MsgBox = <a class="code" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a>(<a class="code" href="group__CMSIS__RTOS__Message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97">osMessageQ</a>(MsgBox), NULL); <span class="comment">// create msg queue</span></div> <div class="line"> </div> <div class="line"> tid_thread1 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>(<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(send_thread), NULL);</div> <div class="line"> tid_thread2 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>(<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(recv_thread), NULL);</div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga6c6892b8f2296cca6becd57ca2d7e1ae"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> osMessageGet </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a>&#160;</td> <td class="paramname"><em>queue_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_id</td><td>message queue ID obtained with <a class="el" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>event information that includes status code. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMessageGet</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Suspend the execution of the current <b>RUNNING</b> thread until a message arrives. When a message is already in the queue, the function returns instantly with the message information.</p> <p>The argument <em>millisec</em> specifies how long the system waits for a message to become available. While the system waits the thread that is calling this function is put into the state <b>WAITING</b>. The <em>millisec</em> timeout value can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until a message arrives.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <dl class="section note"><dt>Note</dt><dd>The parameter <em>millisec</em> must be 0 for using this function in an ISR. </dd> <dd> <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> no message is available in the queue and no timeout was specified.</li> <li><em>osEventTimeout:</em> no message has arrived during the given timeout period.</li> <li><em>osEventMessage:</em> message received, <em>value.p</em> contains the pointer to message.</li> <li><em>osErrorParameter:</em> a parameter is invalid or outside of a permitted range. </li> </ul> </div> </div> <a class="anchor" id="gac0dcf462fc92de8ffaba6cc004514a6d"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osMessagePut </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#ad9ec70c32c6c521970636b521e12d17f">osMessageQId</a>&#160;</td> <td class="paramname"><em>queue_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>info</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">queue_id</td><td>message queue ID obtained with <a class="el" href="group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78">osMessageCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">info</td><td>message information. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMessagePut</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Put the message <em>info</em> in a message queue specified by <em>queue_id</em>.</p> <p>When the message queue is full, the system retries for a specified time with <em>millisec</em>. While the system retries the thread that is calling this function is put into the state <b>WAITING</b>. The <em>millisec</em> timeout can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until a message queue slot becomes available.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <dl class="section note"><dt>Note</dt><dd>The parameter <em>millisec</em> must be 0 for using this function in an ISR. </dd> <dd> <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the message is put into the queue.</li> <li><em>osErrorResource:</em> no memory in the queue was available.</li> <li><em>osErrorTimeoutResource:</em> no memory in the queue was available during the given time limit.</li> <li><em>osErrorParameter:</em> a parameter is invalid or outside of a permitted range. </li> </ul> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Message.html
HTML
apache-2.0
35,951
var group__CMSIS__RTOS__Message = [ [ "osFeature_MessageQ", "group__CMSIS__RTOS__Message.html#ga479a6561f859e3d4818e25708593d203", null ], [ "osMessageQ", "group__CMSIS__RTOS__Message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97", null ], [ "osMessageQDef", "group__CMSIS__RTOS__Message.html#gac9a6a6276c12609793e7701afcc82326", null ], [ "osMessageCreate", "group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78", null ], [ "osMessageGet", "group__CMSIS__RTOS__Message.html#ga6c6892b8f2296cca6becd57ca2d7e1ae", null ], [ "osMessagePut", "group__CMSIS__RTOS__Message.html#gac0dcf462fc92de8ffaba6cc004514a6d", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Message.js
JavaScript
apache-2.0
651
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Mutexes</title> <title>CMSIS-RTOS: Mutexes</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__MutexMgmt.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Mutexes<div class="ingroups"><a class="el" href="group__CMSIS__RTOS__InterThread.html">Inter-Thread Communication and Resource Sharing</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Synchronize resource access using Mutual Exclusion (Mutex). <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga9b522438489d7c402c95332b58bc94f3"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3">osMutexDef</a>(name)&#160;&#160;&#160;const <a class="el" href="cmsis__os_8h.html#structosMutexDef__t">osMutexDef_t</a> os_mutex_def_##name = { 0 }</td></tr> <tr class="memdesc:ga9b522438489d7c402c95332b58bc94f3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a Mutex. <a href="#ga9b522438489d7c402c95332b58bc94f3">More...</a><br/></td></tr> <tr class="separator:ga9b522438489d7c402c95332b58bc94f3"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1122a86faa64b4a0880c76cf68d0c934"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934">osMutex</a>(name)&#160;&#160;&#160;&amp;os_mutex_def_##name</td></tr> <tr class="memdesc:ga1122a86faa64b4a0880c76cf68d0c934"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access a Mutex definition. <a href="#ga1122a86faa64b4a0880c76cf68d0c934">More...</a><br/></td></tr> <tr class="separator:ga1122a86faa64b4a0880c76cf68d0c934"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga5c9de56e717016e39e788064e9a291cc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a> (const <a class="el" href="cmsis__os_8h.html#structosMutexDef__t">osMutexDef_t</a> *mutex_def)</td></tr> <tr class="memdesc:ga5c9de56e717016e39e788064e9a291cc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create and Initialize a Mutex object. <a href="#ga5c9de56e717016e39e788064e9a291cc">More...</a><br/></td></tr> <tr class="separator:ga5c9de56e717016e39e788064e9a291cc"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga5e1752b73f573ee015dbd9ef1edaba13"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13">osMutexWait</a> (<a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id, uint32_t millisec)</td></tr> <tr class="memdesc:ga5e1752b73f573ee015dbd9ef1edaba13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait until a Mutex becomes available. <a href="#ga5e1752b73f573ee015dbd9ef1edaba13">More...</a><br/></td></tr> <tr class="separator:ga5e1752b73f573ee015dbd9ef1edaba13"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga006e4744d741e8e132c3d5bbc295afe1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga006e4744d741e8e132c3d5bbc295afe1">osMutexRelease</a> (<a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id)</td></tr> <tr class="memdesc:ga006e4744d741e8e132c3d5bbc295afe1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a Mutex that was obtained by <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13">osMutexWait</a>. <a href="#ga006e4744d741e8e132c3d5bbc295afe1">More...</a><br/></td></tr> <tr class="separator:ga006e4744d741e8e132c3d5bbc295afe1"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gac27e24135185d51d18f3dabc20910219"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#gac27e24135185d51d18f3dabc20910219">osMutexDelete</a> (<a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id)</td></tr> <tr class="memdesc:gac27e24135185d51d18f3dabc20910219"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete a Mutex that was created by <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a>. <a href="#gac27e24135185d51d18f3dabc20910219">More...</a><br/></td></tr> <tr class="separator:gac27e24135185d51d18f3dabc20910219"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p><b>Mutual exclusion</b> (widely known as <b>Mutex</b>) is used in various operating systems for resource management. Many resources in a microcontroller device can be used repeatedly, but only by one thread at a time (for example communication channels, memory, and files). Mutexes are used to protect access to a shared resource. A mutex is created and then passed between the threads (they can acquire and release the mutex).</p> <div class="image"> <img src="Mutex.png" alt="Mutex.png"/> <div class="caption"> CMSIS-RTOS Mutex</div></div> <p> A mutex is a special version of a <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html">semaphore</a>. Like the semaphore, it is a container for tokens. But instead of being able to have multiple tokens, a mutex can only carry one (representing the resource). Thus, a mutex token is binary and bounded. The advantage of a mutex is that it introduces thread ownership. When a thread acquires a mutex and becomes its owner, subsequent mutex acquires from that thread will succeed immediately without any latency. Thus, mutex acquires/releases can be nested.</p> <dl class="section note"><dt>Note</dt><dd><ul> <li>Mutex management functions cannot be called from interrupt service routines (ISR), unlike a binary semaphore that can be released from an ISR.</li> <li>CMSIS-RTOS uses <a href="https://en.wikipedia.org/wiki/Reentrant_mutex" target="_blank">reentrant/recursive mutexes</a> only.</li> </ul> </dd></dl> <h2>Working with Mutexes </h2> <p>To use mutexes, you need to follow these steps for creating and using them:</p> <ol type="1"> <li>Declare the mutex container and initialize the mutex: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3">osMutexDef</a> (uart_mutex); <span class="comment">// Declare mutex</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> (uart_mutex_id); <span class="comment">// Mutex ID</span></div> </div><!-- fragment --></li> <li>Create the mutex in a thread: <div class="fragment"><div class="line">uart_mutex_id = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a>(<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934">osMutex</a>(uart_mutex));</div> </div><!-- fragment --></li> <li>Acquire the mutex when peripheral access is required: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13">osMutexWait</a>(uart_mutex_id, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div> </div><!-- fragment --></li> <li>When finished with the peripheral access, release the mutex: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga006e4744d741e8e132c3d5bbc295afe1">osMutexRelease</a>(uart_mutex_id);</div> </div><!-- fragment --> </li> </ol> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga1122a86faa64b4a0880c76cf68d0c934"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osMutex</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;&amp;os_mutex_def_##name</td> </tr> </table> </div><div class="memdoc"> <p>Access to mutex object for the functions <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the mutex object. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osMutex</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="ga9b522438489d7c402c95332b58bc94f3"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osMutexDef</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;const <a class="el" href="cmsis__os_8h.html#structosMutexDef__t">osMutexDef_t</a> os_mutex_def_##name = { 0 }</td> </tr> </table> </div><div class="memdoc"> <p>Define a mutex object that is referenced by <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934">osMutex</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the mutex object. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osMutexDef</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga5c9de56e717016e39e788064e9a291cc"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> osMutexCreate </td> <td>(</td> <td class="paramtype">const <a class="el" href="cmsis__os_8h.html#structosMutexDef__t">osMutexDef_t</a> *&#160;</td> <td class="paramname"><em>mutex_def</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">mutex_def</td><td>mutex definition referenced with <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934">osMutex</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>mutex ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMutexCreate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Create and initialize a Mutex object.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3">osMutexDef</a> (MutexIsr); <span class="comment">// Mutex name definition</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> CreateMutex (<span class="keywordtype">void</span>) {</div> <div class="line"><a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id; </div> <div class="line"> </div> <div class="line"> mutex_id = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a> (<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934">osMutex</a> (MutexIsr));</div> <div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div> <div class="line"> <span class="comment">// Mutex object created</span></div> <div class="line"> } </div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gac27e24135185d51d18f3dabc20910219"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osMutexDelete </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a>&#160;</td> <td class="paramname"><em>mutex_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">mutex_id</td><td>mutex ID obtained by <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMutexDelete</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Delete a Mutex object. The function releases internal memory obtained for Mutex handling. After this call the <em>mutex_id</em> is no longer valid and cannot be used. The Mutex may be created again using the function <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a>.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the mutex object has been deleted.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#gac27e24135185d51d18f3dabc20910219">osMutexDelete</a> cannot be called from interrupt service routines.</li> <li><em>osErrorResource:</em> all tokens have already been released.</li> <li><em>osErrorParameter:</em> the parameter <em>mutex_id</em> is incorrect.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3">osMutexDef</a> (MutexIsr); <span class="comment">// Mutex name definition </span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id; <span class="comment">// Mutex id populated by the function CreateMutex()</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> CreateMutex (<span class="keywordtype">void</span>); <span class="comment">// function prototype that creates the Mutex</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> DeleteMutex (<a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id) {</div> <div class="line"><a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gac27e24135185d51d18f3dabc20910219">osMutexDelete</a>(mutex_id);</div> <div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// handle failure code</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga006e4744d741e8e132c3d5bbc295afe1"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osMutexRelease </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a>&#160;</td> <td class="paramname"><em>mutex_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">mutex_id</td><td>mutex ID obtained by <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMutexRelease</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Release a Mutex that was obtained with <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13">osMutexWait</a>. Other threads that currently wait for the same mutex will be now put into the state <b>READY</b>.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the mutex has been correctly released.</li> <li><em>osErrorResource:</em> the mutex was not obtained before.</li> <li><em>osErrorParameter:</em> the parameter <em>mutex_id</em> is incorrect.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga006e4744d741e8e132c3d5bbc295afe1">osMutexRelease</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3">osMutexDef</a> (MutexIsr); <span class="comment">// Mutex name definition </span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id; <span class="comment">// Mutex id populated by the function CreateMutex()</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> CreateMutex (<span class="keywordtype">void</span>); <span class="comment">// function prototype that creates the Mutex</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> ReleaseMutex (<a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id) {</div> <div class="line"><a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga006e4744d741e8e132c3d5bbc295afe1">osMutexRelease</a>(mutex_id);</div> <div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// handle failure code</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga5e1752b73f573ee015dbd9ef1edaba13"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osMutexWait </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a>&#160;</td> <td class="paramname"><em>mutex_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">mutex_id</td><td>mutex ID obtained by <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osMutexWait</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Wait until a Mutex becomes available. If no other thread has obtained the Mutex, the function instantly returns and blocks the mutex object.</p> <p>The argument <em>millisec</em> specifies how long the system waits for a mutex. While the system waits the thread that is calling this function is put into the state <b>WAITING</b>. The <em>millisec</em> timeout can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until the mutex becomes available.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the mutex has been obtained.</li> <li><em>osErrorTimeoutResource:</em> the mutex could not be obtained in the given time.</li> <li><em>osErrorResource:</em> the mutex could not be obtained when no timeout was specified.</li> <li><em>osErrorParameter:</em> the parameter <em>mutex_id</em> is incorrect.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13">osMutexWait</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3">osMutexDef</a> (MutexIsr);</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> WaitMutex (<span class="keywordtype">void</span>) {</div> <div class="line"><a class="code" href="cmsis__os_8h.html#a3263c1ad9fd79b84f908d65e8da44ac2">osMutexId</a> mutex_id; </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status;</div> <div class="line"> </div> <div class="line"> mutex_id = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc">osMutexCreate</a> (<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934">osMutex</a> (MutexIsr));</div> <div class="line"> <span class="keywordflow">if</span> (mutex_id != NULL) {</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13">osMutexWait</a> (mutex_id, 0);</div> <div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// handle failure code</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__MutexMgmt.html
HTML
apache-2.0
32,669
var group__CMSIS__RTOS__MutexMgmt = [ [ "osMutex", "group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934", null ], [ "osMutexDef", "group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3", null ], [ "osMutexCreate", "group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc", null ], [ "osMutexDelete", "group__CMSIS__RTOS__MutexMgmt.html#gac27e24135185d51d18f3dabc20910219", null ], [ "osMutexRelease", "group__CMSIS__RTOS__MutexMgmt.html#ga006e4744d741e8e132c3d5bbc295afe1", null ], [ "osMutexWait", "group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__MutexMgmt.js
JavaScript
apache-2.0
653
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Memory Pool</title> <title>CMSIS-RTOS: Memory Pool</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__PoolMgmt.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Memory Pool<div class="ingroups"><a class="el" href="group__CMSIS__RTOS__InterThread.html">Inter-Thread Communication and Resource Sharing</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Manage thread-safe fixed-size blocks of dynamic memory. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:gadd84b683001de327894851b428587caa"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#gadd84b683001de327894851b428587caa">osFeature_Pool</a>&#160;&#160;&#160;1</td></tr> <tr class="memdesc:gadd84b683001de327894851b428587caa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Memory Pools: 1=available, 0=not available. <a href="#gadd84b683001de327894851b428587caa">More...</a><br/></td></tr> <tr class="separator:gadd84b683001de327894851b428587caa"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga87b471d4fe2d5dbd0040708edd52771b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b">osPoolDef</a>(name, no, type)</td></tr> <tr class="memdesc:ga87b471d4fe2d5dbd0040708edd52771b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a Memory Pool. <a href="#ga87b471d4fe2d5dbd0040708edd52771b">More...</a><br/></td></tr> <tr class="separator:ga87b471d4fe2d5dbd0040708edd52771b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga5f0b204a82327533d420210125c90697"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a>(name)&#160;&#160;&#160;&amp;os_pool_def_##name</td></tr> <tr class="memdesc:ga5f0b204a82327533d420210125c90697"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access a Memory Pool definition. <a href="#ga5f0b204a82327533d420210125c90697">More...</a><br/></td></tr> <tr class="separator:ga5f0b204a82327533d420210125c90697"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga34af5c4f4ab38f4138ea7f1f9ece3a1a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a> (const <a class="el" href="cmsis__os_8h.html#structosPoolDef__t">osPoolDef_t</a> *pool_def)</td></tr> <tr class="memdesc:ga34af5c4f4ab38f4138ea7f1f9ece3a1a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create and Initialize a memory pool. <a href="#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">More...</a><br/></td></tr> <tr class="separator:ga34af5c4f4ab38f4138ea7f1f9ece3a1a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaa0b2994f1a866c19e0d11e6e0d44f543"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543">osPoolAlloc</a> (<a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> pool_id)</td></tr> <tr class="memdesc:gaa0b2994f1a866c19e0d11e6e0d44f543"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate a memory block from a memory pool. <a href="#gaa0b2994f1a866c19e0d11e6e0d44f543">More...</a><br/></td></tr> <tr class="separator:gaa0b2994f1a866c19e0d11e6e0d44f543"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga9f129fcad4730fbd1048ad4fa262f36a"><td class="memItemLeft" align="right" valign="top">void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga9f129fcad4730fbd1048ad4fa262f36a">osPoolCAlloc</a> (<a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> pool_id)</td></tr> <tr class="memdesc:ga9f129fcad4730fbd1048ad4fa262f36a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Allocate a memory block from a memory pool and set memory block to zero. <a href="#ga9f129fcad4730fbd1048ad4fa262f36a">More...</a><br/></td></tr> <tr class="separator:ga9f129fcad4730fbd1048ad4fa262f36a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga4a861e9c469c9d0daf5721bf174f8e54"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga4a861e9c469c9d0daf5721bf174f8e54">osPoolFree</a> (<a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> pool_id, void *block)</td></tr> <tr class="memdesc:ga4a861e9c469c9d0daf5721bf174f8e54"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return an allocated memory block back to a specific memory pool. <a href="#ga4a861e9c469c9d0daf5721bf174f8e54">More...</a><br/></td></tr> <tr class="separator:ga4a861e9c469c9d0daf5721bf174f8e54"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p><b>Memory</b> <b>pools</b> are fixed-size blocks of memory that are thread-safe. They operate much faster than the dynamically allocated heap and do not suffer from fragmentation. Being thread-safe, they can be accessed from threads and ISRs alike.</p> <p><b>Shared</b> <b>memory</b> is one of the basic models to exchange information between threads. Using memory pools for exchanging data, you can share more complex objects between threads if compared to a <a class="el" href="group__CMSIS__RTOS__Message.html">Message Queue</a>. Memory pool management functions are used to define and manage such fixed-sized memory pools.</p> <h2>Working with Memory Pools </h2> <p>Follow these steps to create and use a memory pool:</p> <ol type="1"> <li>Declare a data structure that combines a number of elements: <div class="fragment"><div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div> <div class="line"> uint32_t length;</div> <div class="line"> uint32_t width;</div> <div class="line"> uint32_t height;</div> <div class="line"> uint32_t weight;</div> <div class="line">} properties_t;</div> </div><!-- fragment --></li> <li>Declare a memory pool of these objects as a block of memory: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b">osPoolDef</a> (object_pool, 10, properties_t); <span class="comment">// Declare memory pool</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> (object_pool_id); <span class="comment">// Memory pool ID</span></div> </div><!-- fragment --></li> <li>Then, create the memory pool in a thread: <div class="fragment"><div class="line">object_pool_id = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a>(<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a>(object_pool));</div> </div><!-- fragment --></li> <li>Allocate the pool within a thread and fill it with data: <div class="fragment"><div class="line">properties_t *object_data;</div> <div class="line"> object_data = (properties_t *) <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543">osPoolAlloc</a>(object_pool_id);</div> <div class="line"> </div> <div class="line">object_data-&gt;length = 100;</div> <div class="line">object_data-&gt;width = 10;</div> <div class="line">object_data-&gt;height = 23;</div> <div class="line">object_data-&gt;weight = 1000;</div> </div><!-- fragment --> </li> </ol> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="gadd84b683001de327894851b428587caa"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_Pool&#160;&#160;&#160;1</td> </tr> </table> </div><div class="memdoc"> <p>A CMSIS-RTOS implementation may support fixed-size memory pools.</p> <ul> <li>When <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#gadd84b683001de327894851b428587caa">osFeature_Pool</a> is 1 memory pools are supported.</li> <li>When <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#gadd84b683001de327894851b428587caa">osFeature_Pool</a> is 0 no memory pools are supported.</li> </ul> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_Pool</b> is 1 </p> </div> </div> <a class="anchor" id="ga5f0b204a82327533d420210125c90697"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osPool</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;&amp;os_pool_def_##name</td> </tr> </table> </div><div class="memdoc"> <p>Access a memory pool for the functions <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the memory pool </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osPool</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="ga87b471d4fe2d5dbd0040708edd52771b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osPoolDef</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">no, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">type&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Define a memory pool that is referenced by <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the memory pool. </td></tr> <tr><td class="paramname">no</td><td>maximum number of blocks (objects) in the memory pool. </td></tr> <tr><td class="paramname">type</td><td>data type of a single block (object). </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osPoolDef</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="gaa0b2994f1a866c19e0d11e6e0d44f543"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void * osPoolAlloc </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a>&#160;</td> <td class="paramname"><em>pool_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">pool_id</td><td>memory pool ID obtain referenced with <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>address of the allocated memory block or NULL in case of no memory available. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osPoolAlloc</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Allocate a memory block from the memory pool.</p> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div> <div class="line"> uint8_t Buf[32];</div> <div class="line"> uint8_t Idx;</div> <div class="line">} MEM_BLOCK;</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b">osPoolDef</a> (MemPool, 8, MEM_BLOCK);</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> AlocMemoryPoolBlock (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> MemPool_Id;</div> <div class="line"> MEM_BLOCK *addr;</div> <div class="line"> </div> <div class="line"> MemPool_Id = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a> (<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a> (MemPool));</div> <div class="line"> <span class="keywordflow">if</span> (MemPool_Id != NULL) {</div> <div class="line"> :</div> <div class="line"> <span class="comment">// allocate a memory block</span></div> <div class="line"> addr = (MEM_BLOCK *)<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543">osPoolAlloc</a> (MemPool_Id);</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (addr != NULL) {</div> <div class="line"> <span class="comment">// memory block was allocated</span></div> <div class="line"> :</div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga9f129fcad4730fbd1048ad4fa262f36a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void * osPoolCAlloc </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a>&#160;</td> <td class="paramname"><em>pool_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">pool_id</td><td>memory pool ID obtain referenced with <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>address of the allocated memory block or NULL in case of no memory available. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osPoolCAlloc</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Allocate a memory block from the memory pool. The block is initialized to zero.</p> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div> <div class="line"> uint8_t Buf[32];</div> <div class="line"> uint8_t Idx;</div> <div class="line">} MEM_BLOCK;</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b">osPoolDef</a> (MemPool, 8, MEM_BLOCK);</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> CAlocMemoryPoolBlock (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> MemPool_Id;</div> <div class="line"> MEM_BLOCK *addr;</div> <div class="line"> </div> <div class="line"> MemPool_Id = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a> (<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a> (MemPool));</div> <div class="line"> <span class="keywordflow">if</span> (MemPool_Id != NULL) {</div> <div class="line"> :</div> <div class="line"> <span class="comment">// allocate a memory block</span></div> <div class="line"> addr = (MEM_BLOCK *)<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga9f129fcad4730fbd1048ad4fa262f36a">osPoolCAlloc</a> (MemPool_Id);</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (addr != NULL) {</div> <div class="line"> <span class="comment">// memory block was allocated</span></div> <div class="line"> :</div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga34af5c4f4ab38f4138ea7f1f9ece3a1a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> osPoolCreate </td> <td>(</td> <td class="paramtype">const <a class="el" href="cmsis__os_8h.html#structosPoolDef__t">osPoolDef_t</a> *&#160;</td> <td class="paramname"><em>pool_def</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">pool_def</td><td>memory pool definition referenced with <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>memory pool ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osPoolCreate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Create and initialize a memory pool.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div> <div class="line"> uint8_t Buf[32];</div> <div class="line"> uint8_t Idx;</div> <div class="line">} MEM_BLOCK;</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b">osPoolDef</a> (MemPool, 8, MEM_BLOCK);</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> CreateMemoryPool (<span class="keywordtype">void</span>) {</div> <div class="line"><a class="code" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> MemPool_Id;</div> <div class="line"> </div> <div class="line"> MemPool_Id = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a> (<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a> (MemPool));</div> <div class="line"> <span class="keywordflow">if</span> (MemPool_Id != NULL) {</div> <div class="line"> <span class="comment">// memory pool created</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga4a861e9c469c9d0daf5721bf174f8e54"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osPoolFree </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a>&#160;</td> <td class="paramname"><em>pool_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void *&#160;</td> <td class="paramname"><em>block</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">pool_id</td><td>memory pool ID obtain referenced with <a class="el" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">block</td><td>address of the allocated memory block that is returned to the memory pool. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osPoolFree</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Return a memory block to a memory pool.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the memory block is released.</li> <li><em>osErrorValue:</em> <em>block</em> does not belong to the memory pool.</li> <li><em>osErrorParameter:</em> a parameter is invalid or outside of a permitted range.</li> </ul> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div> <div class="line"> uint8_t Buf[32];</div> <div class="line"> uint8_t Idx;</div> <div class="line">} MEM_BLOCK;</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b">osPoolDef</a> (MemPool, 8, MEM_BLOCK);</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> CAlocMemoryPoolBlock (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#a08d2e20fd9bbd96220fe068d420f3686">osPoolId</a> MemPool_Id;</div> <div class="line"> MEM_BLOCK *addr;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status;</div> <div class="line"> </div> <div class="line"> MemPool_Id = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a">osPoolCreate</a> (<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697">osPool</a> (MemPool));</div> <div class="line"> <span class="keywordflow">if</span> (MemPool_Id != NULL) {</div> <div class="line"> addr = (MEM_BLOCK *)<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga9f129fcad4730fbd1048ad4fa262f36a">osPoolCAlloc</a> (MemPool_Id);</div> <div class="line"> <span class="keywordflow">if</span> (addr != NULL) {</div> <div class="line"> :</div> <div class="line"> <span class="comment">// return a memory block back to pool</span></div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga4a861e9c469c9d0daf5721bf174f8e54">osPoolFree</a> (MemPool_Id, addr);</div> <div class="line"> <span class="keywordflow">if</span> (status==<a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// handle status code</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__PoolMgmt.html
HTML
apache-2.0
31,956
var group__CMSIS__RTOS__PoolMgmt = [ [ "osFeature_Pool", "group__CMSIS__RTOS__PoolMgmt.html#gadd84b683001de327894851b428587caa", null ], [ "osPool", "group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697", null ], [ "osPoolDef", "group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b", null ], [ "osPoolAlloc", "group__CMSIS__RTOS__PoolMgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543", null ], [ "osPoolCAlloc", "group__CMSIS__RTOS__PoolMgmt.html#ga9f129fcad4730fbd1048ad4fa262f36a", null ], [ "osPoolCreate", "group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a", null ], [ "osPoolFree", "group__CMSIS__RTOS__PoolMgmt.html#ga4a861e9c469c9d0daf5721bf174f8e54", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__PoolMgmt.js
JavaScript
apache-2.0
742
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Semaphores</title> <title>CMSIS-RTOS: Semaphores</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__SemaphoreMgmt.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Semaphores<div class="ingroups"><a class="el" href="group__CMSIS__RTOS__InterThread.html">Inter-Thread Communication and Resource Sharing</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Access shared resources simultaneously from different threads. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga7da4c7bfb340779c9fc7b321f5ab3e3a"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga7da4c7bfb340779c9fc7b321f5ab3e3a">osFeature_Semaphore</a>&#160;&#160;&#160;30</td></tr> <tr class="memdesc:ga7da4c7bfb340779c9fc7b321f5ab3e3a"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum count for <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a> function <a href="#ga7da4c7bfb340779c9fc7b321f5ab3e3a">More...</a><br/></td></tr> <tr class="separator:ga7da4c7bfb340779c9fc7b321f5ab3e3a"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga9e66fe361749071e5ab87826c43c2f1b"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga9e66fe361749071e5ab87826c43c2f1b">osSemaphoreDef</a>(name)&#160;&#160;&#160;const <a class="el" href="cmsis__os_8h.html#structosSemaphoreDef__t">osSemaphoreDef_t</a> os_semaphore_def_##name = { 0 }</td></tr> <tr class="memdesc:ga9e66fe361749071e5ab87826c43c2f1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a Semaphore object. <a href="#ga9e66fe361749071e5ab87826c43c2f1b">More...</a><br/></td></tr> <tr class="separator:ga9e66fe361749071e5ab87826c43c2f1b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga03761ee8d2c3cd4544e18364ab301dac"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac">osSemaphore</a>(name)&#160;&#160;&#160;&amp;os_semaphore_def_##name</td></tr> <tr class="memdesc:ga03761ee8d2c3cd4544e18364ab301dac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access a Semaphore definition. <a href="#ga03761ee8d2c3cd4544e18364ab301dac">More...</a><br/></td></tr> <tr class="separator:ga03761ee8d2c3cd4544e18364ab301dac"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga97381e8e55cd47cec390bf57c96d6edb"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a> (const <a class="el" href="cmsis__os_8h.html#structosSemaphoreDef__t">osSemaphoreDef_t</a> *semaphore_def, int32_t count)</td></tr> <tr class="memdesc:ga97381e8e55cd47cec390bf57c96d6edb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create and Initialize a Semaphore object used for managing resources. <a href="#ga97381e8e55cd47cec390bf57c96d6edb">More...</a><br/></td></tr> <tr class="separator:ga97381e8e55cd47cec390bf57c96d6edb"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gacc15b0fc8ce1167fe43da33042e62098"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098">osSemaphoreWait</a> (<a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a> semaphore_id, uint32_t millisec)</td></tr> <tr class="memdesc:gacc15b0fc8ce1167fe43da33042e62098"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait until a Semaphore token becomes available. <a href="#gacc15b0fc8ce1167fe43da33042e62098">More...</a><br/></td></tr> <tr class="separator:gacc15b0fc8ce1167fe43da33042e62098"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gab108914997c49e14d8ff1ae0d1988ca0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0">osSemaphoreRelease</a> (<a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a> semaphore_id)</td></tr> <tr class="memdesc:gab108914997c49e14d8ff1ae0d1988ca0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release a Semaphore token. <a href="#gab108914997c49e14d8ff1ae0d1988ca0">More...</a><br/></td></tr> <tr class="separator:gab108914997c49e14d8ff1ae0d1988ca0"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gabae2801ac2c096f6e8c69a264908f595"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gabae2801ac2c096f6e8c69a264908f595">osSemaphoreDelete</a> (<a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a> semaphore_id)</td></tr> <tr class="memdesc:gabae2801ac2c096f6e8c69a264908f595"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete a Semaphore that was created by <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>. <a href="#gabae2801ac2c096f6e8c69a264908f595">More...</a><br/></td></tr> <tr class="separator:gabae2801ac2c096f6e8c69a264908f595"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>Semaphores are used to manage and protect access to shared resources. Semaphores are very similar to <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html">Mutexes</a>. Whereas a Mutex permits just one thread to access a shared resource at a time, a semaphore can be used to permit a fixed number of threads to access a pool of shared resources. Using semaphores, access to a group of identical peripherals can be managed (for example multiple DMA channels).</p> <div class="image"> <img src="Semaphore.png" alt="Semaphore.png"/> <div class="caption"> CMSIS-RTOS Semaphore</div></div> <p> A semaphore object should be initialized to the maximum number of available tokens. This number of available resources is specified as parameter of the <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a> function. Each time a semaphore token is obtained with <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098">osSemaphoreWait</a>, the semaphore count is decremented. When the semaphore count is 0, no semaphore token can be obtained. The thread that tries to obtain the semaphore token needs to wait until the next token is free. Semaphores are released with <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0">osSemaphoreRelease</a> incrementing the semaphore count.</p> <dl class="section note"><dt>Note</dt><dd>Semaphore tokens can be acquired from threads and released from threads and ISRs.</dd></dl> <h2>Working with Semaphores </h2> <p>Follow these steps to create and use a semaphore:</p> <ol type="1"> <li>Declare the semaphore container and initialize the semaphore: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga9e66fe361749071e5ab87826c43c2f1b">osSemaphoreDef</a> (my_semaphore); <span class="comment">// Declare semaphore</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a> (my_semaphore_id); <span class="comment">// Semaphore ID</span></div> </div><!-- fragment --></li> <li>Initialize the semaphore container with a number of tokens within a thread: <div class="fragment"><div class="line">my_semaphore_id = <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>(<a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac">osSemaphore</a>(my_semaphore), 4); <span class="comment">// Create semaphore with 4 tokens</span></div> </div><!-- fragment --> <b>Important:</b> semaphore tokens can be created and destroyed as threads run. This means that can initialize a semaphore with zero tokens and then use one thread to add/create tokens to the semaphore while a second thread removes them. In this way you can distinguish between producer and consumer threads.</li> <li>Acquire a token from the semaphore container: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098">osSemaphoreWait</a>(my_semaphore_id, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div> </div><!-- fragment --></li> <li>When finished using the semaphore resource, send the token back to the semaphore container: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0">osSemaphoreRelease</a>(my_semaphore_id);</div> </div><!-- fragment --></li> </ol> <h2>Semaphore Use Cases </h2> <p>Due to their flexibility, semaphores cover a wide range of synchronizing applications. At the same time, they are perhaps the most challenging RTOS object to understand. The following explains a use case for semaphores, taken from the book <a href="http://www.greenteapress.com/semaphores/" target="_blank">The Little Book Of Semaphores</a> by Allen B. Downey which is available for free download.</p> <p><b>Non-binary Semaphore (Multiplex)</b></p> <p>A multiplex limits the number of threads that can access a critical section of code. For example, this could be a function accessing DMA resources which can only support a limited number of calls.</p> <p>To allow multiple threads to run the function, initialize a semaphore to the maximum number of threads that can be allowed. The number of tokens in the semaphore represents the number of additional threads that may enter. If this number is zero, then the next thread trying to access the function will have to wait until one of the other threads exits and releases its token. When all threads have exited the token number is back to n. Ths following example shows the code for one of the threads that might access the resource:</p> <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga9e66fe361749071e5ab87826c43c2f1b">osSemaphoreDef</a>(multiplex);</div> <div class="line"><a class="code" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a> (multiplex_id);</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> thread_n (<span class="keywordtype">void</span>)</div> <div class="line"> {</div> <div class="line"> multiplex_id = <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>(<a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac">osSemaphore</a>(multiplex), 3);</div> <div class="line"> <span class="keywordflow">while</span>(1)</div> <div class="line"> {</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098">osSemaphoreWait</a>(multiplex_id, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>);</div> <div class="line"> <span class="comment">// do something</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0">osSemaphoreRelease</a>(multiplex_id);</div> <div class="line"> }</div> <div class="line"> }</div> </div><!-- fragment --> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga7da4c7bfb340779c9fc7b321f5ab3e3a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_Semaphore&#160;&#160;&#160;30</td> </tr> </table> </div><div class="memdoc"> <p>A CMSIS-RTOS implementation may support semaphores. The value <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga7da4c7bfb340779c9fc7b321f5ab3e3a">osFeature_Semaphore</a> indicates the maximum index count for a semaphore.</p> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_Semaphore</b> is 65535 </p> </div> </div> <a class="anchor" id="ga03761ee8d2c3cd4544e18364ab301dac"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osSemaphore</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;&amp;os_semaphore_def_##name</td> </tr> </table> </div><div class="memdoc"> <p>Access to semaphore object for the functions <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the semaphore object. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osSemaphore</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="ga9e66fe361749071e5ab87826c43c2f1b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osSemaphoreDef</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;const <a class="el" href="cmsis__os_8h.html#structosSemaphoreDef__t">osSemaphoreDef_t</a> os_semaphore_def_##name = { 0 }</td> </tr> </table> </div><div class="memdoc"> <p>Define a semaphore object that is referenced by <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac">osSemaphore</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the semaphore object. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osSemaphoreDef</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga97381e8e55cd47cec390bf57c96d6edb"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a> osSemaphoreCreate </td> <td>(</td> <td class="paramtype">const <a class="el" href="cmsis__os_8h.html#structosSemaphoreDef__t">osSemaphoreDef_t</a> *&#160;</td> <td class="paramname"><em>semaphore_def</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t&#160;</td> <td class="paramname"><em>count</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">semaphore_def</td><td>semaphore definition referenced with <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac">osSemaphore</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">count</td><td>number of available resources. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>semaphore ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osSemaphoreCreate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Create and initialize a Semaphore object that is used to manage access to shared resources. The parameter <em>count</em> specifies the number of available resources. The <em>count</em> value 1 creates a binary semaphore.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> tid_thread1; <span class="comment">// ID for thread 1</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> tid_thread2; <span class="comment">// ID for thread 2</span></div> <div class="line"> </div> <div class="line"><a class="code" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a> semaphore; <span class="comment">// Semaphore ID</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga9e66fe361749071e5ab87826c43c2f1b">osSemaphoreDef</a>(semaphore); <span class="comment">// Semaphore definition</span></div> <div class="line"> </div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="comment">// Thread 1 - High Priority - Active every 3ms</span></div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="keywordtype">void</span> thread1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument) {</div> <div class="line"> int32_t value;</div> <div class="line"></div> <div class="line"> <span class="keywordflow">while</span> (1) {</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a>(3); <span class="comment">// Pass control to other tasks for 3ms</span></div> <div class="line"> val = <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098">osSemaphoreWait</a> (semaphore, 1); <span class="comment">// Wait 1ms for the free semaphore</span></div> <div class="line"> <span class="keywordflow">if</span> (val &gt; 0) {</div> <div class="line"> <span class="comment">// If there was no time-out the semaphore was acquired</span></div> <div class="line"> : <span class="comment">// OK, the interface is free now, use it.</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0">osSemaphoreRelease</a> (semaphore); <span class="comment">// Return a token back to a semaphore</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> <div class="line"> </div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="comment">// Thread 2 - Normal Priority - looks for a free semaphore and uses</span></div> <div class="line"><span class="comment">// the resource whenever it is available</span></div> <div class="line"><span class="comment">//</span></div> <div class="line"><span class="keywordtype">void</span> thread2 (<span class="keywordtype">void</span> <span class="keyword">const</span> *argument) {</div> <div class="line"> <span class="keywordflow">while</span> (1) {</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098">osSemaphoreWait</a> (semaphore, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// Wait indefinitely for a free semaphore</span></div> <div class="line"> <span class="comment">// OK, the interface is free now, use it.</span></div> <div class="line"> :</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0">osSemaphoreRelease</a> (semaphore); <span class="comment">// Return a token back to a semaphore.</span></div> <div class="line"> }</div> <div class="line">}</div> <div class="line"> </div> <div class="line"><span class="comment">// Thread definitions </span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a>(thread1, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2">osPriorityHigh</a>, 1, 0);</div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a>(thread2, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 1, 0);</div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> StartApplication (<span class="keywordtype">void</span>) {</div> <div class="line"> semaphore = <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>(<a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac">osSemaphore</a>(semaphore), 1);</div> <div class="line"></div> <div class="line"> tid_thread1 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>(<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(thread1), NULL);</div> <div class="line"> tid_thread2 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>(<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(thread2), NULL);</div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gabae2801ac2c096f6e8c69a264908f595"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osSemaphoreDelete </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a>&#160;</td> <td class="paramname"><em>semaphore_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">semaphore_id</td><td>semaphore object referenced with <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osSemaphoreDelete</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Delete a Semaphore object. The function releases internal memory obtained for Semaphore handling. After this call the <em>semaphore_id</em> is no longer valid and cannot be used. The Semaphore may be created again using the function <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the semaphore object has been deleted.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gabae2801ac2c096f6e8c69a264908f595">osSemaphoreDelete</a> cannot be called from interrupt service routines.</li> <li><em>osErrorResource:</em> the semaphore object could not be deleted.</li> <li><em>osErrorParameter:</em> the parameter <em>semaphore_id</em> is incorrect.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>. </dd></dl> </div> </div> <a class="anchor" id="gab108914997c49e14d8ff1ae0d1988ca0"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osSemaphoreRelease </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a>&#160;</td> <td class="paramname"><em>semaphore_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">semaphore_id</td><td>semaphore object referenced with <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osSemaphoreRelease</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Release a Semaphore token. This increments the count of available semaphore tokens.</p> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the semaphore has been released.</li> <li><em>osErrorResource:</em> all tokens have already been released.</li> <li><em>osErrorParameter:</em> the parameter <em>semaphore_id</em> is incorrect. </li> </ul> </div> </div> <a class="anchor" id="gacc15b0fc8ce1167fe43da33042e62098"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int32_t osSemaphoreWait </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#aa8968896c84094aa973683c84fa06f84">osSemaphoreId</a>&#160;</td> <td class="paramname"><em>semaphore_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">semaphore_id</td><td>semaphore object referenced with <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb">osSemaphoreCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>number of available tokens, or -1 in case of incorrect parameters. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osSemaphoreWait</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Wait until a Semaphore token becomes available. When no Semaphore token is available, the function waits for the time specified with the parameter <em>millisec</em>.</p> <p>The argument <em>millisec</em> specifies how long the system waits for a Semaphore token to become available. While the system waits the thread that is calling this function is put into the state <b>WAITING</b>. The <em>millisec</em> timeout can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until the Semaphore token becomes available.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <p>The return value indicates the number of available tokens (the semaphore count value). If 0 is returned, then no semaphore was available.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>. </dd></dl> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__SemaphoreMgmt.html
HTML
apache-2.0
36,354
var group__CMSIS__RTOS__SemaphoreMgmt = [ [ "osFeature_Semaphore", "group__CMSIS__RTOS__SemaphoreMgmt.html#ga7da4c7bfb340779c9fc7b321f5ab3e3a", null ], [ "osSemaphore", "group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac", null ], [ "osSemaphoreDef", "group__CMSIS__RTOS__SemaphoreMgmt.html#ga9e66fe361749071e5ab87826c43c2f1b", null ], [ "osSemaphoreCreate", "group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb", null ], [ "osSemaphoreDelete", "group__CMSIS__RTOS__SemaphoreMgmt.html#gabae2801ac2c096f6e8c69a264908f595", null ], [ "osSemaphoreRelease", "group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0", null ], [ "osSemaphoreWait", "group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__SemaphoreMgmt.js
JavaScript
apache-2.0
819
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Signal Events</title> <title>CMSIS-RTOS: Signal Events</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__SignalMgmt.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Signal Events<div class="ingroups"><a class="el" href="group__CMSIS__RTOS__InterThread.html">Inter-Thread Communication and Resource Sharing</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Synchronize threads using signals. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga01edde265710d883b6e237d34a6ef4a6"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga01edde265710d883b6e237d34a6ef4a6">osFeature_Signals</a>&#160;&#160;&#160;8</td></tr> <tr class="memdesc:ga01edde265710d883b6e237d34a6ef4a6"><td class="mdescLeft">&#160;</td><td class="mdescRight">maximum number of Signal Flags available per thread <a href="#ga01edde265710d883b6e237d34a6ef4a6">More...</a><br/></td></tr> <tr class="separator:ga01edde265710d883b6e237d34a6ef4a6"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga3de2730654589d6c3559c4b9e2825553"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga3de2730654589d6c3559c4b9e2825553">osSignalSet</a> (<a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id, int32_t signals)</td></tr> <tr class="memdesc:ga3de2730654589d6c3559c4b9e2825553"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the specified Signal Flags of an active thread. <a href="#ga3de2730654589d6c3559c4b9e2825553">More...</a><br/></td></tr> <tr class="separator:ga3de2730654589d6c3559c4b9e2825553"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga87283a6ebc31ce9ed42baf3ea7e4eab6"><td class="memItemLeft" align="right" valign="top">int32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6">osSignalClear</a> (<a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id, int32_t signals)</td></tr> <tr class="memdesc:ga87283a6ebc31ce9ed42baf3ea7e4eab6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the specified Signal Flags of an active thread. <a href="#ga87283a6ebc31ce9ed42baf3ea7e4eab6">More...</a><br/></td></tr> <tr class="separator:ga87283a6ebc31ce9ed42baf3ea7e4eab6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga38860acda96df47da6923348d96fc4c9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9">osSignalWait</a> (int32_t signals, uint32_t millisec)</td></tr> <tr class="memdesc:ga38860acda96df47da6923348d96fc4c9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for one or more Signal Flags to become signaled for the current <b>RUNNING</b> thread. <a href="#ga38860acda96df47da6923348d96fc4c9">More...</a><br/></td></tr> <tr class="separator:ga38860acda96df47da6923348d96fc4c9"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>Signals are used to trigger execution states between threads. The signal management functions in CMSIS-RTOS allow you to control or wait for signal flags. Each thread has up to 31 assigned signal flags. The maximum number of signal flags is defined in the <a class="el" href="cmsis__os_8h.html">cmsis_os.h</a> file (<b>#define osFeature_Signals</b>).</p> <p>A thread</p> <ul> <li>can wait for signals to be set (using <a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9">osSignalWait</a>). Using this function, it enters the <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ThreadStates">WAITING</a> state. The <a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9">osSignalWait</a> parameter <em>signals</em> defines the signals that are required to put the thread back into <b>READY</b> state.</li> <li>may set one or more flags in any other given thread (using <a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga3de2730654589d6c3559c4b9e2825553">osSignalSet</a>).</li> <li>may clear its own signals or the signals of other threads (using <a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6">osSignalClear</a>).</li> </ul> <p>When a thread wakes up and resumes execution, its signal flags are automatically cleared.</p> <h2>Working with Signals </h2> <p>Here is a simple example that shows how two thread can communicate with each others using signals:</p> <div class="image"> <img src="simple_signal.png" alt="simple_signal.png"/> <div class="caption"> Simple signal event communication</div></div> <p> The following steps are required to use signals:</p> <ol type="1"> <li>In the thread (for example thread ID <code>tid_thread1</code>) that is supposed to wait for a signal, call the wait function: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9">osSignalWait</a> (0x0001, <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>); <span class="comment">// wait forever for the signal 0x0001</span></div> </div><!-- fragment --></li> <li>In another thread (or threads) that are supposed to wake the waiting thread up call: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__SignalMgmt.html#ga3de2730654589d6c3559c4b9e2825553">osSignalSet</a> (tid_thread1, 0x0001); <span class="comment">// set the signal 0x0001 for thread tid_thread1</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a> (1000); <span class="comment">// wait for 1 second</span></div> </div><!-- fragment --> </li> </ol> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga01edde265710d883b6e237d34a6ef4a6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_Signals&#160;&#160;&#160;8</td> </tr> </table> </div><div class="memdoc"> <p>The CMSIS-RTOS API may support a variable number of signal flags. This define specifies the number of signal flags available per thread. The maximum value is 32 signal flags per thread.</p> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_Signals</b> is 16 </p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga87283a6ebc31ce9ed42baf3ea7e4eab6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int32_t osSignalClear </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td> <td class="paramname"><em>thread_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t&#160;</td> <td class="paramname"><em>signals</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">thread_id</td><td>thread ID obtained by <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> or <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">signals</td><td>specifies the signal flags of the thread that shall be cleared. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters or call from ISR. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osSignalClear</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Clear the signal flags of an active thread.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> Thread_2 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg);</div> <div class="line"></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a> (Thread_2, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2">osPriorityHigh</a>, 1, 0);</div> <div class="line"> </div> <div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> EX_Signal_1 (<span class="keywordtype">void</span>) {</div> <div class="line"> int32_t signals;</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id;</div> <div class="line"> </div> <div class="line"> thread_id = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(Thread_2), NULL);</div> <div class="line"> <span class="keywordflow">if</span> (thread_id == NULL) {</div> <div class="line"> <span class="comment">// Failed to create a thread.</span></div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">else</span> {</div> <div class="line">f :</div> <div class="line"> signals = <a class="code" href="group__CMSIS__RTOS__SignalMgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6">osSignalClear</a> (thread_id, 0x01);</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga3de2730654589d6c3559c4b9e2825553"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int32_t osSignalSet </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td> <td class="paramname"><em>thread_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">int32_t&#160;</td> <td class="paramname"><em>signals</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">thread_id</td><td>thread ID obtained by <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> or <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">signals</td><td>specifies the signal flags of the thread that should be set. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>previous signal flags of the specified thread or 0x80000000 in case of incorrect parameters. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osSignalSet</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Set the signal flags of an active thread. This function may be used also within interrupt service routines.</p> <dl class="section note"><dt>Note</dt><dd><a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a> can call this function.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> Thread_2 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg);</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a> (Thread_2, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2">osPriorityHigh</a>, 1, 0);</div> <div class="line"> </div> <div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> EX_Signal_1 (<span class="keywordtype">void</span>) {</div> <div class="line"> int32_t signals;</div> <div class="line"> uint32_t exec;</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id;</div> <div class="line"> </div> <div class="line"> thread_id = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(Thread_2), NULL);</div> <div class="line"> <span class="keywordflow">if</span> (thread_id == NULL) {</div> <div class="line"> <span class="comment">// Failed to create a thread.</span></div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">else</span> {</div> <div class="line"> signals = <a class="code" href="group__CMSIS__RTOS__SignalMgmt.html#ga3de2730654589d6c3559c4b9e2825553">osSignalSet</a> (thread_id, 0x00000005); <span class="comment">// Send signals to the created thread</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga38860acda96df47da6923348d96fc4c9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> osSignalWait </td> <td>(</td> <td class="paramtype">int32_t&#160;</td> <td class="paramname"><em>signals</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">signals</td><td>wait until all specified signal flags set or 0 for any single signal flag. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>event flag information or error code. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osSignalWait</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Suspend the execution of the current <b>RUNNING</b> thread until all specified signal flags with the parameter <em>signals</em> are set. When the parameter <em>signals</em> is 0 the current <b>RUNNING</b> thread is suspended until any signal is set. When these signal flags are already set, the function returns instantly. Otherwise the thread is put into the state <b>WAITING</b>. Signal flags that are reported as event are automatically cleared.</p> <p>The argument <em>millisec</em> specifies how long the system waits for the specified signal flags. While the system waits the thread calling this function is put into the state <b>WAITING</b>. The timeout value can have the following values:</p> <ul> <li>when <em>millisec</em> is 0, the function returns instantly.</li> <li>when <em>millisec</em> is set to <b>osWaitForever</b> the function will wait for an infinite time until a specified signal is set.</li> <li>all other values specify a time in millisecond for a timeout.</li> </ul> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> no signal received when the timeout value <em>millisec</em> was 0.</li> <li><em>osEventTimeout:</em> signal not occurred within timeout</li> <li><em>osEventSignal:</em> signal occurred, <em>value.signals</em> contains the signal flags; these signal flags are cleared.</li> <li><em>osErrorValue:</em> the value <em>signals</em> is outside of the permitted range.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9">osSignalWait</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> Thread_2 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg);</div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a> (Thread_2, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2">osPriorityHigh</a>, 1, 0);</div> <div class="line"> </div> <div class="line"><span class="keyword">static</span> <span class="keywordtype">void</span> EX_Signal_1 (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id;</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> evt;</div> <div class="line"> </div> <div class="line"> thread_id = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(Thread_2), NULL);</div> <div class="line"> <span class="keywordflow">if</span> (thread_id == NULL) {</div> <div class="line"> <span class="comment">// Failed to create a thread.</span></div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">else</span> {</div> <div class="line"> :</div> <div class="line"> <span class="comment">// wait for a signal</span></div> <div class="line"> evt = <a class="code" href="group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9">osSignalWait</a> (0x01, 100);</div> <div class="line"> <span class="keywordflow">if</span> (evt.<a class="code" href="group__CMSIS__RTOS__Definitions.html#ad477a289f1f03ac45407b64268d707d3">status</a> == <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518">osEventSignal</a>) {</div> <div class="line"> <span class="comment">// handle event status</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__SignalMgmt.html
HTML
apache-2.0
26,272
var group__CMSIS__RTOS__SignalMgmt = [ [ "osFeature_Signals", "group__CMSIS__RTOS__SignalMgmt.html#ga01edde265710d883b6e237d34a6ef4a6", null ], [ "osSignalClear", "group__CMSIS__RTOS__SignalMgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6", null ], [ "osSignalSet", "group__CMSIS__RTOS__SignalMgmt.html#ga3de2730654589d6c3559c4b9e2825553", null ], [ "osSignalWait", "group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__SignalMgmt.js
JavaScript
apache-2.0
461
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Status and Error Codes</title> <title>CMSIS-RTOS: Status and Error Codes</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__Status.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#enum-members">Enumerations</a> </div> <div class="headertitle"> <div class="title">Status and Error Codes<div class="ingroups"><a class="el" href="group__CMSIS__RTOS.html">CMSIS-RTOS API</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Status and Error Codes returned by CMSIS-RTOS API functions. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a> Enumerations</h2></td></tr> <tr class="memitem:gae2e091fefc4c767117727bd5aba4d99e"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> { <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a> = 0, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518">osEventSignal</a> = 0x08, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342">osEventMessage</a> = 0x10, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926">osEventMail</a> = 0x20, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea78f477732375c0e1fca814e369618177">osEventTimeout</a> = 0x40, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eac24adca6a5d072c9f01c32178ba0d109">osErrorParameter</a> = 0x80, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea8fc5801e8b0482bdf22ad63a77f0155d">osErrorResource</a> = 0x81, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea314d24a49003f09459035db0dd7c9467">osErrorTimeoutResource</a> = 0xC1, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea21635bdc492d3094fe83027fa4a30e2f">osErrorISR</a> = 0x82, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eaf6552310a817452aedfcd453f2805d65">osErrorISRRecursive</a> = 0x83, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eab7dda0ef504817659334cbfd650ae56f">osErrorPriority</a> = 0x84, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eaf1fac0240218e51eb30a13da2f8aae81">osErrorNoMemory</a> = 0x85, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea4672c8a0c0f6bb1d7981da4602e8e9ee">osErrorValue</a> = 0x86, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5fde24ff588ec5ab9cb8314bade26fbc">osErrorOS</a> = 0xFF, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eac7a77f5fe18a15a357790c36a4aca1b1">os_status_reserved</a> = 0x7FFFFFFF <br/> }</td></tr> <tr class="separator:gae2e091fefc4c767117727bd5aba4d99e"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>The Status and Error Codes section lists all the return values that the CMSIS-RTOS functions will return. </p> <h2 class="groupheader">Enumeration Type Documentation</h2> <a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a></td> </tr> </table> </div><div class="memdoc"> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osStatus</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>The <a class="el" href="cmsis__os_8h.html#ae2e091fefc4c767117727bd5aba4d99e">osStatus</a> enumeration defines the event status and error codes that are returned by the CMSIS-RTOS functions. </p> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f"></a>osOK</em>&#160;</td><td class="fielddoc"> <p>function completed; no error or event occurred. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518"></a>osEventSignal</em>&#160;</td><td class="fielddoc"> <p>function completed; signal event occurred. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342"></a>osEventMessage</em>&#160;</td><td class="fielddoc"> <p>function completed; message event occurred. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926"></a>osEventMail</em>&#160;</td><td class="fielddoc"> <p>function completed; mail event occurred. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea78f477732375c0e1fca814e369618177"></a>osEventTimeout</em>&#160;</td><td class="fielddoc"> <p>function completed; timeout occurred. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99eac24adca6a5d072c9f01c32178ba0d109"></a>osErrorParameter</em>&#160;</td><td class="fielddoc"> <p>parameter error: a mandatory parameter was missing or specified an incorrect object. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea8fc5801e8b0482bdf22ad63a77f0155d"></a>osErrorResource</em>&#160;</td><td class="fielddoc"> <p>resource not available: a specified resource was not available. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea314d24a49003f09459035db0dd7c9467"></a>osErrorTimeoutResource</em>&#160;</td><td class="fielddoc"> <p>resource not available within given time: a specified resource was not available within the timeout period. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea21635bdc492d3094fe83027fa4a30e2f"></a>osErrorISR</em>&#160;</td><td class="fielddoc"> <p>not allowed in ISR context: the function cannot be called from interrupt service routines. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99eaf6552310a817452aedfcd453f2805d65"></a>osErrorISRRecursive</em>&#160;</td><td class="fielddoc"> <p>function called multiple times from ISR with same object. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99eab7dda0ef504817659334cbfd650ae56f"></a>osErrorPriority</em>&#160;</td><td class="fielddoc"> <p>system cannot determine priority or thread has illegal priority. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99eaf1fac0240218e51eb30a13da2f8aae81"></a>osErrorNoMemory</em>&#160;</td><td class="fielddoc"> <p>system is out of memory: it was impossible to allocate or reserve memory for the operation. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea4672c8a0c0f6bb1d7981da4602e8e9ee"></a>osErrorValue</em>&#160;</td><td class="fielddoc"> <p>value of a parameter is out of range. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99ea5fde24ff588ec5ab9cb8314bade26fbc"></a>osErrorOS</em>&#160;</td><td class="fielddoc"> <p>unspecified RTOS error: run-time error but no other error message fits. </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gae2e091fefc4c767117727bd5aba4d99eac7a77f5fe18a15a357790c36a4aca1b1"></a>os_status_reserved</em>&#160;</td><td class="fielddoc"> <p>prevent from enum down-size compiler optimization. </p> </td></tr> </table> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Status.html
HTML
apache-2.0
14,439
var group__CMSIS__RTOS__Status = [ [ "osStatus", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e", [ [ "osOK", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f", null ], [ "osEventSignal", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518", null ], [ "osEventMessage", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342", null ], [ "osEventMail", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926", null ], [ "osEventTimeout", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea78f477732375c0e1fca814e369618177", null ], [ "osErrorParameter", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eac24adca6a5d072c9f01c32178ba0d109", null ], [ "osErrorResource", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea8fc5801e8b0482bdf22ad63a77f0155d", null ], [ "osErrorTimeoutResource", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea314d24a49003f09459035db0dd7c9467", null ], [ "osErrorISR", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea21635bdc492d3094fe83027fa4a30e2f", null ], [ "osErrorISRRecursive", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eaf6552310a817452aedfcd453f2805d65", null ], [ "osErrorPriority", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eab7dda0ef504817659334cbfd650ae56f", null ], [ "osErrorNoMemory", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eaf1fac0240218e51eb30a13da2f8aae81", null ], [ "osErrorValue", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea4672c8a0c0f6bb1d7981da4602e8e9ee", null ], [ "osErrorOS", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5fde24ff588ec5ab9cb8314bade26fbc", null ], [ "os_status_reserved", "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eac7a77f5fe18a15a357790c36a4aca1b1", null ] ] ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Status.js
JavaScript
apache-2.0
2,186
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Thread Management</title> <title>CMSIS-RTOS: Thread Management</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__ThreadMgmt.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#enum-members">Enumerations</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Thread Management<div class="ingroups"><a class="el" href="group__CMSIS__RTOS.html">CMSIS-RTOS API</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Define, create, and control thread functions. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:gaee93d929beb350f16e5cc7fa602e229f"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a>(name, priority, instances, stacksz)</td></tr> <tr class="memdesc:gaee93d929beb350f16e5cc7fa602e229f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a Thread Definition with function, priority, and stack requirements. <a href="#gaee93d929beb350f16e5cc7fa602e229f">More...</a><br/></td></tr> <tr class="separator:gaee93d929beb350f16e5cc7fa602e229f"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaf0c7c6b5e09f8be198312144b5c9e453"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>(name)&#160;&#160;&#160;&amp;os_thread_def_##name</td></tr> <tr class="memdesc:gaf0c7c6b5e09f8be198312144b5c9e453"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access a Thread definition. <a href="#gaf0c7c6b5e09f8be198312144b5c9e453">More...</a><br/></td></tr> <tr class="separator:gaf0c7c6b5e09f8be198312144b5c9e453"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a> Enumerations</h2></td></tr> <tr class="memitem:ga7f2b42f1983b9107775ec2a1c69a849a"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> { <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa549e79a43ff4f8b2b31afb613f5caa81">osPriorityIdle</a> = -3, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa61cb822239ac8f66dfbdc7291598a3d4">osPriorityLow</a> = -2, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6">osPriorityBelowNormal</a> = -1, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a> = 0, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa17b36cd9cd38652c2bc6d4803990674b">osPriorityAboveNormal</a> = +1, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2">osPriorityHigh</a> = +2, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aa1485dec3702434a1ec3cb74c7a17a4af">osPriorityRealtime</a> = +3, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849aae35f5e2f9c64ad346822521b643bdea4">osPriorityError</a> = 0x84 <br/> }</td></tr> <tr class="memdesc:ga7f2b42f1983b9107775ec2a1c69a849a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Priority used for thread control. <a href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">More...</a><br/></td></tr> <tr class="separator:ga7f2b42f1983b9107775ec2a1c69a849a"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gac59b5713cb083702dce759c73fd90dff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (const <a class="el" href="cmsis__os_8h.html#structosThreadDef__t">osThreadDef_t</a> *thread_def, void *argument)</td></tr> <tr class="memdesc:gac59b5713cb083702dce759c73fd90dff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a thread and add it to Active Threads and set it to state READY. <a href="#gac59b5713cb083702dce759c73fd90dff">More...</a><br/></td></tr> <tr class="separator:gac59b5713cb083702dce759c73fd90dff"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gab1df2a28925862ef8f9cf4e1c995c5a7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a> (void)</td></tr> <tr class="memdesc:gab1df2a28925862ef8f9cf4e1c995c5a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the thread ID of the current running thread. <a href="#gab1df2a28925862ef8f9cf4e1c995c5a7">More...</a><br/></td></tr> <tr class="separator:gab1df2a28925862ef8f9cf4e1c995c5a7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaea135bb90eb853eff39e0800b91bbeab"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> (<a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id)</td></tr> <tr class="memdesc:gaea135bb90eb853eff39e0800b91bbeab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Terminate execution of a thread and remove it from Active Threads. <a href="#gaea135bb90eb853eff39e0800b91bbeab">More...</a><br/></td></tr> <tr class="separator:gaea135bb90eb853eff39e0800b91bbeab"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga0dfb90ccf1f6e4b54b9251b12d1cbc8b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b">osThreadSetPriority</a> (<a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id, <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> priority)</td></tr> <tr class="memdesc:ga0dfb90ccf1f6e4b54b9251b12d1cbc8b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Change priority of an active thread. <a href="#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b">More...</a><br/></td></tr> <tr class="separator:ga0dfb90ccf1f6e4b54b9251b12d1cbc8b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga4299d838978bc2aae5e4350754e6a4e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga4299d838978bc2aae5e4350754e6a4e9">osThreadGetPriority</a> (<a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> thread_id)</td></tr> <tr class="memdesc:ga4299d838978bc2aae5e4350754e6a4e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get current priority of an active thread. <a href="#ga4299d838978bc2aae5e4350754e6a4e9">More...</a><br/></td></tr> <tr class="separator:ga4299d838978bc2aae5e4350754e6a4e9"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gaf13a667493c5d629a90c13e113b99233"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233">osThreadYield</a> (void)</td></tr> <tr class="memdesc:gaf13a667493c5d629a90c13e113b99233"><td class="mdescLeft">&#160;</td><td class="mdescRight">Pass control to next thread that is in state <b>READY</b>. <a href="#gaf13a667493c5d629a90c13e113b99233">More...</a><br/></td></tr> <tr class="separator:gaf13a667493c5d629a90c13e113b99233"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>The Thread Management function group allows defining, creating, and controlling thread functions in the system. The function <b>main</b> is a special thread function that is started at system initialization and has the initial priority <em>osPriorityNormal</em>.</p> <p><a class="anchor" id="ThreadStates"></a>Threads can be in the following states:</p> <ul> <li><b>RUNNING:</b> The thread that is currently running is in the <b>RUNNING</b> state. Only one thread at a time can be in this state.</li> <li><b>READY:</b> Threads which are ready to run are in the <b>READY</b> state. Once the <b>RUNNING</b> thread has terminated or is <b>WAITING</b>, the next <b>READY</b> thread with the highest priority becomes the <b>RUNNING</b> thread.</li> <li><b>WAITING:</b> Threads that are waiting for an event to occur are in the <b>WAITING</b> state.</li> <li><b>INACTIVE:</b> Threads that are not created or terminated are in the <b>INACTIVE</b> state. These threads typically consume no system resources.</li> </ul> <div class="image"> <img src="ThreadStatus.png" alt="ThreadStatus.png"/> <div class="caption"> Thread State and State Transitions</div></div> <p> A CMSIS-RTOS assumes that threads are scheduled as shown in the figure <b>Thread State and State Transitions</b>. The thread states change as follows:</p> <ul> <li>A thread is created using the function <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>. This puts the thread into the <b>READY</b> or <b>RUNNING</b> state (depending on the thread priority).</li> <li>CMSIS-RTOS is pre-emptive. The active thread with the highest priority becomes the <b>RUNNING</b> thread provided it does not wait for any event. The initial priority of a thread is defined with the <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a> but may be changed during execution using the function <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b">osThreadSetPriority</a>.</li> <li>The <b>RUNNING</b> thread transfers into the <b>WAITING</b> state when it is waiting for an event.</li> <li>Active threads can be terminated any time using the function <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a>. Threads can terminate also by just returning from the thread function. Threads that are terminated are in the <b>INACTIVE</b> state and typically do not consume any dynamic memory resources. </li> </ul> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="gaf0c7c6b5e09f8be198312144b5c9e453"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osThread</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;&amp;os_thread_def_##name</td> </tr> </table> </div><div class="memdoc"> <p>Access to the thread definition for the function <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the thread definition object. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osThread</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="gaee93d929beb350f16e5cc7fa602e229f"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osThreadDef</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">priority, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">instances, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">stacksz&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Define the attributes of a thread functions that can be created by the function <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> using <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>. The argument <em>instances</em> defines the number of times that <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> can be called for the same <b>osThreadDef</b>.</p> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg); <span class="comment">// function prototype for a Thread</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a> (Thread, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 3, 0); <span class="comment">// define Thread and specify to allow three instances</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> ThreadCreate_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> id1, id2, id3;</div> <div class="line"> </div> <div class="line"> id1 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a> (Thread), NULL); <span class="comment">// create the thread with id1</span></div> <div class="line"> id2 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a> (Thread), NULL); <span class="comment">// create the thread with id2</span></div> <div class="line"> id3 = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a> (Thread), NULL); <span class="comment">// create the thread with id3</span></div> <div class="line"> <span class="keywordflow">if</span> (id1 == NULL) { <span class="comment">// handle thread creation for id1</span></div> <div class="line"> <span class="comment">// Failed to create the thread with id1</span></div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">if</span> (id2 == NULL) { <span class="comment">// handle thread creation for id2</span></div> <div class="line"> <span class="comment">// Failed to create the thread with id2</span></div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">if</span> (id3 == NULL) { <span class="comment">// handle thread creation for id3</span></div> <div class="line"> <span class="comment">// Failed to create the thread with id3</span></div> <div class="line"> }</div> <div class="line"> :</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> (id1); <span class="comment">// stop the thread with id1</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> (id2); <span class="comment">// stop the thread with id2</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> (id3); <span class="comment">// stop the thread with id3</span></div> <div class="line">}</div> </div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the thread function. </td></tr> <tr><td class="paramname">priority</td><td>initial priority of the thread function. </td></tr> <tr><td class="paramname">instances</td><td>number of possible thread instances. </td></tr> <tr><td class="paramname">stacksz</td><td>stack size (in bytes) requirements for the thread function. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameters to <b>osThreadDef</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <h2 class="groupheader">Enumeration Type Documentation</h2> <a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849a"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a></td> </tr> </table> </div><div class="memdoc"> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osPriority</b> shall be consistent in every CMSIS-RTOS.</dd> <dd> Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p>The <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> value specifies the priority for a thread. The default thread priority should be <em>osPriorityNormal</em>. If a Thread is active that has a higher priority than the currently executing thread, then a thread switch occurs immediately to execute the new task.</p> <p>To prevent from a priority inversion, a CMSIS-RTOS compliant OS may optionally implement a <b>priority inheritance</b> method. A priority inversion occurs when a high priority thread is waiting for a resource or event that is controlled by a thread with a lower priority. </p> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aa549e79a43ff4f8b2b31afb613f5caa81"></a>osPriorityIdle</em>&#160;</td><td class="fielddoc"> <p>priority: idle (lowest) </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aa61cb822239ac8f66dfbdc7291598a3d4"></a>osPriorityLow</em>&#160;</td><td class="fielddoc"> <p>priority: low </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6"></a>osPriorityBelowNormal</em>&#160;</td><td class="fielddoc"> <p>priority: below normal </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1"></a>osPriorityNormal</em>&#160;</td><td class="fielddoc"> <p>priority: normal (default) </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aa17b36cd9cd38652c2bc6d4803990674b"></a>osPriorityAboveNormal</em>&#160;</td><td class="fielddoc"> <p>priority: above normal </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2"></a>osPriorityHigh</em>&#160;</td><td class="fielddoc"> <p>priority: high </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aa1485dec3702434a1ec3cb74c7a17a4af"></a>osPriorityRealtime</em>&#160;</td><td class="fielddoc"> <p>priority: realtime (highest) </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="ga7f2b42f1983b9107775ec2a1c69a849aae35f5e2f9c64ad346822521b643bdea4"></a>osPriorityError</em>&#160;</td><td class="fielddoc"> <p>system cannot determine priority or thread has illegal priority </p> </td></tr> </table> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="gac59b5713cb083702dce759c73fd90dff"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> osThreadCreate </td> <td>(</td> <td class="paramtype">const <a class="el" href="cmsis__os_8h.html#structosThreadDef__t">osThreadDef_t</a> *&#160;</td> <td class="paramname"><em>thread_def</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void *&#160;</td> <td class="paramname"><em>argument</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">thread_def</td><td>thread definition referenced with <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">argument</td><td>pointer that is passed to the thread function as start argument. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>thread ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osThreadCreate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Start a thread function by adding it to the Active Threads list and set it to state <b>READY</b>. The thread function receives the <em>argument</em> pointer as function argument when the function is started. When the priority of the created thread function is higher than the current <b>RUNNING</b> thread, the created thread function starts instantly and becomes the new <b>RUNNING</b> thread.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread_1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg); <span class="comment">// function prototype for Thread_1</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a> (Thread_1, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 1, 0); <span class="comment">// define Thread_1</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> ThreadCreate_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> id;</div> <div class="line"> </div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a> (Thread_1), NULL); <span class="comment">// create the thread</span></div> <div class="line"> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == NULL) { <span class="comment">// handle thread creation</span></div> <div class="line"> <span class="comment">// Failed to create a thread</span></div> <div class="line"> }</div> <div class="line"> :</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> (<span class="keywordtype">id</span>); <span class="comment">// stop the thread</span></div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gab1df2a28925862ef8f9cf4e1c995c5a7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> osThreadGetId </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>thread ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osThreadGetId</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Get the thread ID of the current running thread.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>. </dd> <dd> Must not be used inside the idle daemon. This would lead to undefined behavior.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> ThreadGetId_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> id; <span class="comment">// id for the currently running thread</span></div> <div class="line"> </div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a> ();</div> <div class="line"> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> == NULL) {</div> <div class="line"> <span class="comment">// Failed to get the id; not in a thread</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga4299d838978bc2aae5e4350754e6a4e9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> osThreadGetPriority </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td> <td class="paramname"><em>thread_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">thread_id</td><td>thread ID obtained by <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> or <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>current priority value of the thread function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osThreadGetPriority</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Get the priority of an active thread. In case of a failure the value <b>osPriorityError</b> is returned.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread_1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg) { <span class="comment">// Thread function</span></div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> id; <span class="comment">// id for the currently running thread</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> priority; <span class="comment">// thread priority</span></div> <div class="line"> </div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a> (); <span class="comment">// Obtain ID of current running thread</span></div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> != NULL) {</div> <div class="line"> priority = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga4299d838978bc2aae5e4350754e6a4e9">osThreadGetPriority</a> (<span class="keywordtype">id</span>);</div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">else</span> {</div> <div class="line"> <span class="comment">// Failed to get the id</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga0dfb90ccf1f6e4b54b9251b12d1cbc8b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osThreadSetPriority </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td> <td class="paramname"><em>thread_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a>&#160;</td> <td class="paramname"><em>priority</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">thread_id</td><td>thread ID obtained by <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> or <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">priority</td><td>new priority value for the thread function. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osThreadSetPriority</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Change the priority of an active thread.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the priority of the specified thread has been successfully changed.</li> <li><em>osErrorParameter:</em> thread_id is incorrect.</li> <li><em>osErrorValue:</em> incorrect priority value.</li> <li><em>osErrorResource:</em> thread_id refers to a thread that is not an active thread.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b">osThreadSetPriority</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread_1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg) { <span class="comment">// Thread function</span></div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> id; <span class="comment">// id for the currently running thread</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a">osPriority</a> pr; <span class="comment">// thread priority</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status; <span class="comment">// status of the executed function</span></div> <div class="line"> </div> <div class="line"> : </div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a> (); <span class="comment">// Obtain ID of current running thread</span></div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (<span class="keywordtype">id</span> != NULL) {</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b">osThreadSetPriority</a> (<span class="keywordtype">id</span>, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6">osPriorityBelowNormal</a>);</div> <div class="line"> <span class="keywordflow">if</span> (status == <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// Thread priority changed to BelowNormal</span></div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">else</span> {</div> <div class="line"> <span class="comment">// Failed to set the priority</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">else</span> {</div> <div class="line"> <span class="comment">// Failed to get the id</span></div> <div class="line"> }</div> <div class="line"> : </div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gaea135bb90eb853eff39e0800b91bbeab"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osThreadTerminate </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a>&#160;</td> <td class="paramname"><em>thread_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">thread_id</td><td>thread ID obtained by <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> or <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7">osThreadGetId</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osThreadTerminate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Remove the thread function from the active thread list. If the thread is currently RUNNING the execution will stop.</p> <dl class="section note"><dt>Note</dt><dd>In case that <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> terminates the currently running task, the function never returns and other threads that are in the READY state are started.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the specified thread has been successfully terminated.</li> <li><em>osErrorParameter:</em> thread_id is incorrect.</li> <li><em>osErrorResource:</em> thread_id refers to a thread that is not an active thread.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>. </dd> <dd> Avoid calling the function with a <em>thread_id</em> that does not exist or has been terminated already.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread_1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg); <span class="comment">// function prototype for Thread_1</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f">osThreadDef</a> (Thread_1, <a class="code" href="cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a>, 1, 0); <span class="comment">// define Thread_1</span></div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> ThreadTerminate_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status;</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#adfeb153a84a81309e2d958268197617f">osThreadId</a> id;</div> <div class="line"> </div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff">osThreadCreate</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453">osThread</a> (Thread_1), NULL); <span class="comment">// create the thread</span></div> <div class="line"> : </div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab">osThreadTerminate</a> (<span class="keywordtype">id</span>); <span class="comment">// stop the thread</span></div> <div class="line"> <span class="keywordflow">if</span> (status == <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// Thread was terminated successfully</span></div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">else</span> {</div> <div class="line"> <span class="comment">// Failed to terminate a thread</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gaf13a667493c5d629a90c13e113b99233"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osThreadYield </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osThreadYield</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Pass control to the next thread that is in state <b>READY</b>. If there is no other thread in the state <b>READY</b>, the current thread continues execution and no thread switching occurs.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the function has been correctly executed.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233">osThreadYield</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread_1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg) { <span class="comment">// Thread function</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status; <span class="comment">// status of the executed function</span></div> <div class="line"> :</div> <div class="line"> <span class="keywordflow">while</span> (1) {</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233">osThreadYield</a>(); <span class="comment">// </span></div> <div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// thread switch not occurred, not in a thread function</span></div> <div class="line"> }</div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__ThreadMgmt.html
HTML
apache-2.0
51,338
var group__CMSIS__RTOS__ThreadMgmt = [ [ "osThread", "group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453", null ], [ "osThreadDef", "group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f", null ], [ "osPriority", "group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a", [ [ "osPriorityIdle", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa549e79a43ff4f8b2b31afb613f5caa81", null ], [ "osPriorityLow", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa61cb822239ac8f66dfbdc7291598a3d4", null ], [ "osPriorityBelowNormal", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6", null ], [ "osPriorityNormal", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1", null ], [ "osPriorityAboveNormal", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa17b36cd9cd38652c2bc6d4803990674b", null ], [ "osPriorityHigh", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2", null ], [ "osPriorityRealtime", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa1485dec3702434a1ec3cb74c7a17a4af", null ], [ "osPriorityError", "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aae35f5e2f9c64ad346822521b643bdea4", null ] ] ], [ "osThreadCreate", "group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff", null ], [ "osThreadGetId", "group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7", null ], [ "osThreadGetPriority", "group__CMSIS__RTOS__ThreadMgmt.html#ga4299d838978bc2aae5e4350754e6a4e9", null ], [ "osThreadSetPriority", "group__CMSIS__RTOS__ThreadMgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b", null ], [ "osThreadTerminate", "group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab", null ], [ "osThreadYield", "group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__ThreadMgmt.js
JavaScript
apache-2.0
1,998
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Timer Management</title> <title>CMSIS-RTOS: Timer Management</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__TimerMgmt.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#enum-members">Enumerations</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Timer Management<div class="ingroups"><a class="el" href="group__CMSIS__RTOS.html">CMSIS-RTOS API</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Create and control timer and timer callback functions. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga1c720627e08d1cc1afcad44e799ed492"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a>(name, function)</td></tr> <tr class="memdesc:ga1c720627e08d1cc1afcad44e799ed492"><td class="mdescLeft">&#160;</td><td class="mdescRight">Define a Timer object. <a href="#ga1c720627e08d1cc1afcad44e799ed492">More...</a><br/></td></tr> <tr class="separator:ga1c720627e08d1cc1afcad44e799ed492"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1b8d670eaf964b2910fa06885e650678"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(name)&#160;&#160;&#160;&amp;os_timer_def_##name</td></tr> <tr class="memdesc:ga1b8d670eaf964b2910fa06885e650678"><td class="mdescLeft">&#160;</td><td class="mdescRight">Access a Timer definition. <a href="#ga1b8d670eaf964b2910fa06885e650678">More...</a><br/></td></tr> <tr class="separator:ga1b8d670eaf964b2910fa06885e650678"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="enum-members"></a> Enumerations</h2></td></tr> <tr class="memitem:gadac860eb9e1b4b0619271e6595ed83d9"><td class="memItemLeft" align="right" valign="top">enum &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9">os_timer_type</a> { <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951">osTimerOnce</a> = 0, <br/> &#160;&#160;<a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788">osTimerPeriodic</a> = 1 <br/> }</td></tr> <tr class="separator:gadac860eb9e1b4b0619271e6595ed83d9"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gaedd312bfdca04e0b8162b666e09a1ae6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> (const <a class="el" href="cmsis__os_8h.html#structosTimerDef__t">osTimerDef_t</a> *timer_def, <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9">os_timer_type</a> type, void *argument)</td></tr> <tr class="memdesc:gaedd312bfdca04e0b8162b666e09a1ae6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a timer. <a href="#gaedd312bfdca04e0b8162b666e09a1ae6">More...</a><br/></td></tr> <tr class="separator:gaedd312bfdca04e0b8162b666e09a1ae6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga27a797a401b068e2644d1125f22a07ca"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a> (<a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> timer_id, uint32_t millisec)</td></tr> <tr class="memdesc:ga27a797a401b068e2644d1125f22a07ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Start or restart a timer. <a href="#ga27a797a401b068e2644d1125f22a07ca">More...</a><br/></td></tr> <tr class="separator:ga27a797a401b068e2644d1125f22a07ca"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga58f36b121a812936435cacc6e1e0e091"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga58f36b121a812936435cacc6e1e0e091">osTimerStop</a> (<a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> timer_id)</td></tr> <tr class="memdesc:ga58f36b121a812936435cacc6e1e0e091"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stop the timer. <a href="#ga58f36b121a812936435cacc6e1e0e091">More...</a><br/></td></tr> <tr class="separator:ga58f36b121a812936435cacc6e1e0e091"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga746b8043d906849bd65e3900fcb483cf"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf">osTimerDelete</a> (<a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> timer_id)</td></tr> <tr class="memdesc:ga746b8043d906849bd65e3900fcb483cf"><td class="mdescLeft">&#160;</td><td class="mdescRight">Delete a timer that was created by <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>. <a href="#ga746b8043d906849bd65e3900fcb483cf">More...</a><br/></td></tr> <tr class="separator:ga746b8043d906849bd65e3900fcb483cf"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>In addition to the <a class="el" href="group__CMSIS__RTOS__Wait.html">Generic Wait Functions</a> CMSIS-RTOS also supports virtual timer objects. These timer objects can trigger the execution of a function (not threads). When a timer expires, a callback function is executed to run associated code with the timer. The timer number is passed as a parameter to the callback function. Each timer can be configured as a one-shot or a periodic timer. A periodic timer repeats its operation until it is <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf">deleted</a> or <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga58f36b121a812936435cacc6e1e0e091">stopped</a>. All timers can be <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">started, restarted</a>, or <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga58f36b121a812936435cacc6e1e0e091">stopped</a>.</p> <p>Timers are handled in the thread <b>osTimerThread</b>. Callback functions run under control of this thread and may use other CMSIS-RTOS API calls.</p> <p>The figure below shows the behavior of a periodic timer. For one-shot timers, the timer stops after execution of the callback function.</p> <div class="image"> <img src="Timer.png" alt="Timer.png"/> <div class="caption"> Behavior of a Periodic Timer</div></div> <h2>Working with Timers </h2> <p>The following steps are required to use a timer:</p> <ol type="1"> <li>Define the timers: <div class="fragment"><div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a>(one_shot, start_machine); <span class="comment">// when the timer expires, the function start_machine is called</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a>(periodic, toggle_power); <span class="comment">// when the timer expires, the function toggle_power is called</span></div> <div class="line"><a class="code" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> one_shot_id, periodic_id;</div> </div><!-- fragment --></li> <li>Instantiate and start the timers in an RTOS thread: <div class="fragment"><div class="line">one_shot_id = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>(<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(one_shot), <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951">osTimerOnce</a>, (<span class="keywordtype">void</span> *)0); <span class="comment">// creates a one-shot timer;</span></div> <div class="line"> <span class="comment">// (void*)0 is passed as an argument to the callback function</span></div> <div class="line">periodic_id = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>(<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(periodic), <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788">osTimerPeriodic</a>, (<span class="keywordtype">void</span> *)5); <span class="comment">// creates a periodic timer;</span></div> <div class="line"> <span class="comment">// (void*)5 is passed as an argument to the callback function</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a>(one_shot_id, 500);</div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a>(periodic, 1500);</div> </div><!-- fragment --> </li> </ol> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga1b8d670eaf964b2910fa06885e650678"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osTimer</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name</td><td>)</td> <td>&#160;&#160;&#160;&amp;os_timer_def_##name</td> </tr> </table> </div><div class="memdoc"> <p>Access to the timer definition for the function <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the timer object. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osTimer</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <a class="anchor" id="ga1c720627e08d1cc1afcad44e799ed492"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osTimerDef</td> <td>(</td> <td class="paramtype">&#160;</td> <td class="paramname">name, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">&#160;</td> <td class="paramname">function&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <p>Define the attributes of a timer.</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramname">name</td><td>name of the timer object. </td></tr> <tr><td class="paramname">function</td><td>name of the timer call back function. </td></tr> </table> </dd> </dl> <dl class="section note"><dt>Note</dt><dd>CAN BE CHANGED: The parameter to <b>osTimerDef</b> shall be consistent but the macro body is implementation specific in every CMSIS-RTOS. </dd></dl> </div> </div> <h2 class="groupheader">Enumeration Type Documentation</h2> <a class="anchor" id="gadac860eb9e1b4b0619271e6595ed83d9"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">enum <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9">os_timer_type</a></td> </tr> </table> </div><div class="memdoc"> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>os_timer_type</b> shall be consistent in every CMSIS-RTOS. The <a class="el" href="cmsis__os_8h.html#adac860eb9e1b4b0619271e6595ed83d9">os_timer_type</a> specifies the a repeating (periodic) or one-shot timer for the function <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>. </dd></dl> <table class="fieldtable"> <tr><th colspan="2">Enumerator</th></tr><tr><td class="fieldname"><em><a class="anchor" id="gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951"></a>osTimerOnce</em>&#160;</td><td class="fielddoc"> <p>one-shot timer </p> </td></tr> <tr><td class="fieldname"><em><a class="anchor" id="gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788"></a>osTimerPeriodic</em>&#160;</td><td class="fielddoc"> <p>repeating timer </p> </td></tr> </table> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="gaedd312bfdca04e0b8162b666e09a1ae6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> osTimerCreate </td> <td>(</td> <td class="paramtype">const <a class="el" href="cmsis__os_8h.html#structosTimerDef__t">osTimerDef_t</a> *&#160;</td> <td class="paramname"><em>timer_def</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9">os_timer_type</a>&#160;</td> <td class="paramname"><em>type</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void *&#160;</td> <td class="paramname"><em>argument</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">timer_def</td><td>timer object referenced with <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">type</td><td>osTimerOnce for one-shot or osTimerPeriodic for periodic behavior. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">argument</td><td>argument to the timer call back function. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>timer ID for reference by other functions or NULL in case of error. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osTimerCreate</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Create a one-shot or periodic timer and associate it with a callback function argument. The timer is in stopped until it is started with <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a>.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Timer1_Callback (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg); <span class="comment">// prototypes for timer callback function</span></div> <div class="line"><span class="keywordtype">void</span> Timer2_Callback (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg); </div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a> (Timer1, Timer1_Callback); <span class="comment">// define timers</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a> (Timer2, Timer2_Callback);</div> <div class="line"> </div> <div class="line">uint32_t exec1; <span class="comment">// argument for the timer call back function</span></div> <div class="line">uint32_t exec2; <span class="comment">// argument for the timer call back function</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> TimerCreate_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> id1; <span class="comment">// timer id</span></div> <div class="line"> <a class="code" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> id2; <span class="comment">// timer id</span></div> <div class="line"> </div> <div class="line"> <span class="comment">// Create one-shoot timer</span></div> <div class="line"> exec1 = 1;</div> <div class="line"> id1 = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> (<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(Timer1), <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951">osTimerOnce</a>, &amp;exec1);</div> <div class="line"> <span class="keywordflow">if</span> (id1 != NULL) {</div> <div class="line"> <span class="comment">// One-shoot timer created</span></div> <div class="line"> }</div> <div class="line"> </div> <div class="line"> <span class="comment">// Create periodic timer</span></div> <div class="line"> exec2 = 2;</div> <div class="line"> id2 = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> (<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(Timer2), <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788">osTimerPeriodic</a>, &amp;exec2);</div> <div class="line"> <span class="keywordflow">if</span> (id2 != NULL) {</div> <div class="line"> <span class="comment">// Periodic timer created</span></div> <div class="line"> }</div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga746b8043d906849bd65e3900fcb483cf"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osTimerDelete </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a>&#160;</td> <td class="paramname"><em>timer_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">timer_id</td><td>timer ID obtained by <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osTimerDelete</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Delete the timer object.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the specified timer has been deleted.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf">osTimerDelete</a> cannot be called from interrupt service routines.</li> <li><em>osErrorParameter:</em> <em>timer_id</em> is incorrect.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"></div> <div class="line"><span class="keywordtype">void</span> Timer_Callback (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg); <span class="comment">// prototype for timer callback function</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a> (Timer, Timer_Callback); <span class="comment">// define timer</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> TimerDelete_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> id; <span class="comment">// timer id</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status; <span class="comment">// function return status </span></div> <div class="line"> </div> <div class="line"> <span class="comment">// Create periodic timer</span></div> <div class="line"> exec = 1;</div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> (<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(Timer2), <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788">osTimerPeriodic</a>, NULL);</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a> (<span class="keywordtype">id</span>, 1000UL); <span class="comment">// start timer</span></div> <div class="line"> :</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf">osTimerDelete</a> (<span class="keywordtype">id</span>); <span class="comment">// stop and delete timer</span></div> <div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// Timer could not be deleted</span></div> <div class="line"> } </div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga27a797a401b068e2644d1125f22a07ca"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osTimerStart </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a>&#160;</td> <td class="paramname"><em>timer_id</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em>&#160;</td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">timer_id</td><td>timer ID obtained by <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>. </td></tr> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">time delay</a> value of the timer. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osTimerStart</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Start or restart the timer.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the specified timer has been started or restarted.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a> cannot be called from interrupt service routines.</li> <li><em>osErrorParameter:</em> <em>timer_id</em> is incorrect.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Time_Callback (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg) { <span class="comment">// timer callback function</span></div> <div class="line"> <span class="comment">// arg contains &amp;exec</span></div> <div class="line"> <span class="comment">// called every second after osTimerStart</span></div> <div class="line">} </div> <div class="line"> </div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a> (Timer, Time_Callback); <span class="comment">// define timer</span></div> <div class="line">uint32_t exec; <span class="comment">// argument for the timer call back function</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> TimerStart_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> id; <span class="comment">// timer id</span></div> <div class="line"> uint32_t timerDelay; <span class="comment">// timer value</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status; <span class="comment">// function return status</span></div> <div class="line"> </div> <div class="line"> <span class="comment">// Create periodic timer</span></div> <div class="line"> exec = 1;</div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> (<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(Timer), <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788">osTimerPeriodic</a>, &amp;exec);</div> <div class="line"> <span class="keywordflow">if</span> (<span class="keywordtype">id</span>) {</div> <div class="line"> timerDelay = 1000;</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a> (<span class="keywordtype">id</span>, timerDelay); <span class="comment">// start timer</span></div> <div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// Timer could not be started</span></div> <div class="line"> } </div> <div class="line"> }</div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga58f36b121a812936435cacc6e1e0e091"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osTimerStop </td> <td>(</td> <td class="paramtype"><a class="el" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a>&#160;</td> <td class="paramname"><em>timer_id</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">timer_id</td><td>timer ID obtained by <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a>. </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osTimerStop</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Stop the timer.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osOK:</em> the specified timer has been stopped.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga58f36b121a812936435cacc6e1e0e091">osTimerStop</a> cannot be called from interrupt service routines.</li> <li><em>osErrorParameter:</em> <em>timer_id</em> is incorrect.</li> <li><em>osErrorResource:</em> the timer is not started.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Timer_Callback (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg); <span class="comment">// prototype for timer callback function</span></div> <div class="line"><a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492">osTimerDef</a> (Timer, Timer_Callback); <span class="comment">// define timer</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> TimerStop_example (<span class="keywordtype">void</span>) {</div> <div class="line"> <a class="code" href="cmsis__os_8h.html#ab8530dd4273f1f5382187732e14fcaa7">osTimerId</a> id; <span class="comment">// timer id</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status; <span class="comment">// function return status</span></div> <div class="line"> </div> <div class="line"> <span class="comment">// Create periodic timer</span></div> <div class="line"> exec = 1;</div> <div class="line"> <span class="keywordtype">id</span> = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> (<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678">osTimer</a>(Timer2), <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788">osTimerPeriodic</a>, NULL);</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a> (<span class="keywordtype">id</span>, 1000); <span class="comment">// start timer</span></div> <div class="line"> :</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga58f36b121a812936435cacc6e1e0e091">osTimerStop</a> (<span class="keywordtype">id</span>); <span class="comment">// stop timer</span></div> <div class="line"> <span class="keywordflow">if</span> (status != <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f">osOK</a>) {</div> <div class="line"> <span class="comment">// Timer could not be stopped</span></div> <div class="line"> } </div> <div class="line"> :</div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a> (<span class="keywordtype">id</span>, 1000); <span class="comment">// start timer again</span></div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__TimerMgmt.html
HTML
apache-2.0
41,248
var group__CMSIS__RTOS__TimerMgmt = [ [ "osTimer", "group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678", null ], [ "osTimerDef", "group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492", null ], [ "os_timer_type", "group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9", [ [ "osTimerOnce", "group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951", null ], [ "osTimerPeriodic", "group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788", null ] ] ], [ "osTimerCreate", "group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6", null ], [ "osTimerDelete", "group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf", null ], [ "osTimerStart", "group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca", null ], [ "osTimerStop", "group__CMSIS__RTOS__TimerMgmt.html#ga58f36b121a812936435cacc6e1e0e091", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__TimerMgmt.js
JavaScript
apache-2.0
1,035
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Generic Wait Functions</title> <title>CMSIS-RTOS: Generic Wait Functions</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__CMSIS__RTOS__Wait.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#define-members">Macros</a> &#124; <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">Generic Wait Functions<div class="ingroups"><a class="el" href="group__CMSIS__RTOS.html">CMSIS-RTOS API</a></div></div> </div> </div><!--header--> <div class="contents"> <p>Wait for a time period or unspecified events. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> Macros</h2></td></tr> <tr class="memitem:ga6c97d38879ae86491628f6e647639bad"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Wait.html#ga6c97d38879ae86491628f6e647639bad">osFeature_Wait</a>&#160;&#160;&#160;1</td></tr> <tr class="memdesc:ga6c97d38879ae86491628f6e647639bad"><td class="mdescLeft">&#160;</td><td class="mdescRight">osWait function: 1=available, 0=not available <a href="#ga6c97d38879ae86491628f6e647639bad">More...</a><br/></td></tr> <tr class="separator:ga6c97d38879ae86491628f6e647639bad"><td class="memSeparator" colspan="2">&#160;</td></tr> </table><table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:ga02e19d5e723bfb06ba9324d625162255"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a> (uint32_t millisec)</td></tr> <tr class="memdesc:ga02e19d5e723bfb06ba9324d625162255"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for Timeout (Time Delay). <a href="#ga02e19d5e723bfb06ba9324d625162255">More...</a><br/></td></tr> <tr class="separator:ga02e19d5e723bfb06ba9324d625162255"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga8470c8aaedfde524a44e22e5b2328285"><td class="memItemLeft" align="right" valign="top"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__CMSIS__RTOS__Wait.html#ga8470c8aaedfde524a44e22e5b2328285">osWait</a> (uint32_t millisec)</td></tr> <tr class="memdesc:ga8470c8aaedfde524a44e22e5b2328285"><td class="mdescLeft">&#160;</td><td class="mdescRight">Wait for Signal, Message, Mail, or Timeout. <a href="#ga8470c8aaedfde524a44e22e5b2328285">More...</a><br/></td></tr> <tr class="separator:ga8470c8aaedfde524a44e22e5b2328285"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>The Generic Wait function group provides means for a time delay and allow to wait for unspecified events. </p> <h2 class="groupheader">Macro Definition Documentation</h2> <a class="anchor" id="ga6c97d38879ae86491628f6e647639bad"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">#define osFeature_Wait&#160;&#160;&#160;1</td> </tr> </table> </div><div class="memdoc"> <p>A CMSIS-RTOS implementation may support the generic wait function <a class="el" href="technicalData.html#osWait">osWait</a>.</p> <ul> <li>When <a class="el" href="group__CMSIS__RTOS__Wait.html#ga6c97d38879ae86491628f6e647639bad">osFeature_Wait</a> is 1 a generic wait function <a class="el" href="technicalData.html#osWait">osWait</a> is available.</li> <li>When <a class="el" href="group__CMSIS__RTOS__Wait.html#ga6c97d38879ae86491628f6e647639bad">osFeature_Wait</a> is 0 no generic wait function <a class="el" href="technicalData.html#osWait">osWait</a> is available.</li> </ul> <p><a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> Setting: <b>osFeature_Wait</b> is 0 </p> </div> </div> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga02e19d5e723bfb06ba9324d625162255"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> osDelay </td> <td>(</td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">time delay</a> value </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>status code that indicates the execution status of the function.</dd></dl> <p>Wait for a specified time period in <em>millisec</em>.</p> <p>The <a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">millisec</a> value specifies the number of timer ticks and is therefore an upper bound. The exact time delay depends on the actual time elapsed since the last timer tick.</p> <p>For a value of <b>1</b>, the system waits until the next timer tick occurs. That means that the actual time delay may be up to one timer tick less.</p> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osEventTimeout:</em> the time delay is executed.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread_1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg) { <span class="comment">// Thread function</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e">osStatus</a> status; <span class="comment">// capture the return status</span></div> <div class="line"> uint32_t delayTime; <span class="comment">// delay time in milliseconds</span></div> <div class="line"> </div> <div class="line"> delayTime = 1000; <span class="comment">// delay 1 second</span></div> <div class="line"> :</div> <div class="line"> status = <a class="code" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a> (delayTime); <span class="comment">// suspend thread execution</span></div> <div class="line"> <span class="comment">// handle error code</span></div> <div class="line"> : </div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga8470c8aaedfde524a44e22e5b2328285"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname"><a class="el" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> osWait </td> <td>(</td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>millisec</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">millisec</td><td><a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a> or 0 in case of no time-out </td></tr> </table> </dd> </dl> <dl class="section return"><dt>Returns</dt><dd>event that contains signal, message, or mail information or error code. </dd></dl> <dl class="section note"><dt>Note</dt><dd>MUST REMAIN UNCHANGED: <b>osWait</b> shall be consistent in every CMSIS-RTOS.</dd></dl> <p>Wait for any event of the type Signal, Message, Mail for a specified time period in <em>millisec</em>. While the system waits, the thread that is calling this function is put into the state <b>WAITING</b>. When <em>millisec</em> is set to <b>osWaitForever</b>, the function will wait for an infinite time until an event occurs.</p> <p>The osWait function puts a thread into the state <b>WAITING</b> and waits for any of the following events:</p> <ul> <li>A <b>signal</b> sent to that thread explicitly</li> <li>A <b>message</b> from a message object that is registered to that thread</li> <li>A <b>mail</b> from a mail object that is registered to that thread</li> </ul> <dl class="section note"><dt>Note</dt><dd>This function is optional and may not be provided by all CMSIS-RTOS implementations.</dd></dl> <p><b><a class="el" href="group__CMSIS__RTOS__Status.html">Status and Error Codes</a></b><br/> </p> <ul> <li><em>osEventSignal:</em> a signal event occurred and is returned.</li> <li><em>osEventMessage:</em> a message event occurred and is returned.</li> <li><em>osEventMail:</em> a mail event occurred and is returned.</li> <li><em>osEventTimeout:</em> the time delay is executed.</li> <li><em>osErrorISR:</em> <a class="el" href="group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255">osDelay</a> cannot be called from interrupt service routines.</li> </ul> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os_8h.html">cmsis_os.h</a>&quot;</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> Thread_1 (<span class="keywordtype">void</span> <span class="keyword">const</span> *arg) { <span class="comment">// Thread function</span></div> <div class="line"> <a class="code" href="group__CMSIS__RTOS__Definitions.html#structosEvent">osEvent</a> Event; <span class="comment">// capture the event</span></div> <div class="line"> uint32_t waitTime; <span class="comment">// wait time in milliseconds</span></div> <div class="line"> </div> <div class="line"> :</div> <div class="line"> waitTime = <a class="code" href="cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb">osWaitForever</a>; <span class="comment">// special &quot;wait&quot; value</span></div> <div class="line"> Event = <a class="code" href="group__CMSIS__RTOS__Wait.html#ga8470c8aaedfde524a44e22e5b2328285">osWait</a> (waitTime); <span class="comment">// wait forever and until an event occurred</span></div> <div class="line"> <span class="keywordflow">switch</span> (Event.<a class="code" href="group__CMSIS__RTOS__Definitions.html#ad477a289f1f03ac45407b64268d707d3">status</a>) {</div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518">osEventSignal</a>: <span class="comment">// Signal arrived</span></div> <div class="line"> : <span class="comment">// Event.value.signals contains the signal flags</span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342">osEventMessage</a>: <span class="comment">// Message arrived</span></div> <div class="line"> : <span class="comment">// Event.value.p contains the message pointer</span></div> <div class="line"> : <span class="comment">// Event.def.message_id contains the message Id</span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926">osEventMail</a>: <span class="comment">// Mail arrived</span></div> <div class="line"> : <span class="comment">// Event.value.p contains the mail pointer</span></div> <div class="line"> : <span class="comment">// Event.def.mail_id contains the mail Id</span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea78f477732375c0e1fca814e369618177">osEventTimeout</a>: <span class="comment">// Timeout occurred</span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">default</span>: <span class="comment">// Error occurred</span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> }</div> <div class="line"> :</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Wait.html
HTML
apache-2.0
20,043
var group__CMSIS__RTOS__Wait = [ [ "osFeature_Wait", "group__CMSIS__RTOS__Wait.html#ga6c97d38879ae86491628f6e647639bad", null ], [ "osDelay", "group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255", null ], [ "osWait", "group__CMSIS__RTOS__Wait.html#ga8470c8aaedfde524a44e22e5b2328285", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__CMSIS__RTOS__Wait.js
JavaScript
apache-2.0
319
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>RTX Specific Functions</title> <title>CMSIS-RTOS: RTX Specific Functions</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('group__RTX__Global__Functions.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="summary"> <a href="#func-members">Functions</a> </div> <div class="headertitle"> <div class="title">RTX Specific Functions</div> </div> </div><!--header--> <div class="contents"> <p>This section describes the functions that are specific to CMSIS-RTOS RTX. <a href="#details">More...</a></p> <table class="memberdecls"> <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> Functions</h2></td></tr> <tr class="memitem:gafb4dc4d3dff8343a393726d2860282e4"><td class="memItemLeft" align="right" valign="top">__NO_RETURN void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a> (void)</td></tr> <tr class="memdesc:gafb4dc4d3dff8343a393726d2860282e4"><td class="mdescLeft">&#160;</td><td class="mdescRight">OS idle demon (running when no other thread is ready to run). <a href="#gafb4dc4d3dff8343a393726d2860282e4">More...</a><br/></td></tr> <tr class="separator:gafb4dc4d3dff8343a393726d2860282e4"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga145e7eafdd042bb522020cbb3b469d9c"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#ga145e7eafdd042bb522020cbb3b469d9c">os_tick_init</a> (void)</td></tr> <tr class="memdesc:ga145e7eafdd042bb522020cbb3b469d9c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initializes an alternative hardware timer as RTX kernel timer. <a href="#ga145e7eafdd042bb522020cbb3b469d9c">More...</a><br/></td></tr> <tr class="separator:ga145e7eafdd042bb522020cbb3b469d9c"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga567543bf38239a91f09751686c23017b"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#ga567543bf38239a91f09751686c23017b">os_tick_val</a> (void)</td></tr> <tr class="memdesc:ga567543bf38239a91f09751686c23017b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get alternative hardware timer's current value (0 .. OS_TRV) <a href="#ga567543bf38239a91f09751686c23017b">More...</a><br/></td></tr> <tr class="separator:ga567543bf38239a91f09751686c23017b"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:gad5deddec3fea0fb31798f571afc3c692"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#gad5deddec3fea0fb31798f571afc3c692">os_tick_ovf</a> (void)</td></tr> <tr class="memdesc:gad5deddec3fea0fb31798f571afc3c692"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get alternative hardware timer's overflow flag. <a href="#gad5deddec3fea0fb31798f571afc3c692">More...</a><br/></td></tr> <tr class="separator:gad5deddec3fea0fb31798f571afc3c692"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga85dab8408f27236c7341a69feb6258c7"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#ga85dab8408f27236c7341a69feb6258c7">os_tick_irqack</a> (void)</td></tr> <tr class="memdesc:ga85dab8408f27236c7341a69feb6258c7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acknowledge alternative hardware timer interrupt. <a href="#ga85dab8408f27236c7341a69feb6258c7">More...</a><br/></td></tr> <tr class="separator:ga85dab8408f27236c7341a69feb6258c7"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga651ae76b3acf45f80bf0e0487b51d6e6"><td class="memItemLeft" align="right" valign="top">__NO_RETURN void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#ga651ae76b3acf45f80bf0e0487b51d6e6">os_error</a> (uint32_t error_code)</td></tr> <tr class="memdesc:ga651ae76b3acf45f80bf0e0487b51d6e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">OS error callback (called when a runtime error is detected). <a href="#ga651ae76b3acf45f80bf0e0487b51d6e6">More...</a><br/></td></tr> <tr class="separator:ga651ae76b3acf45f80bf0e0487b51d6e6"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga3e9c57746ccbdfe90464ad50513c569e"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a> (void)</td></tr> <tr class="memdesc:ga3e9c57746ccbdfe90464ad50513c569e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Suspend the RTX task scheduler. <a href="#ga3e9c57746ccbdfe90464ad50513c569e">More...</a><br/></td></tr> <tr class="separator:ga3e9c57746ccbdfe90464ad50513c569e"><td class="memSeparator" colspan="2">&#160;</td></tr> <tr class="memitem:ga1b85a217d43e6b971ffcf24f8aae1c33"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a> (uint32_t sleep_time)</td></tr> <tr class="memdesc:ga1b85a217d43e6b971ffcf24f8aae1c33"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resume the RTX task scheduler. <a href="#ga1b85a217d43e6b971ffcf24f8aae1c33">More...</a><br/></td></tr> <tr class="separator:ga1b85a217d43e6b971ffcf24f8aae1c33"><td class="memSeparator" colspan="2">&#160;</td></tr> </table> <a name="details" id="details"></a><h2 class="groupheader">Description</h2> <p>The RTX kernel can be customized for different application requirements:</p> <ul> <li>If you are depending on the <a class="el" href="lowPower.html">lowest power consumption</a> possible, you need to adapt the function <a class="el" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a> to send the system to sleep mode as often as possible. In addition, use the <a class="el" href="lowPower.html#TickLess">low power RTX extensions</a> <a class="el" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a> and <a class="el" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a> to suspend the RTX scheduler and to stop the SysTick timer.</li> <li>If you need to specify an <a class="el" href="timerTick.html#AltTimer">alternate hardware timer</a> as the system tick timer, you need to<ol type="1"> <li>implement the functions <a class="el" href="group__RTX__Global__Functions.html#ga145e7eafdd042bb522020cbb3b469d9c">os_tick_init</a>, <a class="el" href="group__RTX__Global__Functions.html#gad5deddec3fea0fb31798f571afc3c692">os_tick_ovf</a>, <a class="el" href="group__RTX__Global__Functions.html#ga567543bf38239a91f09751686c23017b">os_tick_val</a>, and optionally the function <a class="el" href="group__RTX__Global__Functions.html#ga85dab8408f27236c7341a69feb6258c7">os_tick_irqack</a>.</li> <li>replace the alternate timer interrupt vector with the <a class="el" href="timerTick.html#OS_Tick_Handler">OS_Tick_Handler</a> in the Interrupt Vector Table in startup file.</li> </ol> </li> <li>If you try to find a <b>runtime</b> <b>error</b>, use the function <a class="el" href="group__RTX__Global__Functions.html#ga651ae76b3acf45f80bf0e0487b51d6e6">os_error</a> to debug the error. </li> </ul> <h2 class="groupheader">Function Documentation</h2> <a class="anchor" id="ga651ae76b3acf45f80bf0e0487b51d6e6"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void os_error </td> <td>(</td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>error_code</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">error_code</td><td>actual error code that has been detected.</td></tr> </table> </dd> </dl> <p>Some system error conditions can be detected during runtime. If the RTX kernel detects a runtime error, it calls the runtime error function <b>os_error</b>.</p> <p>The argument <em>error_code</em> passes the actual error code to this function:</p> <table class="doxtable"> <tr> <th>Error Code </th><th>Description </th></tr> <tr> <td>OS_ERROR_STACK_OVF</td><td>The stack checking has detected a stack overflow for the currently running thread. </td></tr> <tr> <td>OS_ERROR_FIFO_OVF </td><td>The ISR FIFO Queue buffer overflow is detected. </td></tr> <tr> <td>OS_ERROR_MBX_OVF </td><td>A mailbox overflow is detected for the function <a class="el" href="group__CMSIS__RTOS__Message.html#gac0dcf462fc92de8ffaba6cc004514a6d">osMessagePut</a> or <a class="el" href="group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02">osMailPut</a>. </td></tr> <tr> <td>OS_ERROR_TIMER_OVF</td><td>The User Timer Callback Queue overflow is detected. </td></tr> </table> <p>The function <b>os_error</b> must contain an infinite loop to prevent further program execution. You can use an emulator to step over infinite loop and trace into the code introducing a runtime error. For the overflow errors this means you need to increase the size of the object causing an overflow.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#ga651ae76b3acf45f80bf0e0487b51d6e6">os_error</a> (uint32_t error_code) {</div> <div class="line"> </div> <div class="line"> <span class="comment">// HERE: include optional code to be executed on runtime error. </span></div> <div class="line"> <span class="keywordflow">switch</span> (error_code) {</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#abf8311a7a239ec56c6d725f926ba766d">OS_ERROR_STACK_OVF</a>:</div> <div class="line"> <span class="comment">// Stack overflow detected for the currently running task. </span></div> <div class="line"> <span class="comment">// Thread can be identified by calling svcThreadGetId(). </span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#a075d54df14c85a6afe32b7f5c99c9c29">OS_ERROR_FIFO_OVF</a>:</div> <div class="line"> <span class="comment">// ISR FIFO Queue buffer overflow detected. </span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#ab715d7d66c341c067ef0a97b55db8a10">OS_ERROR_MBX_OVF</a>:</div> <div class="line"> <span class="comment">// Mailbox overflow detected. </span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">case</span> <a class="code" href="RTX__Conf__CM_8c.html#a79d7e388d951f11bd0dabd13f722cea8">OS_ERROR_TIMER_OVF</a>:</div> <div class="line"> <span class="comment">// User Timer Callback Queue overflow detected. </span></div> <div class="line"> <span class="keywordflow">break</span>;</div> <div class="line"> }</div> <div class="line"> <span class="keywordflow">for</span> (;;);</div> <div class="line">}</div> </div><!-- fragment --><p>OS error callback (called when a runtime error is detected).</p> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">error_code</td><td>actual error code that has been detected </td></tr> </table> </dd> </dl> </div> </div> <a class="anchor" id="gafb4dc4d3dff8343a393726d2860282e4"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void os_idle_demon </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>The function <b>os_idle_demon</b> is executed by the RTX kernel, when no other threads are ready to run. By default, this task is an empty end-less loop that does nothing. It only waits until another task becomes ready to run. You may change the code of the <b>os_idle_demon</b> function to put the CPU into a power-saving or idle mode.</p> <p>The default stack size for this task is defined in the file <b>#<a class="el" href="RTX__Conf__CM_8c.html">RTX_Conf_CM.c</a></b>. Refer to <a class="el" href="threadConfig.html">Thread Configuration</a> entry <b>Default Thread stack size [bytes]</b>.</p> <dl class="section note"><dt>Note</dt><dd>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a> (<span class="keywordtype">void</span>) {</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">for</span> (;;) {</div> <div class="line"> __WFI(); <span class="comment">// wait for interrupt</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --><p>OS idle demon (running when no other thread is ready to run). </p> </div> </div> <a class="anchor" id="ga1b85a217d43e6b971ffcf24f8aae1c33"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void os_resume </td> <td>(</td> <td class="paramtype">uint32_t&#160;</td> <td class="paramname"><em>sleep_time</em></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="params"><dt>Parameters</dt><dd> <table class="params"> <tr><td class="paramdir">[in]</td><td class="paramname">sleep_time</td><td>specifies how long the system was in sleep or power-down mode.</td></tr> </table> </dd> </dl> <p>The function <b>os_resume</b> resumes the RTX task scheduler. You must call this function after you have called <a class="el" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a> to re-enable the task scheduler.</p> <p>The argument <em>sleep_time</em> specifies how long the system was in sleep or power-down mode. It is measured in number of system intervals.</p> <dl class="section note"><dt>Note</dt><dd><ul> <li>You can call this function from the idle task only.</li> <li>When the system is in power-down, the system tick timer is not running.</li> <li>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</li> </ul> </dd></dl> <p>See <a class="el" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a> for a <b>Code</b> <b>Example</b>. </p> </div> </div> <a class="anchor" id="ga3e9c57746ccbdfe90464ad50513c569e"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">uint32_t os_suspend </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>number of ticks, for how long the system can sleep or power-down.</dd></dl> <p>The function <b>os_suspend</b> suspends the RTX task scheduler. The function calculates the time, for how long the system is allowed to power-down, and locks the task scheduler. When the function returns, the task switches are disabled. For normal RTX operation, after calling <b>os_suspend</b>, you must call the <a class="el" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a> function to re-enable the OS task scheduler.</p> <dl class="section note"><dt>Note</dt><dd><ul> <li>You can call this function from the idle task only.</li> <li>When the system is in power-down, the system tick timer is not running.</li> <li>Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</li> </ul> </dd></dl> <p><b>Code</b> <b>Example</b> </p> <p>The low power RTX is controlled from the <a class="el" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a>. The peripheral wake-up timer must be initialized before the system enters an endless loop. <b>os_suspend</b> calculates the timeout until the first suspended task becomes ready, and returns the timeout to the user:</p> <div class="fragment"><div class="line"><span class="keywordflow">for</span> (;;) {</div> <div class="line">sleep = <a class="code" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a>();</div> </div><!-- fragment --><p>The user sets-up a peripheral timer to sleep timeout and starts the timer. The timeout is measured in system ticks.</p> <div class="fragment"><div class="line"><span class="keywordflow">if</span> (sleep) {</div> <div class="line"> <span class="comment">// Setup the wake-up timer ... </span></div> </div><!-- fragment --><p>When the wake-up timer is set-up and running, the user puts the system in power-down mode. The wake-up timer must run also in power-down mode. All other peripherals and the CPU may power-down to reduce power.</p> <div class="fragment"><div class="line"><span class="comment">// Power-down the system ... </span></div> <div class="line">SCB-&gt;SCR |= SCB_SCR_SLEEPDEEP_Msk;</div> <div class="line">__WFE();</div> </div><!-- fragment --><p>The wake-up timer, when expired, generates the interrupt and wakes-up the system. Hence, it must run also in power-down mode. The system resumes operation and needs to call the function <a class="el" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a>. This function restores the RTX and re-enables the scheduler.</p> <div class="fragment"><div class="line"> <span class="comment">// After Wake-up </span></div> <div class="line"> sleep = (tc - LPC_WWDT-&gt;TV) / 250;</div> <div class="line">}</div> <div class="line"><a class="code" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a>(sleep);</div> </div><!-- fragment --><p>If, for any reason, the system does not wake up immediately after the wake-up interrupt, the actual sleep time is checked and adjusted. </p> </div> </div> <a class="anchor" id="ga145e7eafdd042bb522020cbb3b469d9c"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">int os_tick_init </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>IRQ number of the alternative hardware timer</dd></dl> <p>The function <b>os_tick_init</b> initializes an alternate hardware timer as the system tick timer and starts it. If you setup OS_SYSTICK to 0, this function will be available for adding the alternate timer. It returns the interrupt number of the alternative hardware timer.</p> <dl class="section note"><dt>Note</dt><dd>- When using an alternate timer, you must enter the <a class="el" href="timerTick.html#OS_Tick_Handler">OS_Tick_Handler</a> in the interrupt vector table in the startup file.</dd> <dd> - Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;LPC43xx.h&quot;</span> <span class="comment">// Device header</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">int</span> <a class="code" href="group__RTX__Global__Functions.html#ga145e7eafdd042bb522020cbb3b469d9c">os_tick_init</a> (<span class="keywordtype">void</span>) {</div> <div class="line"> <span class="comment">// Initialize hardware timer as system tick timer. </span></div> <div class="line"> </div> <div class="line"> LPC_CCU1-&gt;CLK_M4_RITIMER_CFG = (1UL &lt;&lt; 0);</div> <div class="line"> </div> <div class="line"> LPC_RITIMER-&gt;COMPVAL = <a class="code" href="RTX__Conf__CM_8c.html#a9d55a070ddb219165bd4287f08318d51">OS_TRV</a>; <span class="comment">// Set match value</span></div> <div class="line"> LPC_RITIMER-&gt;COUNTER = 0; <span class="comment">// Set count value to 0</span></div> <div class="line"> LPC_RITIMER-&gt;CTRL = (1UL &lt;&lt; 3) | <span class="comment">// Timer enable</span></div> <div class="line"> (1UL &lt;&lt; 2) | <span class="comment">// Timer enable for debug</span></div> <div class="line"> (1UL &lt;&lt; 1) | <span class="comment">// Timer enable clear on match</span></div> <div class="line"> (1UL &lt;&lt; 0); <span class="comment">// Clear interrupt flag</span></div> <div class="line"> </div> <div class="line"> <span class="keywordflow">return</span> (M0_RITIMER_OR_WWDT_IRQn); <span class="comment">// Return IRQ number of timer (0..239) </span></div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga85dab8408f27236c7341a69feb6258c7"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void os_tick_irqack </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <p>The function <b>os_tick_irqack</b> acknowledges the peripheral timer interrupt.</p> <dl class="section note"><dt>Note</dt><dd>- When using an alternate timer, you must enter the <a class="el" href="timerTick.html#OS_Tick_Handler">OS_Tick_Handler</a> in the interrupt vector table in the startup file. </dd> <dd> - Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;LPC43xx.h&quot;</span> <span class="comment">// Device header</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#ga85dab8408f27236c7341a69feb6258c7">os_tick_irqack</a> (<span class="keywordtype">void</span>) {</div> <div class="line"> </div> <div class="line"> LPC_RITIMER-&gt;CTRL |= (1UL &lt;&lt; 0); <span class="comment">// Clear interrupt flag</span></div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="gad5deddec3fea0fb31798f571afc3c692"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">uint32_t os_tick_ovf </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>Overflow flag<br/> <ul> <li>1 : overflow</li> <li>0 : no overflow</li> </ul> </dd></dl> <p>The function <b>os_tick_ovf</b> returns the overflow flag of the alternate hardware timer specified by os_tick_init.</p> <dl class="section note"><dt>Note</dt><dd>- When using an alternate timer, you must enter the <a class="el" href="timerTick.html#OS_Tick_Handler">OS_Tick_Handler</a> in the interrupt vector table in the startup file. </dd> <dd> - Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;LPC43xx.h&quot;</span> <span class="comment">// Device header</span></div> <div class="line"> </div> <div class="line">uint32_t <a class="code" href="group__RTX__Global__Functions.html#gad5deddec3fea0fb31798f571afc3c692">os_tick_ovf</a> (<span class="keywordtype">void</span>) {</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">return</span> (LPC_RITIMER-&gt;CTRL);</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> <a class="anchor" id="ga567543bf38239a91f09751686c23017b"></a> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">uint32_t os_tick_val </td> <td>(</td> <td class="paramtype">void&#160;</td> <td class="paramname"></td><td>)</td> <td></td> </tr> </table> </div><div class="memdoc"> <dl class="section return"><dt>Returns</dt><dd>Current value of the alternative hardware timer</dd></dl> <p>The function <b>os_tick_val</b> returns the current value of the alternate hardware timer specified by os_tick_init.</p> <dl class="section note"><dt>Note</dt><dd>- When using an alternate timer, you must enter the <a class="el" href="timerTick.html#OS_Tick_Handler">OS_Tick_Handler</a> in the interrupt vector table in the startup file. </dd> <dd> - Cannot be called from <a class="el" href="functionOverview.html#CMSIS_RTOS_ISR_Calls">Interrupt Service Routines</a>.</dd></dl> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;LPC43xx.h&quot;</span> <span class="comment">// Device header</span></div> <div class="line"> </div> <div class="line">uint32_t <a class="code" href="group__RTX__Global__Functions.html#ga567543bf38239a91f09751686c23017b">os_tick_val</a> (<span class="keywordtype">void</span>) {</div> <div class="line"> </div> <div class="line"> <span class="keywordflow">return</span> (LPC_RITIMER-&gt;COUNTER);</div> <div class="line">}</div> </div><!-- fragment --> </div> </div> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__RTX__Global__Functions.html
HTML
apache-2.0
32,841
var group__RTX__Global__Functions = [ [ "os_error", "group__RTX__Global__Functions.html#ga651ae76b3acf45f80bf0e0487b51d6e6", null ], [ "os_idle_demon", "group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4", null ], [ "os_resume", "group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33", null ], [ "os_suspend", "group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e", null ], [ "os_tick_init", "group__RTX__Global__Functions.html#ga145e7eafdd042bb522020cbb3b469d9c", null ], [ "os_tick_irqack", "group__RTX__Global__Functions.html#ga85dab8408f27236c7341a69feb6258c7", null ], [ "os_tick_ovf", "group__RTX__Global__Functions.html#gad5deddec3fea0fb31798f571afc3c692", null ], [ "os_tick_val", "group__RTX__Global__Functions.html#ga567543bf38239a91f09751686c23017b", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/group__RTX__Global__Functions.js
JavaScript
apache-2.0
855
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Main Page</title> <title>CMSIS-RTOS: Main Page</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li class="current"><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('index.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">CMSIS-RTOS Documentation</div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><p>This manual describes the <b>CMSIS-RTOS</b> <b>API</b> <b>Version</b> <b>1</b> and the reference implementation <a class="el" href="rtxImplementation.html">CMSIS-RTOS RTX</a> which is designed for Cortex-M processor-based devices. The RTOS kernel can be used for creating applications that perform multiple tasks simultaneously. These tasks are executed by threads that operate in a quasi-parallel fashion.</p> <p>While it is certainly possible to create real-time applications without an RTOS (by executing one or more tasks in a loop), there are numerous scheduling, maintenance, and timing issues that can be solved better with an RTOS. For example, an RTOS enables flexible scheduling of system resources like CPU and memory, and offers methods to communicate between threads.</p> <p>CMSIS-RTOS API programs are written using standard C/C++ constructs and are compiled with the ARMCC, GCC, or IAR Compiler. The <a class="el" href="usingOS.html#cmsis_os_h">cmsis_os.h header file</a> defines functions and macros that allow declaring tasks and accessing all RTOS features easily.</p> <p>This manual contains the following sections:</p> <ul> <li><a class="el" href="rtos_revisionHistory.html">Revision History</a> : Documents changes made in each version for CMSIS-RTOS API and RTX.</li> <li><a class="el" href="genRTOSIF.html">Generic RTOS Interface</a> : Provides an overview about the CMSIS-RTOS API.</li> <li><a class="el" href="usingOS.html">Using a CMSIS-RTOS Implementation</a> : Provides generic instructions for using a CMSIS-RTOS API compliant implementation.</li> <li><a class="el" href="functionOverview.html">Function Overview</a> : Lists the CMSIS-RTOS API functions including RTX-specific extensions.</li> <li><a class="el" href="rtosValidation.html">RTOS Validation</a> : Describes the Software Pack that can be used to validate a CMSIS-RTOS implementation.</li> <li><a class="el" href="rtxImplementation.html">RTX Implementation</a> : Documents the open-source implementation CMSIS-RTOS RTX.</li> </ul> <dl class="section note"><dt>Note</dt><dd>An extended version of the CMSIS-RTOS API is available in <a href="../../RTOS2/html/index.html" class="el">CMSIS-RTOS v2</a>.</dd></dl> <hr/> <h2>CMSIS-RTOS in ARM::CMSIS Pack </h2> <p>The following files relevant to CMSIS-RTOS are present in the <b>ARM::CMSIS</b> Pack directories: </p> <table class="doxtable"> <tr> <th>File/Folder </th><th>Content </th></tr> <tr> <td><b>CMSIS/Documentation/RTOS</b> </td><td>This documentation </td></tr> <tr> <td><b>CMSIS/Documentation/RTOS2</b> </td><td>CMSIS-RTOS API Version 2 documentation </td></tr> <tr> <td><b>CMSIS/RTOS/Template</b> </td><td><a class="el" href="usingOS.html#cmsis_os_h">Header File Template: cmsis_os.h</a> </td></tr> </table> </div></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/index.html
HTML
apache-2.0
8,985
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Configuration for Low-Power Modes</title> <title>CMSIS-RTOS: Configuration for Low-Power Modes</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('lowPower.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Configuration for Low-Power Modes </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><p>The system thread <b>os_idle_demon</b> can be use to switch the system into a low-power mode. The easiest form to enter a low-power mode is the execution of the <code>__WFE</code> function that puts the processor into a sleep mode where it waits for an event.</p> <p><b>Configuration Example:</b></p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;device.h&quot;</span> <span class="comment">/* Device definitions */</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a> (<span class="keywordtype">void</span>) {</div> <div class="line"> <span class="comment">/* The idle demon is a system thread, running when no other thread is */</span></div> <div class="line"> <span class="comment">/* ready to run. */</span></div> <div class="line"> </div> <div class="line"> <span class="keywordflow">for</span> (;;) {</div> <div class="line"> __WFE(); <span class="comment">/* Enter sleep mode */</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --><dl class="section note"><dt>Note</dt><dd><code>__WFE()</code> is not available at every Cortex-M implementation. Check device manuals for availability.</dd></dl> <h1><a class="anchor" id="TickLess"></a> Tick-less operation</h1> <p>CMSIS-RTOS RTX provides extension for tick-less operation which is useful for applications that use extensively low-power modes where the SysTick timer is also disabled. To provide a time-tick in such power-saving modes a wake-up timer is used to derive timer intervals. The RTX functions <a class="el" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a> and <a class="el" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a> control the tick-less operation.</p> <p>Using this functions allows the RTX thread scheduler to stop the periodic kernel tick interrupt. When all active threads are suspended, the system enters power-down and calculates how long it can stay in this power-down mode. In the power-down mode the processor and potentially peripherals can be switched off. Only a wake-up timer must remain powered, because this timer is responsible to wake-up the system after the power-down period expires.</p> <p>The tick-less operation is controlled from the <a class="el" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a> thread. The wake-up timeout value is set before the system enters the power-down mode. The function <a class="el" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a> calculates the wake-up timeout measured in RTX Timer Ticks; this value is used to setup the wake-up timer that runs during the power-down mode of the system.</p> <p>Once the system resumes operation (either by a wake-up time out or other interrupts) the RTX thread scheduler is started with the function <a class="el" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a>. The parameter <em>sleep_time</em> specifies the time (in RTX Timer Ticks) that the system was in power-down mode.</p> <p><b>Code</b> <b>Example</b> </p> <div class="fragment"><div class="line"><span class="preprocessor">#include &quot;LPC11Uxx.h&quot;</span> <span class="comment">/* LPC11Uxx definitions */</span></div> <div class="line"> </div> <div class="line"><span class="keywordtype">void</span> <a class="code" href="group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4">os_idle_demon</a> (<span class="keywordtype">void</span>) {</div> <div class="line"> <span class="comment">/* The idle demon is a system thread, running when no other thread is */</span></div> <div class="line"> <span class="comment">/* ready to run. */</span></div> <div class="line"> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> sleep;</div> <div class="line"> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> tc;</div> <div class="line"> </div> <div class="line"> LPC_SYSCON-&gt;SYSAHBCLKCTRL |= (1UL &lt;&lt; 15) | <span class="comment">/* Enable clock for WWDT */</span></div> <div class="line"> (1UL &lt;&lt; 19); <span class="comment">/* Enable clock for Pin IRQ */</span></div> <div class="line"> </div> <div class="line"> LPC_SYSCON-&gt;PINTSEL[0] = 1; <span class="comment">/* P0.1 selected as INT0 IRQ */</span></div> <div class="line"> LPC_SYSCON-&gt;STARTERP0 |= (1UL &lt;&lt; 0); <span class="comment">/* Enable INT0 wake-up */</span></div> <div class="line"> LPC_SYSCON-&gt;STARTERP1 |= (1UL &lt;&lt; 12); <span class="comment">/* Enable WWDT wake-up */</span></div> <div class="line"> </div> <div class="line"> LPC_SYSCON-&gt;WDTOSCCTRL = (3 &lt;&lt; 0) | <span class="comment">/* WDOSC DIVSEL=3 */</span></div> <div class="line"> (2 &lt;&lt; 5); <span class="comment">/* WDOSC FREQ=0.8MHz */</span></div> <div class="line"> LPC_SYSCON-&gt;PDRUNCFG &amp;= ~(1UL &lt;&lt; 6); <span class="comment">/* Power-up WDT Oscillator */</span></div> <div class="line"> LPC_SYSCON-&gt;PDSLEEPCFG &amp;= ~(1UL &lt;&lt; 6); <span class="comment">/* Power WDT Oscillator in PD */</span></div> <div class="line"> </div> <div class="line"> LPC_WWDT-&gt;CLKSEL = (1UL &lt;&lt; 0) | <span class="comment">/* Select WDOSC as Clock */</span></div> <div class="line"> (1UL &lt;&lt; 31); <span class="comment">/* Lock selection */</span></div> <div class="line"> LPC_WWDT-&gt;WARNINT = 1000; <span class="comment">/* WDT Warning IRQ value */</span></div> <div class="line"> LPC_WWDT-&gt;MOD = (1UL &lt;&lt; 0); <span class="comment">/* Enable WDT */</span></div> <div class="line"> </div> <div class="line"> NVIC_EnableIRQ(FLEX_INT0_IRQn); <span class="comment">/* Enable INT0 IRQ (wake-up) */</span></div> <div class="line"> NVIC_EnableIRQ(WDT_IRQn); <span class="comment">/* Enable WWDT IRQ (wake-up) */</span></div> <div class="line"> </div> <div class="line"> <span class="keywordflow">for</span> (;;) {</div> <div class="line"> <span class="comment">/* HERE: include optional user code to be executed when no task runs.*/</span></div> <div class="line"> sleep = <a class="code" href="group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e">os_suspend</a>(); <span class="comment">/* Suspend RTX thread scheduler */</span></div> <div class="line"> </div> <div class="line"> <span class="keywordflow">if</span> (sleep) { <span class="comment">/* How long can we sleep? */</span></div> <div class="line"> <span class="comment">/* &quot;sleep&quot; is in RTX Timer Ticks which is 10ms in this configuration */</span></div> <div class="line"> </div> <div class="line"> <span class="comment">/* Setup WDT wake-up: WDT ticks @25kHz (FREQ/2/(DIVSEL+1)/4) */</span></div> <div class="line"> tc = (sleep * 250) + 1000;</div> <div class="line"> LPC_WWDT-&gt;TC = tc;</div> <div class="line"> LPC_WWDT-&gt;FEED = 0xAA;</div> <div class="line"> LPC_WWDT-&gt;FEED = 0x55;</div> <div class="line"> </div> <div class="line"> <span class="comment">/* Enter Power-down mode */</span></div> <div class="line"> LPC_SYSCON-&gt;PDAWAKECFG = LPC_SYSCON-&gt;PDRUNCFG; <span class="comment">/* Power after wake-up */</span></div> <div class="line"> LPC_PMU-&gt;PCON = 0x02; <span class="comment">/* Select Power-down mode */</span></div> <div class="line"> SCB-&gt;SCR = (1UL &lt;&lt; 2); <span class="comment">/* Set SLEEPDEEP */</span></div> <div class="line"> __WFE(); <span class="comment">/* Enter Power-down mode */</span></div> <div class="line"> </div> <div class="line"> <span class="comment">/* After Wake-up */</span></div> <div class="line"> sleep = (tc - LPC_WWDT-&gt;TV) / 250;</div> <div class="line"> }</div> <div class="line"> </div> <div class="line"> <a class="code" href="group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33">os_resume</a>(sleep); <span class="comment">/* Resume RTX thread scheduler */</span></div> <div class="line"> }</div> <div class="line">}</div> </div><!-- fragment --><dl class="section note"><dt>Note</dt><dd><code>__WFE()</code> is not available at every Cortex-M implementation. Check device manuals for availability. </dd></dl> </div></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="rtxImplementation.html">RTX Implementation</a></li><li class="navelem"><a class="el" href="configure.html">Configure RTX</a></li> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/lowPower.html
HTML
apache-2.0
15,727
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>MISRA-C:2004 Compliance Exceptions</title> <title>CMSIS-RTOS: MISRA-C:2004 Compliance Exceptions</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('misraCompliance.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">MISRA-C:2004 Compliance Exceptions </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><p>CMSIS-RTOS RTX tries to be MISRA-C compliant as much as possible. However, there are some violations in order to simplify the overall code logic and to generate more efficient code.</p> <p>CMSIS-RTOS RTX generates the following notes, warnings and infos for MISRA-C:2004 rules:</p> <ul> <li>Rule 1.1, required, Rule 2.2, required: Non-ANSI reserved word or construct: '//'</li> <li>Rule 1.2, required: Both sides have side effects</li> <li>Rule 1.2, required: Unusual pointer cast (incompatible indirect types)</li> <li>Rule 8.1, required: Function defined without a prototype in scope</li> <li>Rule 11.1, required, Rule 11.3, advisory: cast from pointer to unsigned int</li> <li>Rule 11.1, required, Rule 11.3, advisory: cast from unsigned int to pointer</li> <li>Rule 11.4, advisory: cast from pointer to pointer</li> <li>Rule 12.11, advisory: Overflow in computing constant for operation: 'unsigned shift left'</li> <li>Rule 13.7, required, Rule 14.1, required: Constant value Boolean</li> <li>Rule 14.4, required: Use of goto is deprecated</li> <li>Rule 14.7, required: Return statement before end of function</li> <li>Rule 16.10, required: Ignoring return value of function</li> <li>Rule 17.2, required, Rule 17.3, required: Relational or subtract operator applied to pointers</li> <li>Rule 19.4, required, Rule 19.10, required: Expression-like macro not parenthesized</li> <li>Rule 19.15, required: Repeated include file</li> </ul> <p>CMSIS-RTOS RTX violates the following MISRA-C:2004 rules:</p> <ul> <li>Required Rule 8.5: object/function definition in header file</li> <li>Required Rule 10.1: Prohibited Implicit Conversion: Non-constant argument to function</li> <li>Required Rule 10.1: Implicit conversion of complex integer expression</li> <li>Required Rule 10.3: Cast of complex integer expression to larger type</li> <li>Required Rule 10.3: Cast of complex expression changes signedness</li> <li>Required Rule 11.5: attempt to cast away const/volatile from a pointer or reference</li> <li>Required Rule 12.4: side effects on right hand of logical operator: '&amp;&amp;'</li> <li>Required Rule 12.4: side effects on right hand of logical operator: '||'</li> <li>Required Rule 12.5: non-primary expression used with logical operator</li> <li>Required Rule 14.3: null statement not in line by itself</li> <li>Required Rule 14.8: left brace expected for while, do...while and for</li> <li>Required Rule 14.9: left brace expected for if and else</li> <li>Required Rule 15.3: default missing from switch statement</li> <li>Required Rule 16.9: function identifier used without '&amp;' or parenthesized parameter list</li> <li>Required Rule 17.4: pointer arithmetic other than array indexing used</li> <li>Required Rule 18.4: declaration of union type or object of union type: '{...}'</li> <li>Required Rule 19.12: Multiple use of '#/##' operators in definition of macro</li> <li>Required Rule 20.2: Re-use of C90 identifier pattern</li> <li>Advisory Rule 12.1: dependence placed on C's operator precedence; operators: '+' and '-'</li> <li>Advisory Rule 12.13: increment or decrement combined with another operator</li> <li>Advisory Rule 19.13: '#/##' operator used in macro</li> <li>Advisory Rule 19.7: Function-like macro defined </li> </ul> </div></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="index.html">index</a></li><li class="navelem"><a class="el" href="rtxImplementation.html">RTX Implementation</a></li> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/misraCompliance.html
HTML
apache-2.0
9,713
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Reference</title> <title>CMSIS-RTOS: Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li class="current"><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('modules.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Reference</div> </div> </div><!--header--> <div class="contents"> <div class="textblock">Here is a list of all modules:</div><div class="directory"> <div class="levels">[detail level <span onclick="javascript:toggleLevel(1);">1</span><span onclick="javascript:toggleLevel(2);">2</span><span onclick="javascript:toggleLevel(3);">3</span>]</div><table class="directory"> <tr id="row_0_" class="even"><td class="entry"><img id="arr_0_" src="ftv2mnode.png" alt="o" width="16" height="22" onclick="toggleFolder('0_')"/><a class="el" href="group__CMSIS__RTOS.html" target="_self">CMSIS-RTOS API</a></td><td class="desc">This section describes the CMSIS-RTOS API </td></tr> <tr id="row_0_0_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__KernelCtrl.html" target="_self">Kernel Information and Control</a></td><td class="desc">Provide version/system information and start the RTOS Kernel </td></tr> <tr id="row_0_1_" class="even"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html" target="_self">Thread Management</a></td><td class="desc">Define, create, and control thread functions </td></tr> <tr id="row_0_2_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__Wait.html" target="_self">Generic Wait Functions</a></td><td class="desc">Wait for a time period or unspecified events </td></tr> <tr id="row_0_3_" class="even"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html" target="_self">Timer Management</a></td><td class="desc">Create and control timer and timer callback functions </td></tr> <tr id="row_0_4_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img id="arr_0_4_" src="ftv2mnode.png" alt="o" width="16" height="22" onclick="toggleFolder('0_4_')"/><a class="el" href="group__CMSIS__RTOS__InterThread.html" target="_self">Inter-Thread Communication and Resource Sharing</a></td><td class="desc">Functions for inter-thread communication </td></tr> <tr id="row_0_4_0_" class="even"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__SignalMgmt.html" target="_self">Signal Events</a></td><td class="desc">Synchronize threads using signals </td></tr> <tr id="row_0_4_1_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__Message.html" target="_self">Message Queue</a></td><td class="desc">Exchange messages between threads in a FIFO-like operation </td></tr> <tr id="row_0_4_2_" class="even"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__PoolMgmt.html" target="_self">Memory Pool</a></td><td class="desc">Manage thread-safe fixed-size blocks of dynamic memory </td></tr> <tr id="row_0_4_3_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__Mail.html" target="_self">Mail Queue</a></td><td class="desc">Exchange data between threads using a queue of memory blocks </td></tr> <tr id="row_0_4_4_" class="even"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html" target="_self">Mutexes</a></td><td class="desc">Synchronize resource access using Mutual Exclusion (Mutex) </td></tr> <tr id="row_0_4_5_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html" target="_self">Semaphores</a></td><td class="desc">Access shared resources simultaneously from different threads </td></tr> <tr id="row_0_5_" class="even"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2node.png" alt="o" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__Definitions.html" target="_self">Generic Data Types and Definitions</a></td><td class="desc">Data Type Definitions used by the CMSIS-RTOS API functions </td></tr> <tr id="row_0_6_"><td class="entry"><img src="ftv2vertline.png" alt="|" width="16" height="22" /><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a class="el" href="group__CMSIS__RTOS__Status.html" target="_self">Status and Error Codes</a></td><td class="desc">Status and Error Codes returned by CMSIS-RTOS API functions </td></tr> <tr id="row_1_" class="even"><td class="entry"><img src="ftv2lastnode.png" alt="\" width="16" height="22" /><a class="el" href="group__RTX__Global__Functions.html" target="_self">RTX Specific Functions</a></td><td class="desc">This section describes the functions that are specific to CMSIS-RTOS RTX </td></tr> </table> </div><!-- directory --> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/modules.html
HTML
apache-2.0
11,988
var modules = [ [ "CMSIS-RTOS API", "group__CMSIS__RTOS.html", "group__CMSIS__RTOS" ], [ "RTX Specific Functions", "group__RTX__Global__Functions.html", "group__RTX__Global__Functions" ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/modules.js
JavaScript
apache-2.0
197
#nav-tree .children_ul { margin:0; padding:4px; } #nav-tree ul { list-style:none outside none; margin:0px; padding:0px; } #nav-tree li { white-space:nowrap; margin:0px; padding:0px; } #nav-tree .plus { margin:0px; } #nav-tree .selected { background-image: url('tab_a.png'); background-repeat:repeat-x; color: #fff; text-shadow: 0px 1px 1px rgba(0, 0, 0, 1.0); } #nav-tree img { margin:0px; padding:0px; border:0px; vertical-align: middle; } #nav-tree a { text-decoration:none; padding:0px; margin:0px; outline:none; } #nav-tree .label { margin:0px; padding:0px; font: 12px 'Lucida Grande',Geneva,Helvetica,Arial,sans-serif; } #nav-tree .label a { padding:2px; } #nav-tree .selected a { text-decoration:none; color:#fff; } #nav-tree .children_ul { margin:0px; padding:0px; } #nav-tree .item { margin:0px; padding:0px; } #nav-tree { padding: 0px 0px; background-color: #FAFAFF; font-size:14px; overflow:auto; } #doc-content { overflow:auto; display:block; padding:0px; margin:0px; -webkit-overflow-scrolling : touch; /* iOS 5+ */ } #side-nav { padding:0 6px 0 0; margin: 0px; display:block; position: absolute; left: 0px; width: 250px; } .ui-resizable .ui-resizable-handle { display:block; } .ui-resizable-e { background:url("ftv2splitbar.png") repeat scroll right center transparent; cursor:e-resize; height:100%; right:0; top:0; width:6px; } .ui-resizable-handle { display:none; font-size:0.1px; position:absolute; z-index:1; } #nav-tree-contents { margin: 6px 0px 0px 0px; } #nav-tree { background-image:url('nav_h.png'); background-repeat:repeat-x; background-color: #F9FAFC; -webkit-overflow-scrolling : touch; /* iOS 5+ */ } #nav-sync { position:absolute; top:5px; right:24px; z-index:0; } #nav-sync img { opacity:0.3; } #nav-sync img:hover { opacity:0.9; } @media print { #nav-tree { display: none; } div.ui-resizable-handle { display: none; position: relative; } }
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/navtree.css
CSS
apache-2.0
2,036
var NAVTREE = [ [ "CMSIS-RTOS", "index.html", [ [ "Revision History", "rtos_revisionHistory.html", [ [ "CMSIS-RTOS API", "rtos_revisionHistory.html#GenRTOSRev", null ], [ "CMSIS-RTOS RTX", "rtos_revisionHistory.html#RTXRevisionHistory", null ] ] ], [ "Generic RTOS Interface", "genRTOSIF.html", null ], [ "Using a CMSIS-RTOS Implementation", "usingOS.html", [ [ "Header File Template: cmsis_os.h", "usingOS.html#cmsis_os_h", null ] ] ], [ "Function Overview", "functionOverview.html", [ [ "Timout Value", "functionOverview.html#CMSIS_RTOS_TimeOutValue", null ], [ "Calls from Interrupt Service Routines", "functionOverview.html#CMSIS_RTOS_ISR_Calls", null ] ] ], [ "RTOS Validation", "rtosValidation.html", [ [ "Sample Test Output", "rtosValidation.html#test_output", null ] ] ], [ "RTX Implementation", "rtxImplementation.html", "rtxImplementation" ], [ "Reference", "modules.html", "modules" ], [ "Data Structures", "annotated.html", "annotated" ], [ "Data Structure Index", "classes.html", null ], [ "Data Fields", "functions.html", [ [ "All", "functions.html", null ], [ "Variables", "functions_vars.html", null ] ] ] ] ] ]; var NAVTREEINDEX = [ "annotated.html" ]; var SYNCONMSG = 'click to disable panel synchronisation'; var SYNCOFFMSG = 'click to enable panel synchronisation'; var SYNCONMSG = 'click to disable panel synchronisation'; var SYNCOFFMSG = 'click to enable panel synchronisation'; var navTreeSubIndices = new Array(); function getData(varName) { var i = varName.lastIndexOf('/'); var n = i>=0 ? varName.substring(i+1) : varName; return eval(n.replace(/\-/g,'_')); } function stripPath(uri) { return uri.substring(uri.lastIndexOf('/')+1); } function stripPath2(uri) { var i = uri.lastIndexOf('/'); var s = uri.substring(i+1); var m = uri.substring(0,i+1).match(/\/d\w\/d\w\w\/$/); return m ? uri.substring(i-6) : s; } function localStorageSupported() { try { return 'localStorage' in window && window['localStorage'] !== null && window.localStorage.getItem; } catch(e) { return false; } } function storeLink(link) { if (!$("#nav-sync").hasClass('sync') && localStorageSupported()) { window.localStorage.setItem('navpath',link); } } function deleteLink() { if (localStorageSupported()) { window.localStorage.setItem('navpath',''); } } function cachedLink() { if (localStorageSupported()) { return window.localStorage.getItem('navpath'); } else { return ''; } } function getScript(scriptName,func,show) { var head = document.getElementsByTagName("head")[0]; var script = document.createElement('script'); script.id = scriptName; script.type = 'text/javascript'; script.onload = func; script.src = scriptName+'.js'; if ($.browser.msie && $.browser.version<=8) { // script.onload does not work with older versions of IE script.onreadystatechange = function() { if (script.readyState=='complete' || script.readyState=='loaded') { func(); if (show) showRoot(); } } } head.appendChild(script); } function createIndent(o,domNode,node,level) { var level=-1; var n = node; while (n.parentNode) { level++; n=n.parentNode; } if (node.childrenData) { var imgNode = document.createElement("img"); imgNode.style.paddingLeft=(16*level).toString()+'px'; imgNode.width = 16; imgNode.height = 22; imgNode.border = 0; node.plus_img = imgNode; node.expandToggle = document.createElement("a"); node.expandToggle.href = "javascript:void(0)"; node.expandToggle.onclick = function() { if (node.expanded) { $(node.getChildrenUL()).slideUp("fast"); node.plus_img.src = node.relpath+"ftv2pnode.png"; node.expanded = false; } else { expandNode(o, node, false, false); } } node.expandToggle.appendChild(imgNode); domNode.appendChild(node.expandToggle); imgNode.src = node.relpath+"ftv2pnode.png"; } else { var span = document.createElement("span"); span.style.display = 'inline-block'; span.style.width = 16*(level+1)+'px'; span.style.height = '22px'; span.innerHTML = '&#160;'; domNode.appendChild(span); } } var animationInProgress = false; function gotoAnchor(anchor,aname,updateLocation) { var pos, docContent = $('#doc-content'); if (anchor.parent().attr('class')=='memItemLeft' || anchor.parent().attr('class')=='fieldtype' || anchor.parent().is(':header')) { pos = anchor.parent().position().top; } else if (anchor.position()) { pos = anchor.position().top; } if (pos) { var dist = Math.abs(Math.min( pos-docContent.offset().top, docContent[0].scrollHeight- docContent.height()-docContent.scrollTop())); animationInProgress=true; docContent.animate({ scrollTop: pos + docContent.scrollTop() - docContent.offset().top },Math.max(50,Math.min(500,dist)),function(){ if (updateLocation) window.location.href=aname; animationInProgress=false; }); } } function newNode(o, po, text, link, childrenData, lastNode) { var node = new Object(); node.children = Array(); node.childrenData = childrenData; node.depth = po.depth + 1; node.relpath = po.relpath; node.isLast = lastNode; node.li = document.createElement("li"); po.getChildrenUL().appendChild(node.li); node.parentNode = po; node.itemDiv = document.createElement("div"); node.itemDiv.className = "item"; node.labelSpan = document.createElement("span"); node.labelSpan.className = "label"; createIndent(o,node.itemDiv,node,0); node.itemDiv.appendChild(node.labelSpan); node.li.appendChild(node.itemDiv); var a = document.createElement("a"); node.labelSpan.appendChild(a); node.label = document.createTextNode(text); node.expanded = false; a.appendChild(node.label); if (link) { var url; if (link.substring(0,1)=='^') { url = link.substring(1); link = url; } else { url = node.relpath+link; } a.className = stripPath(link.replace('#',':')); if (link.indexOf('#')!=-1) { var aname = '#'+link.split('#')[1]; var srcPage = stripPath($(location).attr('pathname')); var targetPage = stripPath(link.split('#')[0]); a.href = srcPage!=targetPage ? url : "javascript:void(0)"; a.onclick = function(){ storeLink(link); if (!$(a).parent().parent().hasClass('selected')) { $('.item').removeClass('selected'); $('.item').removeAttr('id'); $(a).parent().parent().addClass('selected'); $(a).parent().parent().attr('id','selected'); } var anchor = $(aname); gotoAnchor(anchor,aname,true); }; } else { a.href = url; a.onclick = function() { storeLink(link); } } } else { if (childrenData != null) { a.className = "nolink"; a.href = "javascript:void(0)"; a.onclick = node.expandToggle.onclick; } } node.childrenUL = null; node.getChildrenUL = function() { if (!node.childrenUL) { node.childrenUL = document.createElement("ul"); node.childrenUL.className = "children_ul"; node.childrenUL.style.display = "none"; node.li.appendChild(node.childrenUL); } return node.childrenUL; }; return node; } function showRoot() { var headerHeight = $("#top").height(); var footerHeight = $("#nav-path").height(); var windowHeight = $(window).height() - headerHeight - footerHeight; (function (){ // retry until we can scroll to the selected item try { var navtree=$('#nav-tree'); navtree.scrollTo('#selected',0,{offset:-windowHeight/2}); } catch (err) { setTimeout(arguments.callee, 0); } })(); } function expandNode(o, node, imm, showRoot) { if (node.childrenData && !node.expanded) { if (typeof(node.childrenData)==='string') { var varName = node.childrenData; getScript(node.relpath+varName,function(){ node.childrenData = getData(varName); expandNode(o, node, imm, showRoot); }, showRoot); } else { if (!node.childrenVisited) { getNode(o, node); } if (imm || ($.browser.msie && $.browser.version>8)) { // somehow slideDown jumps to the start of tree for IE9 :-( $(node.getChildrenUL()).show(); } else { $(node.getChildrenUL()).slideDown("fast"); } if (node.isLast) { node.plus_img.src = node.relpath+"ftv2mlastnode.png"; } else { node.plus_img.src = node.relpath+"ftv2mnode.png"; } node.expanded = true; } } } function glowEffect(n,duration) { n.addClass('glow').delay(duration).queue(function(next){ $(this).removeClass('glow');next(); }); } function highlightAnchor() { var aname = $(location).attr('hash'); var anchor = $(aname); if (anchor.parent().attr('class')=='memItemLeft'){ var rows = $('.memberdecls tr[class$="'+ window.location.hash.substring(1)+'"]'); glowEffect(rows.children(),300); // member without details } else if (anchor.parents().slice(2).prop('tagName')=='TR') { glowEffect(anchor.parents('div.memitem'),1000); // enum value } else if (anchor.parent().attr('class')=='fieldtype'){ glowEffect(anchor.parent().parent(),1000); // struct field } else if (anchor.parent().is(":header")) { glowEffect(anchor.parent(),1000); // section header } else { glowEffect(anchor.next(),1000); // normal member } gotoAnchor(anchor,aname,false); } function selectAndHighlight(hash,n) { var a; if (hash) { var link=stripPath($(location).attr('pathname'))+':'+hash.substring(1); a=$('.item a[class$="'+link+'"]'); } if (a && a.length) { a.parent().parent().addClass('selected'); a.parent().parent().attr('id','selected'); highlightAnchor(); } else if (n) { $(n.itemDiv).addClass('selected'); $(n.itemDiv).attr('id','selected'); } if ($('#nav-tree-contents .item:first').hasClass('selected')) { $('#nav-sync').css('top','30px'); } else { $('#nav-sync').css('top','5px'); } showRoot(); } function showNode(o, node, index, hash) { if (node && node.childrenData) { if (typeof(node.childrenData)==='string') { var varName = node.childrenData; getScript(node.relpath+varName,function(){ node.childrenData = getData(varName); showNode(o,node,index,hash); },true); } else { if (!node.childrenVisited) { getNode(o, node); } $(node.getChildrenUL()).css({'display':'block'}); if (node.isLast) { node.plus_img.src = node.relpath+"ftv2mlastnode.png"; } else { node.plus_img.src = node.relpath+"ftv2mnode.png"; } node.expanded = true; var n = node.children[o.breadcrumbs[index]]; if (index+1<o.breadcrumbs.length) { showNode(o,n,index+1,hash); } else { if (typeof(n.childrenData)==='string') { var varName = n.childrenData; getScript(n.relpath+varName,function(){ n.childrenData = getData(varName); node.expanded=false; showNode(o,node,index,hash); // retry with child node expanded },true); } else { var rootBase = stripPath(o.toroot.replace(/\..+$/, '')); if (rootBase=="index" || rootBase=="pages" || rootBase=="search") { expandNode(o, n, true, true); } selectAndHighlight(hash,n); } } } } else { selectAndHighlight(hash); } } function removeToInsertLater(element) { var parentNode = element.parentNode; var nextSibling = element.nextSibling; parentNode.removeChild(element); return function() { if (nextSibling) { parentNode.insertBefore(element, nextSibling); } else { parentNode.appendChild(element); } }; } function getNode(o, po) { var insertFunction = removeToInsertLater(po.li); po.childrenVisited = true; var l = po.childrenData.length-1; for (var i in po.childrenData) { var nodeData = po.childrenData[i]; po.children[i] = newNode(o, po, nodeData[0], nodeData[1], nodeData[2], i==l); } insertFunction(); } function gotoNode(o,subIndex,root,hash,relpath) { var nti = navTreeSubIndices[subIndex][root+hash]; o.breadcrumbs = $.extend(true, [], nti ? nti : navTreeSubIndices[subIndex][root]); if (!o.breadcrumbs && root!=NAVTREE[0][1]) { // fallback: show index navTo(o,NAVTREE[0][1],"",relpath); $('.item').removeClass('selected'); $('.item').removeAttr('id'); } if (o.breadcrumbs) { o.breadcrumbs.unshift(0); // add 0 for root node showNode(o, o.node, 0, hash); } } function navTo(o,root,hash,relpath) { var link = cachedLink(); if (link) { var parts = link.split('#'); root = parts[0]; if (parts.length>1) hash = '#'+parts[1]; else hash=''; } if (hash.match(/^#l\d+$/)) { var anchor=$('a[name='+hash.substring(1)+']'); glowEffect(anchor.parent(),1000); // line number hash=''; // strip line number anchors //root=root.replace(/_source\./,'.'); // source link to doc link } var url=root+hash; var i=-1; while (NAVTREEINDEX[i+1]<=url) i++; if (i==-1) { i=0; root=NAVTREE[0][1]; } // fallback: show index if (navTreeSubIndices[i]) { gotoNode(o,i,root,hash,relpath) } else { getScript(relpath+'navtreeindex'+i,function(){ navTreeSubIndices[i] = eval('NAVTREEINDEX'+i); if (navTreeSubIndices[i]) { gotoNode(o,i,root,hash,relpath); } },true); } } function showSyncOff(n,relpath) { n.html('<img src="'+relpath+'sync_off.png" title="'+SYNCOFFMSG+'"/>'); } function showSyncOn(n,relpath) { n.html('<img src="'+relpath+'sync_on.png" title="'+SYNCONMSG+'"/>'); } function toggleSyncButton(relpath) { var navSync = $('#nav-sync'); if (navSync.hasClass('sync')) { navSync.removeClass('sync'); showSyncOff(navSync,relpath); storeLink(stripPath2($(location).attr('pathname'))+$(location).attr('hash')); } else { navSync.addClass('sync'); showSyncOn(navSync,relpath); deleteLink(); } } function initNavTree(toroot,relpath) { var o = new Object(); o.toroot = toroot; o.node = new Object(); o.node.li = document.getElementById("nav-tree-contents"); o.node.childrenData = NAVTREE; o.node.children = new Array(); o.node.childrenUL = document.createElement("ul"); o.node.getChildrenUL = function() { return o.node.childrenUL; }; o.node.li.appendChild(o.node.childrenUL); o.node.depth = 0; o.node.relpath = relpath; o.node.expanded = false; o.node.isLast = true; o.node.plus_img = document.createElement("img"); o.node.plus_img.src = relpath+"ftv2pnode.png"; o.node.plus_img.width = 16; o.node.plus_img.height = 22; if (localStorageSupported()) { var navSync = $('#nav-sync'); if (cachedLink()) { showSyncOff(navSync,relpath); navSync.removeClass('sync'); } else { showSyncOn(navSync,relpath); } navSync.click(function(){ toggleSyncButton(relpath); }); } $(window).load(function(){ navTo(o,toroot,window.location.hash,relpath); showRoot(); }); $(window).bind('hashchange', function(){ if (window.location.hash && window.location.hash.length>1){ var a; if ($(location).attr('hash')){ var clslink=stripPath($(location).attr('pathname'))+':'+ $(location).attr('hash').substring(1); a=$('.item a[class$="'+clslink+'"]'); } if (a==null || !$(a).parent().parent().hasClass('selected')){ $('.item').removeClass('selected'); $('.item').removeAttr('id'); } var link=stripPath2($(location).attr('pathname')); navTo(o,link,$(location).attr('hash'),relpath); } else if (!animationInProgress) { $('#doc-content').scrollTop(0); $('.item').removeClass('selected'); $('.item').removeAttr('id'); navTo(o,toroot,window.location.hash,relpath); } }) }
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/navtree.js
JavaScript
apache-2.0
16,158
var NAVTREEINDEX0 = { "annotated.html":[7], "classes.html":[8], "cmsis__os_8h.html#a15773df83aba93f8e61f3737af5fae47":[7,10,0], "cmsis__os_8h.html#a15da8f23c6fe684b70a73646ada685e7":[7,9,3], "cmsis__os_8h.html#a269c3935f8bc66db70bccdd02cb05e3c":[7,4,1], "cmsis__os_8h.html#a269c3935f8bc66db70bccdd02cb05e3c":[7,5,1], "cmsis__os_8h.html#a269c3935f8bc66db70bccdd02cb05e3c":[7,7,1], "cmsis__os_8h.html#a44b7a3baf02bac7ad707e8f2f5eca1ca":[7,6,0], "cmsis__os_8h.html#a44b7a3baf02bac7ad707e8f2f5eca1ca":[7,8,0], "cmsis__os_8h.html#a4c2a0c691de3365c00ecd22d8102811f":[7,4,0], "cmsis__os_8h.html#a4c2a0c691de3365c00ecd22d8102811f":[7,5,0], "cmsis__os_8h.html#a4c2a0c691de3365c00ecd22d8102811f":[7,7,0], "cmsis__os_8h.html#a8a83a3a8c0aa8057b13807d2a54077e0":[7,4,2], "cmsis__os_8h.html#a8a83a3a8c0aa8057b13807d2a54077e0":[7,5,2], "cmsis__os_8h.html#a950b7f81ad4711959517296e63bc79d1":[7,9,2], "cmsis__os_8h.html#aa4c4115851a098c0b87358ab6c025603":[7,9,0], "cmsis__os_8h.html#ac112e786b2a234e0e45cb5bdbee53763":[7,7,2], "cmsis__os_8h.html#ad3c9624ee214329fb34e71f544a6933e":[7,9,1], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa1485dec3702434a1ec3cb74c7a17a4af":[6,0,1,2,6], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa17b36cd9cd38652c2bc6d4803990674b":[6,0,1,2,4], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa193b650117c209b4a203954542bcc3e6":[6,0,1,2,2], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa45a2895ad30c79fb97de18cac7cc19f1":[6,0,1,2,3], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa549e79a43ff4f8b2b31afb613f5caa81":[6,0,1,2,0], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa61cb822239ac8f66dfbdc7291598a3d4":[6,0,1,2,1], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aa914433934143a9ba767e59577c56e6c2":[6,0,1,2,5], "cmsis__os_8h.html#ga7f2b42f1983b9107775ec2a1c69a849aae35f5e2f9c64ad346822521b643bdea4":[6,0,1,2,7], "cmsis__os_8h.html#structosMailQDef__t":[7,4], "cmsis__os_8h.html#structosMessageQDef__t":[7,5], "cmsis__os_8h.html#structosMutexDef__t":[7,6], "cmsis__os_8h.html#structosPoolDef__t":[7,7], "cmsis__os_8h.html#structosSemaphoreDef__t":[7,8], "cmsis__os_8h.html#structosThreadDef__t":[7,9], "cmsis__os_8h.html#structosTimerDef__t":[7,10], "configure.html":[5,5], "creating_RTX_LIB.html":[5,7], "dirstructfiles.html":[5,1], "dirstructfiles.html#Folders":[5,1,0], "dirstructfiles.html#RTX_Conf_CM":[5,1,2], "dirstructfiles.html#libFiles":[5,1,1], "exampleRTX_Tutorial.html":[5,6], "functionOverview.html":[3], "functionOverview.html#CMSIS_RTOS_ISR_Calls":[3,1], "functionOverview.html#CMSIS_RTOS_TimeOutValue":[3,0], "functions.html":[9,0], "functions_vars.html":[9,1], "genRTOSIF.html":[1], "group__CMSIS__RTOS.html":[6,0], "group__CMSIS__RTOS__Definitions.html":[6,0,5], "group__CMSIS__RTOS__Definitions.html#a0b9f8fd3645f01d8cb09cae82add2d7f":[6,0,5,0,2], "group__CMSIS__RTOS__Definitions.html#a4ccaa172acbdcbf38fa0ea0ef0229c49":[6,0,5,2,1], "group__CMSIS__RTOS__Definitions.html#a57aa2b69577037fb2428bc48a9fb1038":[6,0,5,2,0], "group__CMSIS__RTOS__Definitions.html#a596b6d55c3321db19239256bbe403df6":[6,0,5,0,0], "group__CMSIS__RTOS__Definitions.html#a83878c91171338902e0fe0fb97a8c47a":[6,0,5,1,0], "group__CMSIS__RTOS__Definitions.html#a9e3669d19b675bd57058fd4664205d2a":[6,0,5,1,2], "group__CMSIS__RTOS__Definitions.html#aa8420f8bebd6d9578b405b6bbaa813d9":[6,0,5,1,1], "group__CMSIS__RTOS__Definitions.html#ad477a289f1f03ac45407b64268d707d3":[6,0,5,0,1], "group__CMSIS__RTOS__Definitions.html#structosEvent":[6,0,5,0], "group__CMSIS__RTOS__Definitions.html#structos__mailQ":[6,0,5,3], "group__CMSIS__RTOS__Definitions.html#unionosEvent_8def":[6,0,5,2], "group__CMSIS__RTOS__Definitions.html#unionosEvent_8value":[6,0,5,1], "group__CMSIS__RTOS__InterThread.html":[6,0,4], "group__CMSIS__RTOS__KernelCtrl.html":[6,0,0], "group__CMSIS__RTOS__KernelCtrl.html#ga22f7d235bc9f783933bd5a981fd79696":[6,0,0,2], "group__CMSIS__RTOS__KernelCtrl.html#ga3b571de44cd3094c643247a7397f86b5":[6,0,0,8], "group__CMSIS__RTOS__KernelCtrl.html#ga47cf03658f01cdffca688e9096b58289":[6,0,0,4], "group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e":[6,0,0,7], "group__CMSIS__RTOS__KernelCtrl.html#ga702196bacccbb978620c736b209387f1":[6,0,0,0], "group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960":[6,0,0,5], "group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2":[6,0,0,9], "group__CMSIS__RTOS__KernelCtrl.html#gab78dce646fabec479c5f34bc5175b7de":[6,0,0,1], "group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001":[6,0,0,10], "group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88":[6,0,0,6], "group__CMSIS__RTOS__KernelCtrl.html#gae554ec16c23c5b7d65affade2a351891":[6,0,0,3], "group__CMSIS__RTOS__Mail.html":[6,0,4,3], "group__CMSIS__RTOS__Mail.html#ga27c1060cf21393f96b4fd1ed1c0167cc":[6,0,4,3,6], "group__CMSIS__RTOS__Mail.html#ga485ef6f81854ebda8ffbce4832181e02":[6,0,4,3,8], "group__CMSIS__RTOS__Mail.html#ga58d712b16c0c6668059f509386d1e55b":[6,0,4,3,2], "group__CMSIS__RTOS__Mail.html#ga8fde74f6fe5b9e88f75cc5eb8f2124fd":[6,0,4,3,4], "group__CMSIS__RTOS__Mail.html#gaa177e7fe5820dd70d8c9e46ded131174":[6,0,4,3,5], "group__CMSIS__RTOS__Mail.html#gac6ad7e6e7d6c4a80e60da22c57a42ccd":[6,0,4,3,7], "group__CMSIS__RTOS__Mail.html#gaceb2e0071ce160d153047f2eac1aca8e":[6,0,4,3,0], "group__CMSIS__RTOS__Mail.html#gad2deeb66d51ade54e63d8f87ff2ec9d2":[6,0,4,3,1], "group__CMSIS__RTOS__Mail.html#gadf5ce811bd6a56e617e902a1db6c2194":[6,0,4,3,3], "group__CMSIS__RTOS__Message.html":[6,0,4,1], "group__CMSIS__RTOS__Message.html#ga2d446a0b4bb90bf05d6f92eedeaabc97":[6,0,4,1,1], "group__CMSIS__RTOS__Message.html#ga479a6561f859e3d4818e25708593d203":[6,0,4,1,0], "group__CMSIS__RTOS__Message.html#ga6c6892b8f2296cca6becd57ca2d7e1ae":[6,0,4,1,4], "group__CMSIS__RTOS__Message.html#gac0dcf462fc92de8ffaba6cc004514a6d":[6,0,4,1,5], "group__CMSIS__RTOS__Message.html#gac9a6a6276c12609793e7701afcc82326":[6,0,4,1,2], "group__CMSIS__RTOS__Message.html#gaf3b9345cf426304d46565152bc26fb78":[6,0,4,1,3], "group__CMSIS__RTOS__MutexMgmt.html":[6,0,4,4], "group__CMSIS__RTOS__MutexMgmt.html#ga006e4744d741e8e132c3d5bbc295afe1":[6,0,4,4,4], "group__CMSIS__RTOS__MutexMgmt.html#ga1122a86faa64b4a0880c76cf68d0c934":[6,0,4,4,0], "group__CMSIS__RTOS__MutexMgmt.html#ga5c9de56e717016e39e788064e9a291cc":[6,0,4,4,2], "group__CMSIS__RTOS__MutexMgmt.html#ga5e1752b73f573ee015dbd9ef1edaba13":[6,0,4,4,5], "group__CMSIS__RTOS__MutexMgmt.html#ga9b522438489d7c402c95332b58bc94f3":[6,0,4,4,1], "group__CMSIS__RTOS__MutexMgmt.html#gac27e24135185d51d18f3dabc20910219":[6,0,4,4,3], "group__CMSIS__RTOS__PoolMgmt.html":[6,0,4,2], "group__CMSIS__RTOS__PoolMgmt.html#ga34af5c4f4ab38f4138ea7f1f9ece3a1a":[6,0,4,2,5], "group__CMSIS__RTOS__PoolMgmt.html#ga4a861e9c469c9d0daf5721bf174f8e54":[6,0,4,2,6], "group__CMSIS__RTOS__PoolMgmt.html#ga5f0b204a82327533d420210125c90697":[6,0,4,2,1], "group__CMSIS__RTOS__PoolMgmt.html#ga87b471d4fe2d5dbd0040708edd52771b":[6,0,4,2,2], "group__CMSIS__RTOS__PoolMgmt.html#ga9f129fcad4730fbd1048ad4fa262f36a":[6,0,4,2,4], "group__CMSIS__RTOS__PoolMgmt.html#gaa0b2994f1a866c19e0d11e6e0d44f543":[6,0,4,2,3], "group__CMSIS__RTOS__PoolMgmt.html#gadd84b683001de327894851b428587caa":[6,0,4,2,0], "group__CMSIS__RTOS__SemaphoreMgmt.html":[6,0,4,5], "group__CMSIS__RTOS__SemaphoreMgmt.html#ga03761ee8d2c3cd4544e18364ab301dac":[6,0,4,5,1], "group__CMSIS__RTOS__SemaphoreMgmt.html#ga7da4c7bfb340779c9fc7b321f5ab3e3a":[6,0,4,5,0], "group__CMSIS__RTOS__SemaphoreMgmt.html#ga97381e8e55cd47cec390bf57c96d6edb":[6,0,4,5,3], "group__CMSIS__RTOS__SemaphoreMgmt.html#ga9e66fe361749071e5ab87826c43c2f1b":[6,0,4,5,2], "group__CMSIS__RTOS__SemaphoreMgmt.html#gab108914997c49e14d8ff1ae0d1988ca0":[6,0,4,5,5], "group__CMSIS__RTOS__SemaphoreMgmt.html#gabae2801ac2c096f6e8c69a264908f595":[6,0,4,5,4], "group__CMSIS__RTOS__SemaphoreMgmt.html#gacc15b0fc8ce1167fe43da33042e62098":[6,0,4,5,6], "group__CMSIS__RTOS__SignalMgmt.html":[6,0,4,0], "group__CMSIS__RTOS__SignalMgmt.html#ga01edde265710d883b6e237d34a6ef4a6":[6,0,4,0,0], "group__CMSIS__RTOS__SignalMgmt.html#ga38860acda96df47da6923348d96fc4c9":[6,0,4,0,3], "group__CMSIS__RTOS__SignalMgmt.html#ga3de2730654589d6c3559c4b9e2825553":[6,0,4,0,2], "group__CMSIS__RTOS__SignalMgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6":[6,0,4,0,1], "group__CMSIS__RTOS__Status.html":[6,0,6], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e":[6,0,6,0], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea15b12e42b42b53f35fb8a2724ad02926":[6,0,6,0,3], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea21635bdc492d3094fe83027fa4a30e2f":[6,0,6,0,8], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea314d24a49003f09459035db0dd7c9467":[6,0,6,0,7], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea4672c8a0c0f6bb1d7981da4602e8e9ee":[6,0,6,0,12], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5df7e9643aa8a2f5f3a6f6ec59758518":[6,0,6,0,1], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea5fde24ff588ec5ab9cb8314bade26fbc":[6,0,6,0,13], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea78f477732375c0e1fca814e369618177":[6,0,6,0,4], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea8fc5801e8b0482bdf22ad63a77f0155d":[6,0,6,0,6], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ea9e1c9e2550bb4de8969a935acffc968f":[6,0,6,0,0], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eab7dda0ef504817659334cbfd650ae56f":[6,0,6,0,10], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eac24adca6a5d072c9f01c32178ba0d109":[6,0,6,0,5], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eac7a77f5fe18a15a357790c36a4aca1b1":[6,0,6,0,14], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99ead604f3673359dd4ac643b16dc5a2c342":[6,0,6,0,2], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eaf1fac0240218e51eb30a13da2f8aae81":[6,0,6,0,11], "group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99eaf6552310a817452aedfcd453f2805d65":[6,0,6,0,9], "group__CMSIS__RTOS__ThreadMgmt.html":[6,0,1], "group__CMSIS__RTOS__ThreadMgmt.html#ga0dfb90ccf1f6e4b54b9251b12d1cbc8b":[6,0,1,6], "group__CMSIS__RTOS__ThreadMgmt.html#ga4299d838978bc2aae5e4350754e6a4e9":[6,0,1,5], "group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a":[6,0,1,2], "group__CMSIS__RTOS__ThreadMgmt.html#gab1df2a28925862ef8f9cf4e1c995c5a7":[6,0,1,4], "group__CMSIS__RTOS__ThreadMgmt.html#gac59b5713cb083702dce759c73fd90dff":[6,0,1,3], "group__CMSIS__RTOS__ThreadMgmt.html#gaea135bb90eb853eff39e0800b91bbeab":[6,0,1,7], "group__CMSIS__RTOS__ThreadMgmt.html#gaee93d929beb350f16e5cc7fa602e229f":[6,0,1,1], "group__CMSIS__RTOS__ThreadMgmt.html#gaf0c7c6b5e09f8be198312144b5c9e453":[6,0,1,0], "group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233":[6,0,1,8], "group__CMSIS__RTOS__TimerMgmt.html":[6,0,3], "group__CMSIS__RTOS__TimerMgmt.html#ga1b8d670eaf964b2910fa06885e650678":[6,0,3,0], "group__CMSIS__RTOS__TimerMgmt.html#ga1c720627e08d1cc1afcad44e799ed492":[6,0,3,1], "group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca":[6,0,3,5], "group__CMSIS__RTOS__TimerMgmt.html#ga58f36b121a812936435cacc6e1e0e091":[6,0,3,6], "group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf":[6,0,3,4], "group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9":[6,0,3,2], "group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ab9c91f9699162edb09bb7c90c11c8788":[6,0,3,2,1], "group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9ad21712f8df5f97069c82dc9eec37b951":[6,0,3,2,0], "group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6":[6,0,3,3], "group__CMSIS__RTOS__Wait.html":[6,0,2], "group__CMSIS__RTOS__Wait.html#ga02e19d5e723bfb06ba9324d625162255":[6,0,2,1], "group__CMSIS__RTOS__Wait.html#ga6c97d38879ae86491628f6e647639bad":[6,0,2,0], "group__CMSIS__RTOS__Wait.html#ga8470c8aaedfde524a44e22e5b2328285":[6,0,2,2], "group__RTX__Global__Functions.html":[6,1], "group__RTX__Global__Functions.html#ga145e7eafdd042bb522020cbb3b469d9c":[6,1,4], "group__RTX__Global__Functions.html#ga1b85a217d43e6b971ffcf24f8aae1c33":[6,1,2], "group__RTX__Global__Functions.html#ga3e9c57746ccbdfe90464ad50513c569e":[6,1,3], "group__RTX__Global__Functions.html#ga567543bf38239a91f09751686c23017b":[6,1,7], "group__RTX__Global__Functions.html#ga651ae76b3acf45f80bf0e0487b51d6e6":[6,1,0], "group__RTX__Global__Functions.html#ga85dab8408f27236c7341a69feb6258c7":[6,1,5], "group__RTX__Global__Functions.html#gad5deddec3fea0fb31798f571afc3c692":[6,1,6], "group__RTX__Global__Functions.html#gafb4dc4d3dff8343a393726d2860282e4":[6,1,1], "index.html":[], "lowPower.html":[5,5,3], "lowPower.html#TickLess":[5,5,3,0], "misraCompliance.html":[5,3], "modules.html":[6], "pages.html":[], "rtosValidation.html":[4], "rtosValidation.html#test_output":[4,0], "rtos_revisionHistory.html":[0], "rtos_revisionHistory.html#GenRTOSRev":[0,0], "rtos_revisionHistory.html#RTXRevisionHistory":[0,1], "rtxImplementation.html":[5], "svcFunctions.html":[5,5,4], "systemConfig.html":[5,5,2], "systemConfig.html#ISRFIFO":[5,5,2,2], "systemConfig.html#RoundRobin":[5,5,2,0], "systemConfig.html#UserTimer":[5,5,2,1], "technicalData.html":[5,2], "technicalData.html#osWait":[5,2,0], "theory.html":[5,0], "theory.html#KernelTimer":[5,0,1], "theory.html#PriorityInversion":[5,0,3], "theory.html#RTX_Threads":[5,0,2], "theory.html#isr_function_calls":[5,0,4], "theory.html#osFeature":[5,0,0], "threadConfig.html":[5,5,0], "threadConfig.html#processorMode":[5,5,0,3], "threadConfig.html#stackCheck":[5,5,0,1], "threadConfig.html#stackConfig":[5,5,0,0], "threadConfig.html#stackUsage":[5,5,0,2], "timerTick.html":[5,5,1], "timerTick.html#AltTimer":[5,5,1,0], "using.html":[5,4], "using.html#DefRefObj":[5,4,0], "using.html#UsingIRQs":[5,4,1], "usingOS.html":[2], "usingOS.html#cmsis_os_h":[2,0] };
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/navtreeindex0.js
JavaScript
apache-2.0
14,011
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Usage and Description</title> <title>CMSIS-RTOS: Usage and Description</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('pages.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Usage and Description</div> </div> </div><!--header--> <div class="contents"> <div class="textblock">Here is a list of all related documentation pages:</div><div class="directory"> <table class="directory"> </table> </div><!-- directory --> </div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/pages.html
HTML
apache-2.0
6,382
var strgURL = location.pathname; // path of current component // constuctor for the array of objects function tabElement(id, folderName, tabTxt ) { this.id = id; // elementID as needed in html; this.folderName = folderName; // folder name of the component this.tabTxt = tabTxt; // Text displayed as menu on the web this.currentListItem = '<li id="' + this.id + '" class="current"> <a href="../..' + this.folderName + 'index.html"><span>' + this.tabTxt + '</span></a></li>'; this.listItem = '<li id="' + this.id + '"> <a href="../..' + this.folderName + 'index.html"><span>' + this.tabTxt + '</span></a></li>'; }; // array of objects var arr = []; // fill array arr.push( new tabElement( "GEN", "/General/html/", "General") ); arr.push( new tabElement( "CORE_A", "/Core_A/html/", "CMSIS-Core(A)") ); arr.push( new tabElement( "CORE_M", "/Core/html/", "CMSIS-Core(M)") ); arr.push( new tabElement( "DRV", "/Driver/html/", "Driver") ); arr.push( new tabElement( "DSP", "/DSP/html/", "DSP") ); arr.push( new tabElement( "NN", "/NN/html/", "NN") ); arr.push( new tabElement( "RTOSv1", "/RTOS/html/", "RTOS v1") ); arr.push( new tabElement( "RTOSv2", "/RTOS2/html/", "RTOS v2") ); arr.push( new tabElement( "PACK", "/Pack/html/", "Pack") ); arr.push( new tabElement( "SVD", "/SVD/html/", "SVD") ); arr.push( new tabElement( "DAP", "/DAP/html/", "DAP") ); arr.push( new tabElement( "ZONE", "/Zone/html/", "Zone") ); // write tabs // called from the header file. function writeComponentTabs() { for ( var i=0; i < arr.length; i++ ) { if (strgURL.search(arr[i].folderName) > 0) { // if this is the current folder document.write(arr[i].currentListItem); // then print and hightlight the tab } else { document.write(arr[i].listItem); // else, print the tab } } };
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/printComponentTabs.js
JavaScript
apache-2.0
2,273
var cookie_namespace = 'doxygen'; var sidenav,navtree,content,header; function readCookie(cookie) { var myCookie = cookie_namespace+"_"+cookie+"="; if (document.cookie) { var index = document.cookie.indexOf(myCookie); if (index != -1) { var valStart = index + myCookie.length; var valEnd = document.cookie.indexOf(";", valStart); if (valEnd == -1) { valEnd = document.cookie.length; } var val = document.cookie.substring(valStart, valEnd); return val; } } return 0; } function writeCookie(cookie, val, expiration) { if (val==undefined) return; if (expiration == null) { var date = new Date(); date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week expiration = date.toGMTString(); } document.cookie = cookie_namespace + "_" + cookie + "=" + val + "; expires=" + expiration+"; path=/"; } function resizeWidth() { var windowWidth = $(window).width() + "px"; var sidenavWidth = $(sidenav).outerWidth(); content.css({marginLeft:parseInt(sidenavWidth)+"px"}); writeCookie('width',sidenavWidth, null); } function restoreWidth(navWidth) { var windowWidth = $(window).width() + "px"; content.css({marginLeft:parseInt(navWidth)+6+"px"}); sidenav.css({width:navWidth + "px"}); } function resizeHeight() { var headerHeight = header.outerHeight(); var footerHeight = footer.outerHeight(); var windowHeight = $(window).height() - headerHeight - footerHeight; content.css({height:windowHeight + "px"}); navtree.css({height:windowHeight + "px"}); sidenav.css({height:windowHeight + "px",top: headerHeight+"px"}); } function initResizable() { header = $("#top"); sidenav = $("#side-nav"); content = $("#doc-content"); navtree = $("#nav-tree"); footer = $("#nav-path"); $(".side-nav-resizable").resizable({resize: function(e, ui) { resizeWidth(); } }); $(window).resize(function() { resizeHeight(); }); var width = readCookie('width'); if (width) { restoreWidth(width); } else { resizeWidth(); } resizeHeight(); var url = location.href; var i=url.indexOf("#"); if (i>=0) window.location.hash=url.substr(i); var _preventDefault = function(evt) { evt.preventDefault(); }; $("#splitbar").bind("dragstart", _preventDefault).bind("selectstart", _preventDefault); $(document).bind('touchmove',function(e){ var device = navigator.userAgent.toLowerCase(); var ios = device.match(/(iphone|ipod|ipad)/); if (ios) { try { var target = e.target; while (target) { if ($(target).css('-webkit-overflow-scrolling')=='touch') return; target = target.parentNode; } e.preventDefault(); } catch(err) { e.preventDefault(); } } }); }
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/resize.js
JavaScript
apache-2.0
2,800
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>RTOS Validation</title> <title>CMSIS-RTOS: RTOS Validation</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('rtosValidation.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">RTOS Validation </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><p>Arm offers a <a href="http://www.keil.com/pack" class="el" target="_blank">Software Pack</a> for the CMSIS-RTOS Validation. The <b>ARM::CMSIS-RTOS_Validation</b> Pack contains the following:</p> <ul> <li>Source code of a CMSIS-RTOS Validation Suite along with configuration file.</li> <li>Documentation of the CMSIS-RTOS Validation Suite.</li> <li>Example that shows the usage of the CMSIS-RTOS Validation Suite using simulation.</li> </ul> <p>The CMSIS-RTOS Validation Suite is currently available in beta release and performs generic validation of various RTOS features. The test cases verify the functional behaviour, test invalid parameters and call management functions from ISR.</p> <p>The following CMSIS-RTOS features can be tested with the current release:</p> <ul> <li>Thread : Create multiple threads, terminate, restart, yield, change priority</li> <li>Timer : Create periodic and one-shot timers</li> <li>GenWait : Call generic wait functions (osDelay and osWait)</li> <li>WaitFunc : Measure wait ticks (delay, mail, message, mutex, semaphore, signal)</li> </ul> <p>Moreover the following inter-thread communication functions can be tested:</p> <ul> <li>Signal : Verify signal events</li> <li>Memory Pool : Verify memory allocation</li> <li>Message Queue : Exchange messages between threads</li> <li>Mail Queue : Exchange data between threads</li> <li>Mutex : Synchronize resource access</li> <li>Semaphore : Access shared resources</li> </ul> <p>The RTOS Validation output can be printed to a console, output via ITM printf, or output to a memory buffer.</p> <h1><a class="anchor" id="test_output"></a> Sample Test Output</h1> <pre class="fragment">CMSIS-RTOS Test Suite Oct 21 2015 16:39:16 TEST 01: TC_ThreadCreate PASSED TEST 02: TC_ThreadMultiInstance PASSED TEST 03: TC_ThreadTerminate PASSED : : TEST 08: TC_ThreadChainedCreate PASSED TEST 09: TC_ThreadYield NOT EXECUTED TEST 10: TC_ThreadParam PASSED : : TEST 60: TC_MailFromISRToThread PASSED Test Summary: 60 Tests, 59 Executed, 59 Passed, 0 Failed, 0 Warnings. Test Result: PASSED </pre> </div></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="index.html">index</a></li> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/rtosValidation.html
HTML
apache-2.0
8,489
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>Revision History</title> <title>CMSIS-RTOS: Revision History</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('rtos_revisionHistory.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">Revision History </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><h1><a class="anchor" id="GenRTOSRev"></a> CMSIS-RTOS API</h1> <table class="cmtable" summary="Revision History"> <tr> <th>Version </th><th>Description </th></tr> <tr> <td>V1.03 - only documentation changes </td><td>Incorporated documentation for reference implementation CMSIS-RTOS RTX. </td></tr> <tr> <td>V1.02 - only documentation changes </td><td>Added: Overview of the <a class="el" href="rtosValidation.html">CMSIS-RTOS Validation</a> Software Pack.<br/> Clarified: Behaviour of <a class="el" href="functionOverview.html#CMSIS_RTOS_TimeOutValue">Timout Value</a>. </td></tr> <tr> <td>V1.02 </td><td>Added: New control functions for short timeouts in microsecond resolution <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001">osKernelSysTick</a>, <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960">osKernelSysTickFrequency</a>, <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88">osKernelSysTickMicroSec</a>.<br/> Removed: osSignalGet. </td></tr> <tr> <td>V1.01 </td><td>Added capabilities for C++, kernel initialization and object deletion.<br/> Prepared for C++ class interface. In this context to <em>const</em> attribute has been moved from osXxxxDef_t typedefs to the osXxxxDef macros.<br/> Added: <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf">osTimerDelete</a>, <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#gac27e24135185d51d18f3dabc20910219">osMutexDelete</a>, <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gabae2801ac2c096f6e8c69a264908f595">osSemaphoreDelete</a>.<br/> Added: <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> that prepares the Kernel for object creation.<br/> </td></tr> <tr> <td>V1.00 </td><td>First official Release.<br/> Added: <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a>; starting 'main' as a thread is now an optional feature.<br/> Semaphores have now the standard behavior.<br/> <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> does no longer start the timer. Added: <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga27a797a401b068e2644d1125f22a07ca">osTimerStart</a> (replaces osTimerRestart).<br/> Changed: osThreadPass is renamed to <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gaf13a667493c5d629a90c13e113b99233">osThreadYield</a>. </td></tr> <tr> <td>V0.02 </td><td>Preview Release. </td></tr> </table> <h1><a class="anchor" id="RTXRevisionHistory"></a> CMSIS-RTOS RTX</h1> <table class="cmtable" summary="Revision History"> <tr> <th>Version </th><th>Description </th></tr> <tr> <td>V4.82 </td><td>Corrected: Recursive Mutex 16-bit lock counter is now checked to not overflow.<br/> </td></tr> <tr> <td>V4.81 </td><td>Added provisions for Arm Compiler 6.<br/> Corrected: Message Queue behavior when osMessagePut timed out due to full queue and osMessageGet was called from ISR.<br/> </td></tr> <tr> <td>V4.80 </td><td>Restored time delay parameter 'millisec' old behavior (before V4.79) for software compatibility.<br/> Corrected: implicit mutex release when mutex owner thread is terminated.<br/> </td></tr> <tr> <td>V4.79 </td><td>Corrected: time delay parameter ‘millisec’ in all functions (osDelay, osSignalWait, …) is now treated as lower bound – wait for at least time given (before it could have been up to 1ms less).<br/> Corrected: Lazy Context switching for Cortex-M4 with FPU could lead to a crash when thread which used FPU was terminated.<br/> Corrected: osMailCAlloc only cleared the allocated memory block if it was available without waiting.<br/> Corrected: osThreadCreate function returns NULL when trying to create more concurrent threads than defined in the configuration.<br/> Improved source code MISRA compliance.<br/> </td></tr> <tr> <td>V4.78 </td><td>Corrected: osTimerStart function accepts full 32-bit range for time delay value in milisec.<br/> Added: User Timer Callback Queue overflow reported through os_error(OS_ERROR_TIMER_OVF).<br/> </td></tr> <tr> <td>V4.77 </td><td>Added: Stack usage watermark.<br/> </td></tr> <tr> <td>V4.76 </td><td>Optimized Service calls in GCC libraries.<br/> Corrected: Stack/Heap regions can be used with scatter loading.<br/> </td></tr> <tr> <td>V4.75 </td><td>Corrected: Service calls for Cortex-M4 with Floating Point for GCC.<br/> Corrected: <a class="el" href="group__CMSIS__RTOS__SignalMgmt.html#ga87283a6ebc31ce9ed42baf3ea7e4eab6">osSignalClear</a> returns 0x80000000 when called from interrupt service routines.<br/> Corrected: C standard library memory functions (malloc, free, ...) can be called between calls to <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> and <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a>.<br/> Corrected: Interrupt Priority Group can be configured between calls to <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> and <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a>.<br/> </td></tr> <tr> <td>V4.74 </td><td>Corrected: <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> and <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a> when called from main which is already a thread.<br/> </td></tr> <tr> <td>V4.73 </td><td>Corrected: mutex priority inversion when thread owns more than one mutex.<br/> Added: RTX extensions os_suspend and os_resume.<br/> Added: RTX os_error template. </td></tr> <tr> <td>V4.72 </td><td>Corrected: object initialization when defined inside function (allocated on stack and not as static memory). </td></tr> <tr> <td>V4.71 </td><td>Corrected: osMailFree behaviour when osMailAlloc timed out. </td></tr> <tr> <td>V4.70 </td><td>Added: New control functions for short timeouts in microsecond resolution <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gad0262e4688e95d1e9038afd9bcc16001">osKernelSysTick</a>, <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga9e0954d52722673e2031233a2ab99960">osKernelSysTickFrequency</a>, <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gae12c190af42d7310d8006d64f4ed5a88">osKernelSysTickMicroSec</a>.<br/> Removed: osSignalGet. </td></tr> <tr> <td>V4.61 </td><td>Enhanced: <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#gaedd312bfdca04e0b8162b666e09a1ae6">osTimerCreate</a> can now be called after <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> (before only after <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#gaab668ffd2ea76bb0a77ab0ab385eaef2">osKernelStart</a>).<br/> Corrected: Initialization of alternative kernel timer for Cortex-M0/M0+/M1 (when SysTick timer is not used).<br/> Corrected: Message/Mail Queue behavior when timeout expires. </td></tr> <tr> <td>V4.51 </td><td>Corrected: problem with <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> when after the call high priority threads are defined. </td></tr> <tr> <td>V4.50 </td><td>Based on CMSIS-RTOS API Version 1.01 and the classic RTX V4.50 Kernel.<br/> Added: <a class="el" href="group__CMSIS__RTOS__TimerMgmt.html#ga746b8043d906849bd65e3900fcb483cf">osTimerDelete</a>, <a class="el" href="group__CMSIS__RTOS__MutexMgmt.html#gac27e24135185d51d18f3dabc20910219">osMutexDelete</a>, <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html#gabae2801ac2c096f6e8c69a264908f595">osSemaphoreDelete</a>.<br/> Added: <a class="el" href="group__CMSIS__RTOS__KernelCtrl.html#ga53d078a801022e202e8115c083ece68e">osKernelInitialize</a> that prepares the Kernel for object creation.<br/> Added: support for Low Power Cortex-M applications based on new configuration functions: <b>os_suspend</b>, <b>os_resume</b>.<br/> Added: support for peripheral timer to be used as OS tick timer instead of Core SysTick timer.<br/> Corrected: stack checking did not work for os_tsk_delete_self function Preview Release. </td></tr> <tr> <td>V4.20 </td><td>Initial CMSIS-RTOS adaption of the RTX Kernel. </td></tr> </table> </div></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="index.html">index</a></li> <li class="footer">Generated on Wed Jul 10 2019 15:21:01 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/rtos_revisionHistory.html
HTML
apache-2.0
14,924
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/> <title>RTX Implementation</title> <title>CMSIS-RTOS: RTX Implementation</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="cmsis.css" rel="stylesheet" type="text/css" /> <script type="text/javascript" src="jquery.js"></script> <script type="text/javascript" src="dynsections.js"></script> <script type="text/javascript" src="printComponentTabs.js"></script> <link href="navtree.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="resize.js"></script> <script type="text/javascript" src="navtree.js"></script> <script type="text/javascript"> $(document).ready(initResizable); $(window).load(resizeHeight); </script> <link href="search/search.css" rel="stylesheet" type="text/css"/> <script type="text/javascript" src="search/search.js"></script> <script type="text/javascript"> $(document).ready(function() { searchBox.OnSelectItem(0); }); </script> </head> <body> <div id="top"><!-- do not remove this div, it is closed by doxygen! --> <div id="titlearea"> <table cellspacing="0" cellpadding="0"> <tbody> <tr style="height: 46px;"> <td id="projectlogo"><img alt="Logo" src="CMSIS_Logo_Final.png"/></td> <td style="padding-left: 0.5em;"> <div id="projectname">CMSIS-RTOS &#160;<span id="projectnumber">Version 1.03</span> </div> <div id="projectbrief">Real-Time Operating System: API and RTX Reference Implementation.</div> </td> </tr> </tbody> </table> </div> <!-- end header part --> <div id="CMSISnav" class="tabs1"> <ul class="tablist"> <script type="text/javascript"> <!-- writeComponentTabs.call(this); //--> </script> </ul> </div> <!-- Generated by Doxygen 1.8.6 --> <script type="text/javascript"> var searchBox = new SearchBox("searchBox", "search",false,'Search'); </script> <div id="navrow1" class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main&#160;Page</span></a></li> <li class="current"><a href="pages.html"><span>Usage&#160;and&#160;Description</span></a></li> <li><a href="modules.html"><span>Reference</span></a></li> <li> <div id="MSearchBox" class="MSearchBoxInactive"> <span class="left"> <img id="MSearchSelect" src="search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/> <input type="text" id="MSearchField" value="Search" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/> </span><span class="right"> <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a> </span> </div> </li> </ul> </div> </div><!-- top --> <div id="side-nav" class="ui-resizable side-nav-resizable"> <div id="nav-tree"> <div id="nav-tree-contents"> <div id="nav-sync" class="sync"></div> </div> </div> <div id="splitbar" style="-moz-user-select:none;" class="ui-resizable-handle"> </div> </div> <script type="text/javascript"> $(document).ready(function(){initNavTree('rtxImplementation.html','');}); </script> <div id="doc-content"> <!-- window showing the filter options --> <div id="MSearchSelectWindow" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" onkeydown="return searchBox.OnSearchSelectKey(event)"> <a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div> <!-- iframe showing the search results (closed by default) --> <div id="MSearchResultsWindow"> <iframe src="javascript:void(0)" frameborder="0" name="MSearchResults" id="MSearchResults"> </iframe> </div> <div class="header"> <div class="headertitle"> <div class="title">RTX Implementation </div> </div> </div><!--header--> <div class="contents"> <div class="textblock"><p>This version of RTX implements the CMSIS-RTOS API, which is a generic RTOS interface for Cortex-M processor-based devices. The CMSIS-RTOS API provides a standardized interface for software components that require RTOS functionality. This RTX implementation gives therefore serious benefits to the users and the software industry.</p> <ul> <li>The unified feature set of the CMSIS-RTOS API simplifies sharing of software components and reduces learning efforts.</li> <li>Middleware components that use the CMSIS-RTOS API are RTOS agnostic and CMSIS-RTOS compliant middleware is easier to adapt.</li> <li>This RTX implementation is available under the Apache-2.0 license and can be freely distributed with project templates.</li> </ul> <p>The CMSIS-RTOS RTX manages the resources of the microcontroller system and implements the concept of parallel threads that run concurrently. There are many advantages of using the CMSIS-RTOS RTX kernel.</p> <p>Applications frequently require several concurrent activities. RTX can manage multiple concurrent activities at the time when they are needed. Each activity gets a separate thread which executes a specific task and this simplifies the overall program structure. The CMSIS-RTOS RTX system is scalable and additional threads can be added easily at a later time. Threads have a priority allowing faster execution of time-critical parts of an user application.</p> <p>The CMSIS-RTOS RTX offers services needed in many real-time applications, for example, periodical activation of timer functions, memory management, and message exchange between threads with time limits.</p> <div class="image"> <img src="RTX_Structure.png" alt="RTX_Structure.png"/> <div class="caption"> CMSIS-RTOS RTX Structure</div></div> <p> Compared to the classic Keil RTX version, the CMSIS-RTOS RTX library is extended with the CMSIS API interface module (source file rt_cmsis.c) which implements the function translation. The header file <a class="el" href="cmsis__os_8h.html">cmsis_os.h</a> provides the API to the CMSIS-RTOS RTX for the user application. Refer to <a class="el" href="using.html">Create an RTX Project</a> for more information.</p> <p>CMSIS-RTOS RTX has several options that are configured with the <a class="el" href="dirstructfiles.html#RTX_Conf_CM">RTX_Conf_CM.c</a> file. Refer to <a class="el" href="configure.html">Configure RTX</a> for more information.</p> <p>Attributes of the CMSIS-RTOS RTX implementation:</p> <ul> <li>Provides the complete functions specified for a CMSIS-RTOS with the exception of the function <a class="el" href="technicalData.html#osWait">osWait</a>.</li> <li>Interrupt Service Routines (ISR) <a class="el" href="theory.html#isr_function_calls">may call some CMSIS-RTOS RTX functions</a>.</li> <li>Configurations options for Thread Stack. Refer to <a class="el" href="threadConfig.html">Thread Configuration</a> for more information.</li> <li>Fully deterministic context switching and deadlock avoidance. Refer to <a class="el" href="theory.html#PriorityInversion">Priority Inversion on Resource Sharing</a> for more information.</li> <li>Optional Round-Robin Thread switching with configurable time-slices. Refer to <a class="el" href="threadConfig.html">Thread Configuration</a> for more information.</li> </ul> <p>The following sections provide further details:</p> <ul> <li><a class="el" href="theory.html">Theory of Operation</a> : provides general information about the operation of CMSIS-RTOS RTX.</li> <li><a class="el" href="dirstructfiles.html">Directory Structure and File Overview</a> : explains the directories and files that are supplied as part of CMSIS-RTOS RTX.</li> <li><a class="el" href="technicalData.html">Technical Data</a> : lists hardware requirements and limitations such as number of concurrent threads.</li> <li><a class="el" href="misraCompliance.html">MISRA-C:2004 Compliance Exceptions</a> : describes the violations to the MISRA standard.</li> <li><a class="el" href="using.html">Create an RTX Project</a> : Provides instructions for writing and debugging applications with CMSIS-RTOS RTX.</li> <li><a class="el" href="configure.html">Configure RTX</a> : Describes configuration parameters of CMSIS-RTOS RTX.</li> <li><a class="el" href="exampleRTX_Tutorial.html">RTX Tutorial</a> : Is an in-depth tutorial that can be used with any hardware to get a better understanding of the concepts and use cases of a real-time operating system.</li> <li><a class="el" href="creating_RTX_LIB.html">Building the RTX Library</a> : Describes how to build your own CMSIS-RTOS RTX library. </li> </ul> </div></div><!-- contents --> </div><!-- doc-content --> <!-- start footer part --> <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> <ul> <li class="navelem"><a class="el" href="index.html">index</a></li> <li class="footer">Generated on Wed Jul 10 2019 15:21:02 for CMSIS-RTOS Version 1.03 by Arm Ltd. All rights reserved. <!-- <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.6 --> </li> </ul> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/rtxImplementation.html
HTML
apache-2.0
10,913
var rtxImplementation = [ [ "Theory of Operation", "theory.html", [ [ "Settings for osFeature_xxx in cmsis_os.h", "theory.html#osFeature", null ], [ "RTX Kernel Timer Tick and Thread Management", "theory.html#KernelTimer", null ], [ "CMSIS-RTOS RTX Threads", "theory.html#RTX_Threads", null ], [ "Priority Inversion on Resource Sharing", "theory.html#PriorityInversion", null ], [ "Function calls from Interrupt Service Routines (ISR)", "theory.html#isr_function_calls", null ] ] ], [ "Directory Structure and File Overview", "dirstructfiles.html", [ [ "CMSIS-RTOS RTX Directory Structure", "dirstructfiles.html#Folders", null ], [ "CMSIS-RTOS RTX Library Files", "dirstructfiles.html#libFiles", null ], [ "Configuration File RTX_Conf_CM.c", "dirstructfiles.html#RTX_Conf_CM", null ] ] ], [ "Technical Data", "technicalData.html", [ [ "osWait", "technicalData.html#osWait", null ] ] ], [ "MISRA-C:2004 Compliance Exceptions", "misraCompliance.html", null ], [ "Create an RTX Project", "using.html", [ [ "Define and Reference Object Definitions", "using.html#DefRefObj", null ], [ "Using IRQ Interrupts", "using.html#UsingIRQs", null ] ] ], [ "Configure RTX", "configure.html", "configure" ], [ "RTX Tutorial", "exampleRTX_Tutorial.html", null ], [ "Building the RTX Library", "creating_RTX_LIB.html", null ] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/rtxImplementation.js
JavaScript
apache-2.0
1,424
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_0.html
HTML
apache-2.0
1,011
var searchData= [ ['building_20the_20rtx_20library',['Building the RTX Library',['../creating_RTX_LIB.html',1,'rtxImplementation']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_0.js
JavaScript
apache-2.0
138
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_1.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_1.html
HTML
apache-2.0
1,011
var searchData= [ ['cmsis_5fos_2eh',['cmsis_os.h',['../cmsis__os_8h.html',1,'']]], ['cmsis_5fos_2etxt',['cmsis_os.txt',['../cmsis__os_8txt.html',1,'']]], ['cmsis_5fos_5frtx_5fextensions_2eh',['cmsis_os_rtx_extensions.h',['../cmsis__os__rtx__extensions_8h.html',1,'']]], ['cmsis_2drtos_20api',['CMSIS-RTOS API',['../group__CMSIS__RTOS.html',1,'']]], ['configure_20rtx',['Configure RTX',['../configure.html',1,'rtxImplementation']]], ['configuration_20for_20low_2dpower_20modes',['Configuration for Low-Power Modes',['../lowPower.html',1,'configure']]], ['create_20an_20rtx_20project',['Create an RTX Project',['../using.html',1,'rtxImplementation']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_1.js
JavaScript
apache-2.0
667
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_2.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_2.html
HTML
apache-2.0
1,011
var searchData= [ ['def',['def',['../group__CMSIS__RTOS__Definitions.html#a596b6d55c3321db19239256bbe403df6',1,'osEvent']]], ['directory_20structure_20and_20file_20overview',['Directory Structure and File Overview',['../dirstructfiles.html',1,'rtxImplementation']]], ['dummy',['dummy',['../cmsis__os_8h.html#a44b7a3baf02bac7ad707e8f2f5eca1ca',1,'osMutexDef_t::dummy()'],['../cmsis__os_8h.html#a44b7a3baf02bac7ad707e8f2f5eca1ca',1,'osSemaphoreDef_t::dummy()']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_2.js
JavaScript
apache-2.0
470
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_3.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_3.html
HTML
apache-2.0
1,011
var searchData= [ ['function_20overview',['Function Overview',['../functionOverview.html',1,'index']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_3.js
JavaScript
apache-2.0
108
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_4.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_4.html
HTML
apache-2.0
1,011
var searchData= [ ['generic_20data_20types_20and_20definitions',['Generic Data Types and Definitions',['../group__CMSIS__RTOS__Definitions.html',1,'']]], ['generic_20wait_20functions',['Generic Wait Functions',['../group__CMSIS__RTOS__Wait.html',1,'']]], ['generic_20rtos_20interface',['Generic RTOS Interface',['../genRTOSIF.html',1,'index']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_4.js
JavaScript
apache-2.0
354
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_5.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_5.html
HTML
apache-2.0
1,011
var searchData= [ ['inter_2dthread_20communication_20and_20resource_20sharing',['Inter-Thread Communication and Resource Sharing',['../group__CMSIS__RTOS__InterThread.html',1,'']]], ['instances',['instances',['../cmsis__os_8h.html#aa4c4115851a098c0b87358ab6c025603',1,'osThreadDef_t']]], ['item_5fsz',['item_sz',['../cmsis__os_8h.html#a4c2a0c691de3365c00ecd22d8102811f',1,'osPoolDef_t::item_sz()'],['../cmsis__os_8h.html#a4c2a0c691de3365c00ecd22d8102811f',1,'osMessageQDef_t::item_sz()'],['../cmsis__os_8h.html#a4c2a0c691de3365c00ecd22d8102811f',1,'osMailQDef_t::item_sz()']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_5.js
JavaScript
apache-2.0
586
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_6.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_6.html
HTML
apache-2.0
1,011
var searchData= [ ['kernel_20information_20and_20control',['Kernel Information and Control',['../group__CMSIS__RTOS__KernelCtrl.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_6.js
JavaScript
apache-2.0
147
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_7.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_7.html
HTML
apache-2.0
1,011
var searchData= [ ['mail_20queue',['Mail Queue',['../group__CMSIS__RTOS__Mail.html',1,'']]], ['message_20queue',['Message Queue',['../group__CMSIS__RTOS__Message.html',1,'']]], ['mutexes',['Mutexes',['../group__CMSIS__RTOS__MutexMgmt.html',1,'']]], ['memory_20pool',['Memory Pool',['../group__CMSIS__RTOS__PoolMgmt.html',1,'']]], ['misra_2dc_3a2004_20compliance_20exceptions',['MISRA-C:2004 Compliance Exceptions',['../misraCompliance.html',1,'rtxImplementation']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_7.js
JavaScript
apache-2.0
479
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_8.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_8.html
HTML
apache-2.0
1,011
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_9.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_9.html
HTML
apache-2.0
1,011
var searchData= [ ['pool',['pool',['../cmsis__os_8h.html#a269c3935f8bc66db70bccdd02cb05e3c',1,'osPoolDef_t::pool()'],['../cmsis__os_8h.html#a269c3935f8bc66db70bccdd02cb05e3c',1,'osMessageQDef_t::pool()'],['../cmsis__os_8h.html#a269c3935f8bc66db70bccdd02cb05e3c',1,'osMailQDef_t::pool()']]], ['pool_5fsz',['pool_sz',['../cmsis__os_8h.html#ac112e786b2a234e0e45cb5bdbee53763',1,'osPoolDef_t']]], ['pthread',['pthread',['../cmsis__os_8h.html#ad3c9624ee214329fb34e71f544a6933e',1,'osThreadDef_t']]], ['ptimer',['ptimer',['../cmsis__os_8h.html#a15773df83aba93f8e61f3737af5fae47',1,'osTimerDef_t']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_9.js
JavaScript
apache-2.0
604
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_a.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_a.html
HTML
apache-2.0
1,011
var searchData= [ ['queue_5fsz',['queue_sz',['../cmsis__os_8h.html#a8a83a3a8c0aa8057b13807d2a54077e0',1,'osMessageQDef_t::queue_sz()'],['../cmsis__os_8h.html#a8a83a3a8c0aa8057b13807d2a54077e0',1,'osMailQDef_t::queue_sz()']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_a.js
JavaScript
apache-2.0
230
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_b.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_b.html
HTML
apache-2.0
1,011
var searchData= [ ['rtx_20tutorial',['RTX Tutorial',['../exampleRTX_Tutorial.html',1,'rtxImplementation']]], ['revision_20history',['Revision History',['../rtos_revisionHistory.html',1,'index']]], ['rtos_20validation',['RTOS Validation',['../rtosValidation.html',1,'index']]], ['rtx_5fconf_5fcm_2ec',['RTX_Conf_CM.c',['../RTX__Conf__CM_8c.html',1,'']]], ['rtx_20specific_20functions',['RTX Specific Functions',['../group__RTX__Global__Functions.html',1,'']]], ['rtx_20implementation',['RTX Implementation',['../rtxImplementation.html',1,'index']]], ['rtx_20kernel_20tick_20timer_20configuration',['RTX Kernel Tick Timer Configuration',['../timerTick.html',1,'configure']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_b.js
JavaScript
apache-2.0
690
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_c.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_c.html
HTML
apache-2.0
1,011
var searchData= [ ['semaphores',['Semaphores',['../group__CMSIS__RTOS__SemaphoreMgmt.html',1,'']]], ['signal_20events',['Signal Events',['../group__CMSIS__RTOS__SignalMgmt.html',1,'']]], ['status_20and_20error_20codes',['Status and Error Codes',['../group__CMSIS__RTOS__Status.html',1,'']]], ['stacksize',['stacksize',['../cmsis__os_8h.html#a950b7f81ad4711959517296e63bc79d1',1,'osThreadDef_t']]], ['status',['status',['../group__CMSIS__RTOS__Definitions.html#ad477a289f1f03ac45407b64268d707d3',1,'osEvent']]], ['svc_20functions',['SVC Functions',['../svcFunctions.html',1,'configure']]], ['svcthreadgetid',['svcThreadGetId',['../RTX__Conf__CM_8c.html#a395cca131b7746fc43c104a3485b77f7',1,'RTX_Conf_CM.c']]], ['system_20configuration',['System Configuration',['../systemConfig.html',1,'configure']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_c.js
JavaScript
apache-2.0
819
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_d.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_d.html
HTML
apache-2.0
1,011
var searchData= [ ['thread_20management',['Thread Management',['../group__CMSIS__RTOS__ThreadMgmt.html',1,'']]], ['timer_20management',['Timer Management',['../group__CMSIS__RTOS__TimerMgmt.html',1,'']]], ['technical_20data',['Technical Data',['../technicalData.html',1,'rtxImplementation']]], ['theory_20of_20operation',['Theory of Operation',['../theory.html',1,'rtxImplementation']]], ['thread_20configuration',['Thread Configuration',['../threadConfig.html',1,'configure']]], ['tpriority',['tpriority',['../cmsis__os_8h.html#a15da8f23c6fe684b70a73646ada685e7',1,'osThreadDef_t']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_d.js
JavaScript
apache-2.0
600
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_e.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_e.html
HTML
apache-2.0
1,011
var searchData= [ ['using_20a_20cmsis_2drtos_20implementation',['Using a CMSIS-RTOS Implementation',['../usingOS.html',1,'index']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_e.js
JavaScript
apache-2.0
137
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="all_f.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_f.html
HTML
apache-2.0
1,011
var searchData= [ ['value',['value',['../group__CMSIS__RTOS__Definitions.html#a0b9f8fd3645f01d8cb09cae82add2d7f',1,'osEvent']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/all_f.js
JavaScript
apache-2.0
133
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="classes_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/classes_0.html
HTML
apache-2.0
1,015
var searchData= [ ['os_5fmailq',['os_mailQ',['../group__CMSIS__RTOS__Definitions.html#structos__mailQ',1,'']]], ['osevent',['osEvent',['../group__CMSIS__RTOS__Definitions.html#structosEvent',1,'']]], ['osevent_2edef',['osEvent.def',['../group__CMSIS__RTOS__Definitions.html#unionosEvent_8def',1,'']]], ['osevent_2evalue',['osEvent.value',['../group__CMSIS__RTOS__Definitions.html#unionosEvent_8value',1,'']]], ['osmailqdef_5ft',['osMailQDef_t',['../cmsis__os_8h.html#structosMailQDef__t',1,'']]], ['osmessageqdef_5ft',['osMessageQDef_t',['../cmsis__os_8h.html#structosMessageQDef__t',1,'']]], ['osmutexdef_5ft',['osMutexDef_t',['../cmsis__os_8h.html#structosMutexDef__t',1,'']]], ['ospooldef_5ft',['osPoolDef_t',['../cmsis__os_8h.html#structosPoolDef__t',1,'']]], ['ossemaphoredef_5ft',['osSemaphoreDef_t',['../cmsis__os_8h.html#structosSemaphoreDef__t',1,'']]], ['osthreaddef_5ft',['osThreadDef_t',['../cmsis__os_8h.html#structosThreadDef__t',1,'']]], ['ostimerdef_5ft',['osTimerDef_t',['../cmsis__os_8h.html#structosTimerDef__t',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/classes_0.js
JavaScript
apache-2.0
1,064
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="defines_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/defines_0.html
HTML
apache-2.0
1,015
var searchData= [ ['os_5fclock',['OS_CLOCK',['../RTX__Conf__CM_8c.html#adff23afdf544a322a38314870f8848b9',1,'RTX_Conf_CM.c']]], ['os_5ferror_5ffifo_5fovf',['OS_ERROR_FIFO_OVF',['../RTX__Conf__CM_8c.html#a075d54df14c85a6afe32b7f5c99c9c29',1,'RTX_Conf_CM.c']]], ['os_5ferror_5fmbx_5fovf',['OS_ERROR_MBX_OVF',['../RTX__Conf__CM_8c.html#ab715d7d66c341c067ef0a97b55db8a10',1,'RTX_Conf_CM.c']]], ['os_5ferror_5fstack_5fovf',['OS_ERROR_STACK_OVF',['../RTX__Conf__CM_8c.html#abf8311a7a239ec56c6d725f926ba766d',1,'RTX_Conf_CM.c']]], ['os_5ferror_5ftimer_5fovf',['OS_ERROR_TIMER_OVF',['../RTX__Conf__CM_8c.html#a79d7e388d951f11bd0dabd13f722cea8',1,'RTX_Conf_CM.c']]], ['os_5ffifosz',['OS_FIFOSZ',['../RTX__Conf__CM_8c.html#a93c8e36d441750016f9f72e102f68d66',1,'RTX_Conf_CM.c']]], ['os_5fmainstksize',['OS_MAINSTKSIZE',['../RTX__Conf__CM_8c.html#a95362a96f44d4314f148ae24edd52f7c',1,'RTX_Conf_CM.c']]], ['os_5fmutexcnt',['OS_MUTEXCNT',['../RTX__Conf__CM_8c.html#ad11cf133eea28b601f9a63cd9af9b786',1,'RTX_Conf_CM.c']]], ['os_5fprivcnt',['OS_PRIVCNT',['../RTX__Conf__CM_8c.html#a7cfcbf2c4f9d0a63424a2a48592955b1',1,'RTX_Conf_CM.c']]], ['os_5fprivstksize',['OS_PRIVSTKSIZE',['../RTX__Conf__CM_8c.html#a6e0d30986e4ae0df44f449a4b3b0fbec',1,'RTX_Conf_CM.c']]], ['os_5frobin',['OS_ROBIN',['../RTX__Conf__CM_8c.html#ae34f3058383d9fa9280bbf595618ab0a',1,'RTX_Conf_CM.c']]], ['os_5frobintout',['OS_ROBINTOUT',['../RTX__Conf__CM_8c.html#ad89fdd7232cfba74d400080b6bcc0012',1,'RTX_Conf_CM.c']]], ['os_5frunpriv',['OS_RUNPRIV',['../RTX__Conf__CM_8c.html#a786924d58be54e943a7e73458cebc51b',1,'RTX_Conf_CM.c']]], ['os_5fstkcheck',['OS_STKCHECK',['../RTX__Conf__CM_8c.html#a6ef9e00396f881f0fa9ac877150e5962',1,'RTX_Conf_CM.c']]], ['os_5fstkinit',['OS_STKINIT',['../RTX__Conf__CM_8c.html#ac820623da739e4219ee86f15bdcd9752',1,'RTX_Conf_CM.c']]], ['os_5fstksize',['OS_STKSIZE',['../RTX__Conf__CM_8c.html#a16495c133349f3e7c27ac933857c1a8c',1,'RTX_Conf_CM.c']]], ['os_5ftaskcnt',['OS_TASKCNT',['../RTX__Conf__CM_8c.html#a309353d912327b7f4a2300711ee1b349',1,'RTX_Conf_CM.c']]], ['os_5ftick',['OS_TICK',['../RTX__Conf__CM_8c.html#ab6b10bd6d60e95ab28c775757f6bfbcc',1,'RTX_Conf_CM.c']]], ['os_5ftimercbqs',['OS_TIMERCBQS',['../RTX__Conf__CM_8c.html#a29701cff84a42494279367ad018f252d',1,'RTX_Conf_CM.c']]], ['os_5ftimerprio',['OS_TIMERPRIO',['../RTX__Conf__CM_8c.html#a90af874f1df4dfb0f8821cc2d860dae6',1,'RTX_Conf_CM.c']]], ['os_5ftimers',['OS_TIMERS',['../RTX__Conf__CM_8c.html#a23b0f1095632e58b5ac0d8f7dcfdfded',1,'RTX_Conf_CM.c']]], ['os_5ftimerstksz',['OS_TIMERSTKSZ',['../RTX__Conf__CM_8c.html#a76d1b01799981a753fc528e600015627',1,'RTX_Conf_CM.c']]], ['os_5ftrv',['OS_TRV',['../RTX__Conf__CM_8c.html#a9d55a070ddb219165bd4287f08318d51',1,'RTX_Conf_CM.c']]], ['oswaitforever',['osWaitForever',['../cmsis__os_8h.html#a9eb9a7a797a42e4b55eb171ecc609ddb',1,'cmsis_os.h']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/defines_0.js
JavaScript
apache-2.0
2,887
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="enums_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/enums_0.html
HTML
apache-2.0
1,013
var searchData= [ ['os_5ftimer_5ftype',['os_timer_type',['../group__CMSIS__RTOS__TimerMgmt.html#gadac860eb9e1b4b0619271e6595ed83d9',1,'os_timer_type():&#160;cmsis_os.txt'],['../cmsis__os_8h.html#adac860eb9e1b4b0619271e6595ed83d9',1,'os_timer_type():&#160;cmsis_os.h']]], ['ospriority',['osPriority',['../group__CMSIS__RTOS__ThreadMgmt.html#ga7f2b42f1983b9107775ec2a1c69a849a',1,'cmsis_os.h']]], ['osstatus',['osStatus',['../group__CMSIS__RTOS__Status.html#gae2e091fefc4c767117727bd5aba4d99e',1,'osStatus():&#160;cmsis_os.txt'],['../cmsis__os_8h.html#ae2e091fefc4c767117727bd5aba4d99e',1,'osStatus():&#160;cmsis_os.h']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/enums_0.js
JavaScript
apache-2.0
629
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="enumvalues_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/enumvalues_0.html
HTML
apache-2.0
1,018
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="files_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/files_0.html
HTML
apache-2.0
1,013
var searchData= [ ['cmsis_5fos_2eh',['cmsis_os.h',['../cmsis__os_8h.html',1,'']]], ['cmsis_5fos_2etxt',['cmsis_os.txt',['../cmsis__os_8txt.html',1,'']]], ['cmsis_5fos_5frtx_5fextensions_2eh',['cmsis_os_rtx_extensions.h',['../cmsis__os__rtx__extensions_8h.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/files_0.js
JavaScript
apache-2.0
278
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="files_1.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/files_1.html
HTML
apache-2.0
1,013
var searchData= [ ['rtx_5fconf_5fcm_2ec',['RTX_Conf_CM.c',['../RTX__Conf__CM_8c.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/files_1.js
JavaScript
apache-2.0
99
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="functions_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/functions_0.html
HTML
apache-2.0
1,017
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="functions_1.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/functions_1.html
HTML
apache-2.0
1,017
var searchData= [ ['svcthreadgetid',['svcThreadGetId',['../RTX__Conf__CM_8c.html#a395cca131b7746fc43c104a3485b77f7',1,'RTX_Conf_CM.c']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/functions_1.js
JavaScript
apache-2.0
142
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="groups_0.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_0.html
HTML
apache-2.0
1,014
var searchData= [ ['cmsis_2drtos_20api',['CMSIS-RTOS API',['../group__CMSIS__RTOS.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_0.js
JavaScript
apache-2.0
101
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="groups_1.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_1.html
HTML
apache-2.0
1,014
var searchData= [ ['generic_20data_20types_20and_20definitions',['Generic Data Types and Definitions',['../group__CMSIS__RTOS__Definitions.html',1,'']]], ['generic_20wait_20functions',['Generic Wait Functions',['../group__CMSIS__RTOS__Wait.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_1.js
JavaScript
apache-2.0
261
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="groups_2.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_2.html
HTML
apache-2.0
1,014
var searchData= [ ['inter_2dthread_20communication_20and_20resource_20sharing',['Inter-Thread Communication and Resource Sharing',['../group__CMSIS__RTOS__InterThread.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_2.js
JavaScript
apache-2.0
186
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="groups_3.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_3.html
HTML
apache-2.0
1,014
var searchData= [ ['kernel_20information_20and_20control',['Kernel Information and Control',['../group__CMSIS__RTOS__KernelCtrl.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_3.js
JavaScript
apache-2.0
147
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="groups_4.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_4.html
HTML
apache-2.0
1,014
var searchData= [ ['mail_20queue',['Mail Queue',['../group__CMSIS__RTOS__Mail.html',1,'']]], ['message_20queue',['Message Queue',['../group__CMSIS__RTOS__Message.html',1,'']]], ['mutexes',['Mutexes',['../group__CMSIS__RTOS__MutexMgmt.html',1,'']]], ['memory_20pool',['Memory Pool',['../group__CMSIS__RTOS__PoolMgmt.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_4.js
JavaScript
apache-2.0
340
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html><head><title></title> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta name="generator" content="Doxygen 1.8.6"> <link rel="stylesheet" type="text/css" href="search.css"/> <script type="text/javascript" src="groups_5.js"></script> <script type="text/javascript" src="search.js"></script> </head> <body class="SRPage"> <div id="SRIndex"> <div class="SRStatus" id="Loading">Loading...</div> <div id="SRResults"></div> <script type="text/javascript"><!-- createResults(); --></script> <div class="SRStatus" id="Searching">Searching...</div> <div class="SRStatus" id="NoMatches">No Matches</div> <script type="text/javascript"><!-- document.getElementById("Loading").style.display="none"; document.getElementById("NoMatches").style.display="none"; var searchResults = new SearchResults("searchResults"); searchResults.Search(); --></script> </div> </body> </html>
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_5.html
HTML
apache-2.0
1,014
var searchData= [ ['rtx_20specific_20functions',['RTX Specific Functions',['../group__RTX__Global__Functions.html',1,'']]] ];
YifuLiu/AliOS-Things
components/cmsis/docs/RTOS/html/search/groups_5.js
JavaScript
apache-2.0
128