xmclib/CMSIS/Documentation/RTOS2/html/genRTOS2IF.html
2024-10-17 17:09:59 +02:00

957 lines
118 KiB
HTML

<!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 RTOS Interface</title>
<title>CMSIS-RTOS2: Generic RTOS Interface</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-RTOS2
&#160;<span id="projectnumber">Version 2.1.0</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('genRTOS2IF.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">Generic RTOS Interface </div> </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><p>CMSIS-RTOS2 is a generic API that is agnostic of the underlying RTOS kernel. Application programmers call CMSIS-RTOS2 API functions in the user code to ensure maximum portability from one RTOS to another. Middleware using CMSIS-RTOS2 API takes advantages of this approach by avoiding unnecessary porting efforts.</p>
<div class="image">
<img src="API_Structure.png" alt="API_Structure.png"/>
<div class="caption">
CMSIS-RTOS API Structure</div></div>
<p> A typical CMSIS-RTOS2 API implementation interfaces to an existing real-time kernel. The CMSIS-RTOS2 API provides the following attributes and functionalities:</p>
<ul>
<li>Function names, identifiers, and parameters are descriptive and easy to understand. The functions are powerful and flexible which reduces the number of functions exposed to the user.</li>
<li><a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html">Thread Management</a> allows you to define, create, and control threads.</li>
<li>Interrupt Service Routines (ISR) can <a class="el" href="theory_of_operation.html#CMSIS_RTOS_ISR_Calls">call some CMSIS-RTOS functions</a>. When a CMSIS-RTOS function cannot be called from an ISR context, it rejects the invocation and returns an error code.</li>
<li>Three different event types support communication between multiple threads and/or ISR:<ul>
<li><a class="el" href="group__CMSIS__RTOS__ThreadFlagsMgmt.html">Thread Flags</a>: may be used to indicate specific conditions to a thread.</li>
<li><a class="el" href="group__CMSIS__RTOS__EventFlags.html">Event Flags</a>: may be used to indicate events to a thread or ISR.</li>
<li><a class="el" href="group__CMSIS__RTOS__Message.html">Messages</a>: can be sent to a thread or an ISR. Messages are buffered in a queue.</li>
</ul>
</li>
<li><a class="el" href="group__CMSIS__RTOS__MutexMgmt.html">Mutex Management</a> and <a class="el" href="group__CMSIS__RTOS__SemaphoreMgmt.html">Semaphores</a> are incorporated.</li>
<li>CPU time can be scheduled with the following functionalities:<ul>
<li>A <em>timeout</em> parameter is incorporated in many CMSIS-RTOS functions to avoid system lockup. When a timeout is specified, the system waits until a resource is available or an event occurs. While waiting, other threads are scheduled.</li>
<li>The <a class="el" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a> and <a class="el" href="group__CMSIS__RTOS__Wait.html#gaf0763875335699a9baa704ee36990d3c">osDelayUntil</a> functions put a thread into the <b>WAITING</b> state for a specified period of time.</li>
<li>The <a class="el" href="group__CMSIS__RTOS__ThreadMgmt.html#gad01c7ec26535b1de6b018bb9466720e2">osThreadYield</a> provides co-operative thread switching and passes execution to another thread of the same priority.</li>
</ul>
</li>
<li><a class="el" href="group__CMSIS__RTOS__TimerMgmt.html">Timer Management</a> functions are used to trigger the execution of functions.</li>
</ul>
<p>The CMSIS-RTOS2 API is designed to optionally incorporate multi-processor systems and/or access protection via the Cortex-M Memory Protection Unit (MPU).</p>
<p>In some RTOS implementations threads may execute on different processors, thus <b>message</b> queues may reside in shared memory resources.</p>
<p>The CMSIS-RTOS2 API encourages the software industry to evolve existing RTOS implementations. RTOS implementations can be different and optimized in various aspects towards the Cortex-M processors. Optional features may be for example</p>
<ul>
<li>Support of the Cortex-M Memory Protection Unit (MPU).</li>
<li>Support of multi-processor systems.</li>
<li>Support of a DMA controller.</li>
<li>Deterministic context switching.</li>
<li>Round-robin context switching.</li>
<li>Deadlock avoidance, for example with priority inversion.</li>
<li>Zero interrupt latency by using ARMv7-M instructions LDREX and STREX.</li>
</ul>
<h1><a class="anchor" id="usingOS2"></a>
Using a CMSIS-RTOS2 Implementation</h1>
<p>A CMSIS-RTOS2 implementation is typically provided as a library. To add the RTOS functionality to an existing CMSIS-based application, the RTOS library (and typically one or more configuration files) needs to be added. There is a single new header file cmsis_os2.h available. This is the only header file required for a completely portable application. In such a case, user provided memory for control blocks, objects data and thread stack cannot be used. Alternatively, you can include an implementation specific header file (for example <a class="el" href="rtx__os_8h.html">rtx_os.h</a>) which provides definitions also for resource allocation (such as size of control blocks, required memory for object data and thread stack). This is optional and implies that the application code is not completely portable.</p>
<div class="image">
<img src="CMSIS_RTOS_Files.png" alt="CMSIS_RTOS_Files.png"/>
<div class="caption">
CMSIS-RTOS File Structure</div></div>
<p> Once the files are added to a project, the user can start working with the CMSIS-RTOS functions. A code example is provided below:</p>
<p><b>Code Example</b> </p>
<div class="fragment"><div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * CMSIS-RTOS &#39;main&#39; function template</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#include &quot;RTE_Components.h&quot;</span></div>
<div class="line"><span class="preprocessor">#include CMSIS_device_header</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#include &quot;<a class="code" href="cmsis__os2_8h.html">cmsis_os2.h</a>&quot;</span></div>
<div class="line"> </div>
<div class="line"><span class="comment">/*----------------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> * Application main thread</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"><span class="keywordtype">void</span> app_main (<span class="keywordtype">void</span> *argument) {</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// ...</span></div>
<div class="line"> <span class="keywordflow">for</span> (;;) {}</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">int</span> main (<span class="keywordtype">void</span>) {</div>
<div class="line"> </div>
<div class="line"> <span class="comment">// System Initialization</span></div>
<div class="line"> SystemCoreClockUpdate();</div>
<div class="line"><span class="preprocessor">#ifdef RTE_Compiler_EventRecorder</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment">// Initialize and start Event Recorder</span></div>
<div class="line"> EventRecorderInitialize(EventRecordError, 1U);</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> <span class="comment">// ...</span></div>
<div class="line"> </div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gae818f6611d25ba3140bede410a52d659">osKernelInitialize</a>(); <span class="comment">// Initialize CMSIS-RTOS</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga48d68b8666d99d28fa646ee1d2182b8f">osThreadNew</a>(app_main, NULL, NULL); <span class="comment">// Create application main thread</span></div>
<div class="line"> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga9ae2cc00f0d89d7b6a307bba942b5221">osKernelStart</a>(); <span class="comment">// Start thread execution</span></div>
<div class="line"> <span class="keywordflow">for</span> (;;) {}</div>
<div class="line">}</div>
</div><!-- fragment --><h1><a class="anchor" id="cmsis_os2_h"></a>
cmsis_os2.h header file</h1>
<p>The file <b><a class="el" href="cmsis__os2_8h.html">cmsis_os2.h</a></b> is a standard header file that interfaces to every CMSIS-RTOS2 compliant real-time operating systems (RTOS). Each implementation is provided the same <b><a class="el" href="cmsis__os2_8h.html">cmsis_os2.h</a></b> which defines the interface to the <a class="el" href="functionOverview.html#rtos_api2">CMSIS-RTOS2</a>.</p>
<p>Using the <b><a class="el" href="cmsis__os2_8h.html">cmsis_os2.h</a></b> along with dynamic object allocation allows to create source code or libraries that require no modifications when using on a different CMSIS-RTOS2 implementation.</p>
<p><b>Header file cmsis_os2.h</b></p>
<div class="fragment"><div class="line"><span class="comment">/*</span></div>
<div class="line"><span class="comment"> * Copyright (c) 2013-2017 ARM Limited. All rights reserved.</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * SPDX-License-Identifier: Apache-2.0</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Licensed under the Apache License, Version 2.0 (the License); you may</span></div>
<div class="line"><span class="comment"> * not use this file except in compliance with the License.</span></div>
<div class="line"><span class="comment"> * You may obtain a copy of the License at</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * www.apache.org/licenses/LICENSE-2.0</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div>
<div class="line"><span class="comment"> * distributed under the License is distributed on an AS IS BASIS, WITHOUT</span></div>
<div class="line"><span class="comment"> * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div>
<div class="line"><span class="comment"> * See the License for the specific language governing permissions and</span></div>
<div class="line"><span class="comment"> * limitations under the License.</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * ----------------------------------------------------------------------</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * $Date: 10. January 2017</span></div>
<div class="line"><span class="comment"> * $Revision: V2.1.0</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Project: CMSIS-RTOS2 API</span></div>
<div class="line"><span class="comment"> * Title: cmsis_os2.h header file</span></div>
<div class="line"><span class="comment"> *</span></div>
<div class="line"><span class="comment"> * Version 2.1.0</span></div>
<div class="line"><span class="comment"> * Support for critical and uncritical sections (nesting safe):</span></div>
<div class="line"><span class="comment"> * - updated: osKernelLock, osKernelUnlock</span></div>
<div class="line"><span class="comment"> * - added: osKernelRestoreLock</span></div>
<div class="line"><span class="comment"> * Updated Thread and Event Flags:</span></div>
<div class="line"><span class="comment"> * - changed flags parameter and return type from int32_t to uint32_t</span></div>
<div class="line"><span class="comment"> * Version 2.0.0</span></div>
<div class="line"><span class="comment"> * Initial Release</span></div>
<div class="line"><span class="comment"> *---------------------------------------------------------------------------*/</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifndef CMSIS_OS2_H_</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define CMSIS_OS2_H_</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="preprocessor">#ifndef __NO_RETURN</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#if defined(__CC_ARM)</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __NO_RETURN __declspec(noreturn)</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#elif defined(__ARMCC_VERSION) &amp;&amp; (__ARMCC_VERSION &gt;= 6010050)</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __NO_RETURN __attribute__((noreturn))</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#elif defined(__GNUC__)</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __NO_RETURN __attribute__((noreturn))</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#elif defined(__ICCARM__)</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __NO_RETURN __noreturn</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#else</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define __NO_RETURN</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="preprocessor">#include &lt;stdint.h&gt;</span></div>
<div class="line"><span class="preprocessor">#include &lt;stddef.h&gt;</span></div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span></div>
<div class="line">{</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Enumerations, structures, defines ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Version information.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> uint32_t api; <span class="comment">///&lt; API version (major.minor.rev: mmnnnrrrr dec).</span></div>
<div class="line"><span class="comment"></span> uint32_t kernel; <span class="comment">///&lt; Kernel version (major.minor.rev: mmnnnrrrr dec).</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#structosVersion__t">osVersion_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Kernel state.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"> <a class="code" href="cmsis__os2_8h.html#ga08326469274b668140ca934b168a5ad4a2ad3e5912db47b497529d036c89e7995">osKernelInactive</a> = 0, <span class="comment">///&lt; Inactive.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga08326469274b668140ca934b168a5ad4a0596c6e14113447604753656417c9a24">osKernelReady</a> = 1, <span class="comment">///&lt; Ready.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga08326469274b668140ca934b168a5ad4a8e0b699fbe1c8bb66fefadd5911cb6ce">osKernelRunning</a> = 2, <span class="comment">///&lt; Running.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga08326469274b668140ca934b168a5ad4a2fe382ad5ebab2257b35740414b28b01">osKernelLocked</a> = 3, <span class="comment">///&lt; Locked.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga08326469274b668140ca934b168a5ad4ad364464ad84d63b1413a9ac8a962390c">osKernelSuspended</a> = 4, <span class="comment">///&lt; Suspended.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga08326469274b668140ca934b168a5ad4a0545c92c18ce8e6b24e82a0d694a0b4a">osKernelError</a> = -1, <span class="comment">///&lt; Error.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga08326469274b668140ca934b168a5ad4ab0a47576defa29396a649d9173d4bc4b">osKernelReserved</a> = 0x7FFFFFFFU <span class="comment">///&lt; Prevents enum down-size compiler optimization.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga08326469274b668140ca934b168a5ad4">osKernelState_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Thread state.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"> <a class="code" href="cmsis__os2_8h.html#gad3dc89e942e38d9f3af858a0269a820da7d7d4f719a1be6daa63a251563585fdd">osThreadInactive</a> = 0, <span class="comment">///&lt; Inactive.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad3dc89e942e38d9f3af858a0269a820dad9a040e03d7e7943c0217a3359fc1e8b">osThreadReady</a> = 1, <span class="comment">///&lt; Ready.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad3dc89e942e38d9f3af858a0269a820da71dae1f35a4b4d9d2ab24e186461a17f">osThreadRunning</a> = 2, <span class="comment">///&lt; Running.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad3dc89e942e38d9f3af858a0269a820da476cd2370e6938974fb2a79811408819">osThreadBlocked</a> = 3, <span class="comment">///&lt; Blocked.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad3dc89e942e38d9f3af858a0269a820dac2a35280d5475f56352c539c9c9b42f9">osThreadTerminated</a> = 4, <span class="comment">///&lt; Terminated.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad3dc89e942e38d9f3af858a0269a820dac841e73a7198a42364c9450f1f54a0ef">osThreadError</a> = -1, <span class="comment">///&lt; Error.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad3dc89e942e38d9f3af858a0269a820da8872f7e352370eb11ee772c7dcca6e6c">osThreadReserved</a> = 0x7FFFFFFF <span class="comment">///&lt; Prevents enum down-size compiler optimization.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gad3dc89e942e38d9f3af858a0269a820d">osThreadState_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Priority values.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca6c437c7185161a3bd1e7e4669dfa17a3">osPriorityNone</a> = 0, <span class="comment">///&lt; No priority (not initialized).</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca549e79a43ff4f8b2b31afb613f5caa81">osPriorityIdle</a> = 1, <span class="comment">///&lt; Reserved for Idle thread.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca61cb822239ac8f66dfbdc7291598a3d4">osPriorityLow</a> = 8, <span class="comment">///&lt; Priority: low</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecaba2b6919f0b630c8c1b2c940e3bfadbe">osPriorityLow1</a> = 8+1, <span class="comment">///&lt; Priority: low + 1</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca78ad5d00aa07a2b4bf30a639544f5507">osPriorityLow2</a> = 8+2, <span class="comment">///&lt; Priority: low + 2</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca28ccb07942c16f5f5efefb6cf68a7f50">osPriorityLow3</a> = 8+3, <span class="comment">///&lt; Priority: low + 3</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca5a4a4f26d5b220a968e221e854f69a81">osPriorityLow4</a> = 8+4, <span class="comment">///&lt; Priority: low + 4</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecad69b8c14809bc5bdce4887f5a57d9353">osPriorityLow5</a> = 8+5, <span class="comment">///&lt; Priority: low + 5</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecac0f188468664d06d4cd9e6e1ed351393">osPriorityLow6</a> = 8+6, <span class="comment">///&lt; Priority: low + 6</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca5b151ebba7fdeb1baaa9b7b420890b7a">osPriorityLow7</a> = 8+7, <span class="comment">///&lt; Priority: low + 7</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca193b650117c209b4a203954542bcc3e6">osPriorityBelowNormal</a> = 16, <span class="comment">///&lt; Priority: below normal</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca9138da7187690b15f52d8e5729c18da5">osPriorityBelowNormal1</a> = 16+1, <span class="comment">///&lt; Priority: below normal + 1</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca4f081d6735bf2f513338b07eddf13ae3">osPriorityBelowNormal2</a> = 16+2, <span class="comment">///&lt; Priority: below normal + 2</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca19c013690d0d6bf3ac90707942be3fdf">osPriorityBelowNormal3</a> = 16+3, <span class="comment">///&lt; Priority: below normal + 3</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca36931ad6cee5e4700e2c8622bdd2cd24">osPriorityBelowNormal4</a> = 16+4, <span class="comment">///&lt; Priority: below normal + 4</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca0bcd9ad1e7a02e3bf03be7dcc8ece38e">osPriorityBelowNormal5</a> = 16+5, <span class="comment">///&lt; Priority: below normal + 5</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecabd3cc7df5b92b752ddf1e7843a786c05">osPriorityBelowNormal6</a> = 16+6, <span class="comment">///&lt; Priority: below normal + 6</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecab18e3bda7b5e418e309a62d6267ea14b">osPriorityBelowNormal7</a> = 16+7, <span class="comment">///&lt; Priority: below normal + 7</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca45a2895ad30c79fb97de18cac7cc19f1">osPriorityNormal</a> = 24, <span class="comment">///&lt; Priority: normal</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca3e70c19e03d5a54e66bd071f0776782c">osPriorityNormal1</a> = 24+1, <span class="comment">///&lt; Priority: normal + 1</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca19e96f2b025b6462a43b1965043c8205">osPriorityNormal2</a> = 24+2, <span class="comment">///&lt; Priority: normal + 2</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca402bd7ab26fb57c8cee8cf94168f4c91">osPriorityNormal3</a> = 24+3, <span class="comment">///&lt; Priority: normal + 3</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca93ef07d3a107aeee6508bfd29ba3485d">osPriorityNormal4</a> = 24+4, <span class="comment">///&lt; Priority: normal + 4</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca68f3f6fdaa639de300277802aa13a0ab">osPriorityNormal5</a> = 24+5, <span class="comment">///&lt; Priority: normal + 5</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca8221eb0d059726a6309f1f2d0cdb6204">osPriorityNormal6</a> = 24+6, <span class="comment">///&lt; Priority: normal + 6</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca049abd04f8951415407ec9d92bd9b80b">osPriorityNormal7</a> = 24+7, <span class="comment">///&lt; Priority: normal + 7</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca17b36cd9cd38652c2bc6d4803990674b">osPriorityAboveNormal</a> = 32, <span class="comment">///&lt; Priority: above normal</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecabfeafc713edfc7b9130aa5c762d68998">osPriorityAboveNormal1</a> = 32+1, <span class="comment">///&lt; Priority: above normal + 1</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca901acf86070e06f5990b611734ee2562">osPriorityAboveNormal2</a> = 32+2, <span class="comment">///&lt; Priority: above normal + 2</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecad566b876b64e6efdc3eba0fc04e54013">osPriorityAboveNormal3</a> = 32+3, <span class="comment">///&lt; Priority: above normal + 3</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca6ccac37d7dae4586a2031966d36a63ec">osPriorityAboveNormal4</a> = 32+4, <span class="comment">///&lt; Priority: above normal + 4</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecae36e8b38ee046a3104bcccabb10cf78c">osPriorityAboveNormal5</a> = 32+5, <span class="comment">///&lt; Priority: above normal + 5</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca61e6ce27e1e0f34f2540b413b8a8b207">osPriorityAboveNormal6</a> = 32+6, <span class="comment">///&lt; Priority: above normal + 6</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecadbbb0fed3ada6b9b50d4a628abc2a67d">osPriorityAboveNormal7</a> = 32+7, <span class="comment">///&lt; Priority: above normal + 7</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca914433934143a9ba767e59577c56e6c2">osPriorityHigh</a> = 40, <span class="comment">///&lt; Priority: high</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca17b7a7e6febf12444a84e90edfce36cb">osPriorityHigh1</a> = 40+1, <span class="comment">///&lt; Priority: high + 1</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca40a120cf8bbc42e575455c027f3d9b03">osPriorityHigh2</a> = 40+2, <span class="comment">///&lt; Priority: high + 2</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca0b15518b0b5321a29efa0b42b2f8c759">osPriorityHigh3</a> = 40+3, <span class="comment">///&lt; Priority: high + 3</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecafe5a4f393fab04551ac7d93e80cdf0fb">osPriorityHigh4</a> = 40+4, <span class="comment">///&lt; Priority: high + 4</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca5960841bfbdd959b163429e8502ea4e9">osPriorityHigh5</a> = 40+5, <span class="comment">///&lt; Priority: high + 5</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca5714dda6effc1a3f8ec155d97e3e69bc">osPriorityHigh6</a> = 40+6, <span class="comment">///&lt; Priority: high + 6</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca63ad0cc52a701ef3d9df52b59b995652">osPriorityHigh7</a> = 40+7, <span class="comment">///&lt; Priority: high + 7</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca1485dec3702434a1ec3cb74c7a17a4af">osPriorityRealtime</a> = 48, <span class="comment">///&lt; Priority: realtime</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecaf685a06b30f0635476e21347a986305b">osPriorityRealtime1</a> = 48+1, <span class="comment">///&lt; Priority: realtime + 1</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecab832bd9de84e5eec2ecad69d085dadff">osPriorityRealtime2</a> = 48+2, <span class="comment">///&lt; Priority: realtime + 2</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca3f2261e5e733e92844ae8c630f2f9eaa">osPriorityRealtime3</a> = 48+3, <span class="comment">///&lt; Priority: realtime + 3</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecaf614e3dc966d559cd9d9d2a0f78ebe70">osPriorityRealtime4</a> = 48+4, <span class="comment">///&lt; Priority: realtime + 4</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecaff84f31ceff203c711fb9476443507df">osPriorityRealtime5</a> = 48+5, <span class="comment">///&lt; Priority: realtime + 5</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca80ae9d0dd256312c0c8f44af48316194">osPriorityRealtime6</a> = 48+6, <span class="comment">///&lt; Priority: realtime + 6</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecaa76da6825c4bd31c4958200bc289103b">osPriorityRealtime7</a> = 48+7, <span class="comment">///&lt; Priority: realtime + 7</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342eca3943224956e1ea667c6a931c74137b79">osPriorityISR</a> = 56, <span class="comment">///&lt; Reserved for ISR deferred thread.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecae35f5e2f9c64ad346822521b643bdea4">osPriorityError</a> = -1, <span class="comment">///&lt; System cannot determine priority or illegal priority.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#gad4e3e0971b41f2d17584a8c6837342ecac86c171f8d466cced0cb1b03bb03343b">osPriorityReserved</a> = 0x7FFFFFFF <span class="comment">///&lt; Prevents enum down-size compiler optimization.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gad4e3e0971b41f2d17584a8c6837342ec">osPriority_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Entry point of a thread.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> void (*<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gadd51f99a6eb50b94eee75f27cae815eb">osThreadFunc_t</a>) (<span class="keywordtype">void</span> *argument);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Entry point of a timer call back function.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> void (*<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaacf768c1ec64b020598afb985d7b30be">osTimerFunc_t</a>) (<span class="keywordtype">void</span> *argument);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Timer type.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"> <a class="code" href="cmsis__os2_8h.html#ga7dc24a4c2b90334427081c3da7a71915ad21712f8df5f97069c82dc9eec37b951">osTimerOnce</a> = 0, <span class="comment">///&lt; One-shot timer.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga7dc24a4c2b90334427081c3da7a71915ab9c91f9699162edb09bb7c90c11c8788">osTimerPeriodic</a> = 1 <span class="comment">///&lt; Repeating timer.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga7dc24a4c2b90334427081c3da7a71915">osTimerType_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Timeout value.</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osWaitForever 0xFFFFFFFFU </span><span class="comment">///&lt; Wait forever timeout value.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// Flags options (\ref osThreadFlagsWait and \ref osEventFlagsWait).</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osFlagsWaitAny 0x00000000U </span><span class="comment">///&lt; Wait for any flag (default).</span></div>
<div class="line"><span class="comment"></span>#define osFlagsWaitAll 0x00000001U <span class="comment">///&lt; Wait for all flags.</span></div>
<div class="line"><span class="comment"></span>#define osFlagsNoClear 0x00000002U <span class="comment">///&lt; Do not clear flags which have been specified to wait for.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// Flags errors (returned by osThreadFlagsXxxx and osEventFlagsXxxx).</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osFlagsError 0x80000000U </span><span class="comment">///&lt; Error indicator.</span></div>
<div class="line"><span class="comment"></span>#define osFlagsErrorUnknown 0xFFFFFFFFU <span class="comment">///&lt; osError (-1).</span></div>
<div class="line"><span class="comment"></span>#define osFlagsErrorTimeout 0xFFFFFFFEU <span class="comment">///&lt; osErrorTimeout (-2).</span></div>
<div class="line"><span class="comment"></span>#define osFlagsErrorResource 0xFFFFFFFDU <span class="comment">///&lt; osErrorResource (-3).</span></div>
<div class="line"><span class="comment"></span>#define osFlagsErrorParameter 0xFFFFFFFCU <span class="comment">///&lt; osErrorParameter (-4).</span></div>
<div class="line"><span class="comment"></span>#define osFlagsErrorISR 0xFFFFFFFAU <span class="comment">///&lt; osErrorISR (-6).</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// Thread attributes (attr_bits in \ref osThreadAttr_t).</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osThreadDetached 0x00000000U </span><span class="comment">///&lt; Thread created in detached state (default)</span></div>
<div class="line"><span class="comment"></span>#define osThreadJoinable 0x00000001U <span class="comment">///&lt; Thread created in joinable state</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// Mutex attributes (attr_bits in \ref osMutexAttr_t).</span></div>
<div class="line"><span class="comment"></span><span class="preprocessor">#define osMutexRecursive 0x00000001U </span><span class="comment">///&lt; Recursive mutex.</span></div>
<div class="line"><span class="comment"></span>#define osMutexPrioInherit 0x00000002U <span class="comment">///&lt; Priority inherit protocol.</span></div>
<div class="line"><span class="comment"></span>#define osMutexRobust 0x00000008U <span class="comment">///&lt; Robust mutex.</span></div>
<div class="line"><span class="comment"></span> </div>
<div class="line"><span class="comment">/// Status code values returned by CMSIS-RTOS functions.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea9e1c9e2550bb4de8969a935acffc968f">osOK</a> = 0, <span class="comment">///&lt; Operation completed successfully.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813eabb7b2d2c4efa66df42f1c10635467b09">osError</a> = -1, <span class="comment">///&lt; Unspecified RTOS error: run-time error but no other error message fits.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea913eb5df15ad85f8557eb3a456b56879">osErrorTimeout</a> = -2, <span class="comment">///&lt; Operation not completed within the timeout period.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea8fc5801e8b0482bdf22ad63a77f0155d">osErrorResource</a> = -3, <span class="comment">///&lt; Resource not available.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813eac24adca6a5d072c9f01c32178ba0d109">osErrorParameter</a> = -4, <span class="comment">///&lt; Parameter error.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813eaf1fac0240218e51eb30a13da2f8aae81">osErrorNoMemory</a> = -5, <span class="comment">///&lt; System is out of memory: it was impossible to allocate or reserve memory for the operation.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea21635bdc492d3094fe83027fa4a30e2f">osErrorISR</a> = -6, <span class="comment">///&lt; Not allowed in ISR context: the function cannot be called from interrupt service routines.</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="cmsis__os2_8h.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813ea66cc9ce9106b508df0e4a733a55a439d">osStatusReserved</a> = 0x7FFFFFFF <span class="comment">///&lt; Prevents enum down-size compiler optimization.</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a>;</div>
<div class="line"> </div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \details Thread ID identifies the thread.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaa6c32fe2a3e0a2e01f212d55b02e51c7">osThreadId_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \details Timer ID identifies the timer.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaad5409379689ee27bb0a0b56ea4a4b34">osTimerId_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \details Event Flags ID identifies the event flags.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="group__CMSIS__RTOS__EventFlags.html#gafdbab933146d6d81d7cca7287e267a50">osEventFlagsId_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \details Mutex ID identifies the mutex.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga313801836c62deb23055efb55a420e42">osMutexId_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \details Semaphore ID identifies the semaphore.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga6e1c1c4b04175bb92b013c8f37249f40">osSemaphoreId_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \details Memory Pool ID identifies the memory pool.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga2e44473caf338266f56800960294f960">osMemoryPoolId_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// \details Message Queue ID identifies the message queue.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keywordtype">void</span> *<a class="code" href="cmsis__os2_8h.html#a206dbc05367e03c39fc6d4d1ebcff317">osMessageQueueId_t</a>;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifndef TZ_MODULEID_T</span></div>
<div class="line"><span class="preprocessor"></span><span class="preprocessor">#define TZ_MODULEID_T</span></div>
<div class="line"><span class="preprocessor"></span><span class="comment">/// \details Data type that identifies secure software modules called by a process.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> uint32_t <a class="code" href="cmsis__os2_8h.html#ad5ef21485fe5f60263bc0b48006202cb">TZ_ModuleId_t</a>;</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Attributes structure for thread.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *name; <span class="comment">///&lt; name of the thread</span></div>
<div class="line"><span class="comment"></span> uint32_t attr_bits; <span class="comment">///&lt; attribute bits</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *cb_mem; <span class="comment">///&lt; memory for control block</span></div>
<div class="line"><span class="comment"></span> uint32_t cb_size; <span class="comment">///&lt; size of provided memory for control block</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *stack_mem; <span class="comment">///&lt; memory for stack</span></div>
<div class="line"><span class="comment"></span> uint32_t stack_size; <span class="comment">///&lt; size of stack</span></div>
<div class="line"><span class="comment"></span> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gad4e3e0971b41f2d17584a8c6837342ec">osPriority_t</a> priority; <span class="comment">///&lt; initial thread priority (default: osPriorityNormal)</span></div>
<div class="line"><span class="comment"></span> TZ_ModuleId_t tz_module; <span class="comment">///&lt; TrustZone module identifier</span></div>
<div class="line"><span class="comment"></span> uint32_t reserved; <span class="comment">///&lt; reserved (must be 0)</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#structosThreadAttr__t">osThreadAttr_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Attributes structure for timer.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *name; <span class="comment">///&lt; name of the timer</span></div>
<div class="line"><span class="comment"></span> uint32_t attr_bits; <span class="comment">///&lt; attribute bits</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *cb_mem; <span class="comment">///&lt; memory for control block</span></div>
<div class="line"><span class="comment"></span> uint32_t cb_size; <span class="comment">///&lt; size of provided memory for control block</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#structosTimerAttr__t">osTimerAttr_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Attributes structure for event flags.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *name; <span class="comment">///&lt; name of the event flags</span></div>
<div class="line"><span class="comment"></span> uint32_t attr_bits; <span class="comment">///&lt; attribute bits</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *cb_mem; <span class="comment">///&lt; memory for control block</span></div>
<div class="line"><span class="comment"></span> uint32_t cb_size; <span class="comment">///&lt; size of provided memory for control block</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__EventFlags.html#structosEventFlagsAttr__t">osEventFlagsAttr_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Attributes structure for mutex.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *name; <span class="comment">///&lt; name of the mutex</span></div>
<div class="line"><span class="comment"></span> uint32_t attr_bits; <span class="comment">///&lt; attribute bits</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *cb_mem; <span class="comment">///&lt; memory for control block</span></div>
<div class="line"><span class="comment"></span> uint32_t cb_size; <span class="comment">///&lt; size of provided memory for control block</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#structosMutexAttr__t">osMutexAttr_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Attributes structure for semaphore.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *name; <span class="comment">///&lt; name of the semaphore</span></div>
<div class="line"><span class="comment"></span> uint32_t attr_bits; <span class="comment">///&lt; attribute bits</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *cb_mem; <span class="comment">///&lt; memory for control block</span></div>
<div class="line"><span class="comment"></span> uint32_t cb_size; <span class="comment">///&lt; size of provided memory for control block</span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#structosSemaphoreAttr__t">osSemaphoreAttr_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Attributes structure for memory pool.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *name; <span class="comment">///&lt; name of the memory pool</span></div>
<div class="line"><span class="comment"></span> uint32_t attr_bits; <span class="comment">///&lt; attribute bits</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *cb_mem; <span class="comment">///&lt; memory for control block</span></div>
<div class="line"><span class="comment"></span> uint32_t cb_size; <span class="comment">///&lt; size of provided memory for control block</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *mp_mem; <span class="comment">///&lt; memory for data storage</span></div>
<div class="line"><span class="comment"></span> uint32_t mp_size; <span class="comment">///&lt; size of provided memory for data storage </span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#structosMemoryPoolAttr__t">osMemoryPoolAttr_t</a>;</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Attributes structure for message queue.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">typedef</span> <span class="keyword">struct </span>{</div>
<div class="line"> <span class="keyword">const</span> <span class="keywordtype">char</span> *name; <span class="comment">///&lt; name of the message queue</span></div>
<div class="line"><span class="comment"></span> uint32_t attr_bits; <span class="comment">///&lt; attribute bits</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *cb_mem; <span class="comment">///&lt; memory for control block</span></div>
<div class="line"><span class="comment"></span> uint32_t cb_size; <span class="comment">///&lt; size of provided memory for control block</span></div>
<div class="line"><span class="comment"></span> <span class="keywordtype">void</span> *mq_mem; <span class="comment">///&lt; memory for data storage</span></div>
<div class="line"><span class="comment"></span> uint32_t mq_size; <span class="comment">///&lt; size of provided memory for data storage </span></div>
<div class="line"><span class="comment"></span>} <a class="code" href="group__CMSIS__RTOS__Message.html#structosMessageQueueAttr__t">osMessageQueueAttr_t</a>;</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Kernel Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Initialize the RTOS Kernel.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gae818f6611d25ba3140bede410a52d659">osKernelInitialize</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get RTOS Kernel Information.</span></div>
<div class="line"><span class="comment">/// \param[out] version pointer to buffer for retrieving version information.</span></div>
<div class="line"><span class="comment">/// \param[out] id_buf pointer to buffer for retrieving kernel identification string.</span></div>
<div class="line"><span class="comment">/// \param[in] id_size size of buffer for kernel identification string.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga6f7764e7250c5c5364c00c45a5d1d199">osKernelGetInfo</a> (<a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#structosVersion__t">osVersion_t</a> *version, <span class="keywordtype">char</span> *id_buf, uint32_t id_size);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the current RTOS Kernel state.</span></div>
<div class="line"><span class="comment">/// \return current RTOS Kernel state.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga08326469274b668140ca934b168a5ad4">osKernelState_t</a> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga48b69b81012fce051f639be288b243ba">osKernelGetState</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Start the RTOS Kernel scheduler.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga9ae2cc00f0d89d7b6a307bba942b5221">osKernelStart</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Lock the RTOS Kernel scheduler.</span></div>
<div class="line"><span class="comment">/// \return previous lock state (1 - locked, 0 - not locked, error code if negative).</span></div>
<div class="line"><span class="comment"></span>int32_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga948609ee930d9b38336b9e1c2a4dfe12">osKernelLock</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Unlock the RTOS Kernel scheduler.</span></div>
<div class="line"><span class="comment">/// \return previous lock state (1 - locked, 0 - not locked, error code if negative).</span></div>
<div class="line"><span class="comment"></span>int32_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gaf401728b4657456198c33fe75f8d6720">osKernelUnlock</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Restore the RTOS Kernel scheduler lock state.</span></div>
<div class="line"><span class="comment">/// \param[in] lock lock state obtained by \ref osKernelLock or \ref osKernelUnlock.</span></div>
<div class="line"><span class="comment">/// \return new lock state (1 - locked, 0 - not locked, error code if negative).</span></div>
<div class="line"><span class="comment"></span>int32_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gae7d0a71b9586cbbb49fcbdf6a04f0289">osKernelRestoreLock</a> (int32_t lock);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Suspend the RTOS Kernel scheduler.</span></div>
<div class="line"><span class="comment">/// \return time in ticks, for how long the system can sleep or power-down.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gae26683e1606ec633354a2876c68f0c1f">osKernelSuspend</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Resume the RTOS Kernel scheduler.</span></div>
<div class="line"><span class="comment">/// \param[in] sleep_ticks time in ticks for how long the system was in sleep or power-down mode.</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga8c4b4d7ed34cab73c001665d9176aced">osKernelResume</a> (uint32_t sleep_ticks);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the RTOS kernel tick count.</span></div>
<div class="line"><span class="comment">/// \return RTOS kernel current tick count.</span></div>
<div class="line"><span class="comment"></span>uint64_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga3cad48045fb59e47dc8bab75b420cb5f">osKernelGetTickCount</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the RTOS kernel tick frequency.</span></div>
<div class="line"><span class="comment">/// \return frequency of the kernel tick.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga7a8d7bd927eaaa58999f91d7d6310cee">osKernelGetTickFreq</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the RTOS kernel system timer count.</span></div>
<div class="line"><span class="comment">/// \return RTOS kernel current system timer count as 32-bit value.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#gae0fcaff6cecfb4013bb556c87afcd7d2">osKernelGetSysTimerCount</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the RTOS kernel system timer frequency.</span></div>
<div class="line"><span class="comment">/// \return frequency of the system timer.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__KernelCtrl.html#ga4d69215a93220f72be3684cad582f16a">osKernelGetSysTimerFreq</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Thread Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create a thread and add it to Active Threads.</span></div>
<div class="line"><span class="comment">/// \param[in] func thread function.</span></div>
<div class="line"><span class="comment">/// \param[in] argument pointer that is passed to the thread function as start argument.</span></div>
<div class="line"><span class="comment">/// \param[in] attr thread attributes; NULL: default values.</span></div>
<div class="line"><span class="comment">/// \return thread ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osThreadId_t <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga48d68b8666d99d28fa646ee1d2182b8f">osThreadNew</a> (<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gadd51f99a6eb50b94eee75f27cae815eb">osThreadFunc_t</a> func, <span class="keywordtype">void</span> *argument, <span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#structosThreadAttr__t">osThreadAttr_t</a> *attr);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get name of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return name as NULL terminated string.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gac3230f3a55a297514b013ebf38f27e0a">osThreadGetName</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Return the thread ID of the current running thread.</span></div>
<div class="line"><span class="comment">/// \return thread ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osThreadId_t <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga8df03548e89fbc56402a5cd584a505da">osThreadGetId</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get current thread state of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return current thread state of the specified thread.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gad3dc89e942e38d9f3af858a0269a820d">osThreadState_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gacc0a98b42f0a5928e12dc91dc76866b9">osThreadGetState</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get stack size of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return stack size in bytes.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gab9f8bd715d671c6ee27644867bc1bf65">osThreadGetStackSize</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get available stack space of a thread based on stack watermark recording during execution.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return remaining stack space in bytes.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga9c83bd5dd8de329701775d6ef7012720">osThreadGetStackSpace</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Change priority of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \param[in] priority new priority value for the thread function.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga861a420fb2d643115b06622903fb3bfb">osThreadSetPriority</a> (osThreadId_t thread_id, <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gad4e3e0971b41f2d17584a8c6837342ec">osPriority_t</a> priority);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get current priority of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return current priority value of the specified thread.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gad4e3e0971b41f2d17584a8c6837342ec">osPriority_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga0aeaf349604f456e68e78f9d3b42e44b">osThreadGetPriority</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Pass control to next thread that is in state \b READY.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gad01c7ec26535b1de6b018bb9466720e2">osThreadYield</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Suspend execution of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaa9de419d0152bf77e9bbcd1f369fb990">osThreadSuspend</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Resume execution of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga3dbad90eff394b02de76a452c84c5d80">osThreadResume</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Detach a thread (thread storage can be reclaimed when thread terminates).</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaaad14cd9547341ea8109dc4e8540f1dc">osThreadDetach</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait for specified thread to terminate.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga3fca90fb0679afeb968aa8c3d5874487">osThreadJoin</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Terminate execution of current running thread.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="cmsis__os2_8h.html#a153a4a31b276a9758959580538720a51">__NO_RETURN</a> <span class="keywordtype">void</span> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#gaddaa452dd7610e4096647a566d3556fc">osThreadExit</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Terminate execution of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga2f8ba6dba6e9c065a6e236ffd410d74a">osThreadTerminate</a> (osThreadId_t thread_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get number of active threads.</span></div>
<div class="line"><span class="comment">/// \return number of active threads.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga495b3f812224e7301f23a691793765db">osThreadGetCount</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Enumerate active threads.</span></div>
<div class="line"><span class="comment">/// \param[out] thread_array pointer to array for retrieving thread IDs.</span></div>
<div class="line"><span class="comment">/// \param[in] array_items maximum number of items in array for retrieving thread IDs.</span></div>
<div class="line"><span class="comment">/// \return number of enumerated threads.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadMgmt.html#ga5606604d56e21ece1a654664be877439">osThreadEnumerate</a> (osThreadId_t *thread_array, uint32_t array_items);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Thread Flags Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Set the specified Thread Flags of a thread.</span></div>
<div class="line"><span class="comment">/// \param[in] thread_id thread ID obtained by \ref osThreadNew or \ref osThreadGetId.</span></div>
<div class="line"><span class="comment">/// \param[in] flags specifies the flags of the thread that shall be set.</span></div>
<div class="line"><span class="comment">/// \return thread flags after setting or error code if highest bit set.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadFlagsMgmt.html#ga6f89ef9caded1d9963c7b12b0f6412c9">osThreadFlagsSet</a> (osThreadId_t thread_id, uint32_t flags);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Clear the specified Thread Flags of current running thread.</span></div>
<div class="line"><span class="comment">/// \param[in] flags specifies the flags of the thread that shall be cleared.</span></div>
<div class="line"><span class="comment">/// \return thread flags before clearing or error code if highest bit set.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadFlagsMgmt.html#ga656abc1c862c5b9a2b13584c42cc0bfa">osThreadFlagsClear</a> (uint32_t flags);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the current Thread Flags of current running thread.</span></div>
<div class="line"><span class="comment">/// \return current thread flags.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadFlagsMgmt.html#ga85c8d2c89466e25abbcb545d9ddd71ba">osThreadFlagsGet</a> (<span class="keywordtype">void</span>);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait for one or more Thread Flags of the current running thread to become signaled.</span></div>
<div class="line"><span class="comment">/// \param[in] flags specifies the flags to wait for.</span></div>
<div class="line"><span class="comment">/// \param[in] options specifies flags options (osFlagsXxxx).</span></div>
<div class="line"><span class="comment">/// \param[in] timeout \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return thread flags before clearing or error code if highest bit set.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__ThreadFlagsMgmt.html#gac11542ad6300b600f872fc96e340ec2b">osThreadFlagsWait</a> (uint32_t flags, uint32_t options, uint32_t timeout);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Generic Wait Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait for Timeout (Time Delay).</span></div>
<div class="line"><span class="comment">/// \param[in] ticks \ref CMSIS_RTOS_TimeOutValue &quot;time ticks&quot; value</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf6055a51390ef65b6b6edc28bf47322e">osDelay</a> (uint32_t ticks);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait until specified time.</span></div>
<div class="line"><span class="comment">/// \param[in] ticks absolute time in ticks</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__Wait.html#gaf0763875335699a9baa704ee36990d3c">osDelayUntil</a> (uint64_t ticks);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Timer Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a timer.</span></div>
<div class="line"><span class="comment">/// \param[in] func start address of a timer call back function.</span></div>
<div class="line"><span class="comment">/// \param[in] type osTimerOnce for one-shot or osTimerPeriodic for periodic behavior.</span></div>
<div class="line"><span class="comment">/// \param[in] argument argument to the timer call back function.</span></div>
<div class="line"><span class="comment">/// \param[in] attr timer attributes; NULL: default values.</span></div>
<div class="line"><span class="comment">/// \return timer ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osTimerId_t <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gad4e7f785c5f700a509f55a3bf6a62bec">osTimerNew</a> (<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gaacf768c1ec64b020598afb985d7b30be">osTimerFunc_t</a> func, <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga7dc24a4c2b90334427081c3da7a71915">osTimerType_t</a> type, <span class="keywordtype">void</span> *argument, <span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#structosTimerAttr__t">osTimerAttr_t</a> *attr);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get name of a timer.</span></div>
<div class="line"><span class="comment">/// \param[in] timer_id timer ID obtained by \ref osTimerNew.</span></div>
<div class="line"><span class="comment">/// \return name as NULL terminated string.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga4f82a98eee4d9ea79507e44340d3d319">osTimerGetName</a> (osTimerId_t timer_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Start or restart a timer.</span></div>
<div class="line"><span class="comment">/// \param[in] timer_id timer ID obtained by \ref osTimerNew.</span></div>
<div class="line"><span class="comment">/// \param[in] ticks \ref CMSIS_RTOS_TimeOutValue &quot;time ticks&quot; value of the timer.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gab6ee2859ea657641b7adfac599b8121d">osTimerStart</a> (osTimerId_t timer_id, uint32_t ticks);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Stop a timer.</span></div>
<div class="line"><span class="comment">/// \param[in] timer_id timer ID obtained by \ref osTimerNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gabd7a89356da7717293eb0bc5d87b8ac9">osTimerStop</a> (osTimerId_t timer_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Check if a timer is running.</span></div>
<div class="line"><span class="comment">/// \param[in] timer_id timer ID obtained by \ref osTimerNew.</span></div>
<div class="line"><span class="comment">/// \return 0 not running, 1 running.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#ga69d3589f54194022c30dd01e45ec6741">osTimerIsRunning</a> (osTimerId_t timer_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a timer.</span></div>
<div class="line"><span class="comment">/// \param[in] timer_id timer ID obtained by \ref osTimerNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__TimerMgmt.html#gad0001dd74721ab461789324806db2453">osTimerDelete</a> (osTimerId_t timer_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Event Flags Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize an Event Flags object.</span></div>
<div class="line"><span class="comment">/// \param[in] attr event flags attributes; NULL: default values.</span></div>
<div class="line"><span class="comment">/// \return event flags ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osEventFlagsId_t <a class="code" href="group__CMSIS__RTOS__EventFlags.html#gab14b1caeb12ffa42cce1bfe889cd07df">osEventFlagsNew</a> (<span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__EventFlags.html#structosEventFlagsAttr__t">osEventFlagsAttr_t</a> *attr);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get name of an Event Flags object.</span></div>
<div class="line"><span class="comment">/// \param[in] ef_id event flags ID obtained by \ref osEventFlagsNew.</span></div>
<div class="line"><span class="comment">/// \return name as NULL terminated string.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__CMSIS__RTOS__EventFlags.html#ga59f4ddf0ee8c395b1672bb978d1cfc88">osEventFlagsGetName</a> (osEventFlagsId_t ef_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Set the specified Event Flags.</span></div>
<div class="line"><span class="comment">/// \param[in] ef_id event flags ID obtained by \ref osEventFlagsNew.</span></div>
<div class="line"><span class="comment">/// \param[in] flags specifies the flags that shall be set.</span></div>
<div class="line"><span class="comment">/// \return event flags after setting or error code if highest bit set.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__EventFlags.html#ga33b71d14cecf90b4e72639dd19f23a5e">osEventFlagsSet</a> (osEventFlagsId_t ef_id, uint32_t flags);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Clear the specified Event Flags.</span></div>
<div class="line"><span class="comment">/// \param[in] ef_id event flags ID obtained by \ref osEventFlagsNew.</span></div>
<div class="line"><span class="comment">/// \param[in] flags specifies the flags that shall be cleared.</span></div>
<div class="line"><span class="comment">/// \return event flags before clearing or error code if highest bit set.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__EventFlags.html#ga93bf258ca0007c6641fbe8e4f2b8a1e5">osEventFlagsClear</a> (osEventFlagsId_t ef_id, uint32_t flags);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get the current Event Flags.</span></div>
<div class="line"><span class="comment">/// \param[in] ef_id event flags ID obtained by \ref osEventFlagsNew.</span></div>
<div class="line"><span class="comment">/// \return current event flags.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__EventFlags.html#ga8bda3185f46bfd278cea8a6cf357677d">osEventFlagsGet</a> (osEventFlagsId_t ef_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Wait for one or more Event Flags to become signaled.</span></div>
<div class="line"><span class="comment">/// \param[in] ef_id event flags ID obtained by \ref osEventFlagsNew.</span></div>
<div class="line"><span class="comment">/// \param[in] flags specifies the flags to wait for.</span></div>
<div class="line"><span class="comment">/// \param[in] options specifies flags options (osFlagsXxxx).</span></div>
<div class="line"><span class="comment">/// \param[in] timeout \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return event flags before clearing or error code if highest bit set.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__EventFlags.html#ga52acb34a8322e58020227344fe662b4e">osEventFlagsWait</a> (osEventFlagsId_t ef_id, uint32_t flags, uint32_t options, uint32_t timeout);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete an Event Flags object.</span></div>
<div class="line"><span class="comment">/// \param[in] ef_id event flags ID obtained by \ref osEventFlagsNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__EventFlags.html#ga7c4acf2fb0d506ec82905dee53fb5435">osEventFlagsDelete</a> (osEventFlagsId_t ef_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Mutex Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a Mutex object.</span></div>
<div class="line"><span class="comment">/// \param[in] attr mutex attributes; NULL: default values.</span></div>
<div class="line"><span class="comment">/// \return mutex ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osMutexId_t <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gab90920022ab944296821368ef6bb52f8">osMutexNew</a> (<span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#structosMutexAttr__t">osMutexAttr_t</a> *attr);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get name of a Mutex object.</span></div>
<div class="line"><span class="comment">/// \param[in] mutex_id mutex ID obtained by \ref osMutexNew.</span></div>
<div class="line"><span class="comment">/// \return name as NULL terminated string.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga00b5e58cd247a412d1afd18732d8b752">osMutexGetName</a> (osMutexId_t mutex_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Acquire a Mutex or timeout if it is locked.</span></div>
<div class="line"><span class="comment">/// \param[in] mutex_id mutex ID obtained by \ref osMutexNew.</span></div>
<div class="line"><span class="comment">/// \param[in] timeout \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabc54686ea0fc281823b1763422d2a924">osMutexAcquire</a> (osMutexId_t mutex_id, uint32_t timeout);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Release a Mutex that was acquired by \ref osMutexAcquire.</span></div>
<div class="line"><span class="comment">/// \param[in] mutex_id mutex ID obtained by \ref osMutexNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gaea629705703580ff58776bf73c8db915">osMutexRelease</a> (osMutexId_t mutex_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get Thread which owns a Mutex object.</span></div>
<div class="line"><span class="comment">/// \param[in] mutex_id mutex ID obtained by \ref osMutexNew.</span></div>
<div class="line"><span class="comment">/// \return thread ID of owner thread or NULL when mutex was not acquired.</span></div>
<div class="line"><span class="comment"></span>osThreadId_t <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#ga7f9a7666df0978738cd570cb700b83fb">osMutexGetOwner</a> (osMutexId_t mutex_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a Mutex object.</span></div>
<div class="line"><span class="comment">/// \param[in] mutex_id mutex ID obtained by \ref osMutexNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__MutexMgmt.html#gabee73ad227ba4587d3db12ef9bd582bc">osMutexDelete</a> (osMutexId_t mutex_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Semaphore Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a Semaphore object.</span></div>
<div class="line"><span class="comment">/// \param[in] max_count maximum number of available tokens.</span></div>
<div class="line"><span class="comment">/// \param[in] initial_count initial number of available tokens.</span></div>
<div class="line"><span class="comment">/// \param[in] attr semaphore attributes; NULL: default values.</span></div>
<div class="line"><span class="comment">/// \return semaphore ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osSemaphoreId_t <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga2a39806ace781a0008a4374ca701b14a">osSemaphoreNew</a> (uint32_t max_count, uint32_t initial_count, <span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#structosSemaphoreAttr__t">osSemaphoreAttr_t</a> *attr);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get name of a Semaphore object.</span></div>
<div class="line"><span class="comment">/// \param[in] semaphore_id semaphore ID obtained by \ref osSemaphoreNew.</span></div>
<div class="line"><span class="comment">/// \return name as NULL terminated string.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga9586952051f00285f1482dbe6695bbc4">osSemaphoreGetName</a> (osSemaphoreId_t semaphore_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Acquire a Semaphore token or timeout if no tokens are available.</span></div>
<div class="line"><span class="comment">/// \param[in] semaphore_id semaphore ID obtained by \ref osSemaphoreNew.</span></div>
<div class="line"><span class="comment">/// \param[in] timeout \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga7e94c8b242a0c81f2cc79ec22895c87b">osSemaphoreAcquire</a> (osSemaphoreId_t semaphore_id, uint32_t timeout);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Release a Semaphore token that was acquired by \ref osSemaphoreAcquire.</span></div>
<div class="line"><span class="comment">/// \param[in] semaphore_id semaphore ID obtained by \ref osSemaphoreNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga0abcee1b5449d7a6928fb9248c690bb6">osSemaphoreRelease</a> (osSemaphoreId_t semaphore_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get current Semaphore token count.</span></div>
<div class="line"><span class="comment">/// \param[in] semaphore_id semaphore ID obtained by \ref osSemaphoreNew.</span></div>
<div class="line"><span class="comment">/// \return number of tokens available.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga7559d4dff3cda9992fc5ab5de3e74c70">osSemaphoreGetCount</a> (osSemaphoreId_t semaphore_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a Semaphore object.</span></div>
<div class="line"><span class="comment">/// \param[in] semaphore_id semaphore ID obtained by \ref osSemaphoreNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__SemaphoreMgmt.html#ga81258ce9c67fa89f07cc49d2e136cd88">osSemaphoreDelete</a> (osSemaphoreId_t semaphore_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Memory Pool Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a Memory Pool object.</span></div>
<div class="line"><span class="comment">/// \param[in] block_count maximum number of memory blocks in memory pool.</span></div>
<div class="line"><span class="comment">/// \param[in] block_size memory block size in bytes.</span></div>
<div class="line"><span class="comment">/// \param[in] attr memory pool attributes; NULL: default values.</span></div>
<div class="line"><span class="comment">/// \return memory pool ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osMemoryPoolId_t <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga497ced5d72dc5cd405c4c418516220dc">osMemoryPoolNew</a> (uint32_t block_count, uint32_t block_size, <span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#structosMemoryPoolAttr__t">osMemoryPoolAttr_t</a> *attr);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get name of a Memory Pool object.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \return name as NULL terminated string.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gab414a1e138205a55820acfa277c8f386">osMemoryPoolGetName</a> (osMemoryPoolId_t mp_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Allocate a memory block from a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \param[in] timeout \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return address of the allocated memory block or NULL in case of no memory is available.</span></div>
<div class="line"><span class="comment"></span><span class="keywordtype">void</span> *<a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga8ead54e99ccb8f112356c88f99d38fbe">osMemoryPoolAlloc</a> (osMemoryPoolId_t mp_id, uint32_t timeout);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Return an allocated memory block back to a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \param[in] block address of the allocated memory block to be returned to the memory pool.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gabb4f4560daa6d1f8c8789082ee186d16">osMemoryPoolFree</a> (osMemoryPoolId_t mp_id, <span class="keywordtype">void</span> *block);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get maximum number of memory blocks in a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \return maximum number of memory blocks.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gad696e94bfbe28f0b6613f9303fdf6a37">osMemoryPoolGetCapacity</a> (osMemoryPoolId_t mp_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get memory block size in a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \return memory block size in bytes.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#gab2bf059b7fa7679c3cccdaeec60b6c0e">osMemoryPoolGetBlockSize</a> (osMemoryPoolId_t mp_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get number of memory blocks used in a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \return number of memory blocks used.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga958a9449bff8c95ce213de98eef5739d">osMemoryPoolGetCount</a> (osMemoryPoolId_t mp_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get number of memory blocks available in a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \return number of memory blocks available.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga0394cffa9479a7994e3b03c79c1cb909">osMemoryPoolGetSpace</a> (osMemoryPoolId_t mp_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a Memory Pool object.</span></div>
<div class="line"><span class="comment">/// \param[in] mp_id memory pool ID obtained by \ref osMemoryPoolNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__PoolMgmt.html#ga8c39e7e5cd2b9eda907466808e59d62e">osMemoryPoolDelete</a> (osMemoryPoolId_t mp_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="comment">// ==== Message Queue Management Functions ====</span></div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Create and Initialize a Message Queue object.</span></div>
<div class="line"><span class="comment">/// \param[in] msg_count maximum number of messages in queue.</span></div>
<div class="line"><span class="comment">/// \param[in] msg_size maximum message size in bytes.</span></div>
<div class="line"><span class="comment">/// \param[in] attr message queue attributes; NULL: default values.</span></div>
<div class="line"><span class="comment">/// \return message queue ID for reference by other functions or NULL in case of error.</span></div>
<div class="line"><span class="comment"></span>osMessageQueueId_t <a class="code" href="group__CMSIS__RTOS__Message.html#ga24e895a00f9d484db33aaf784c57bfed">osMessageQueueNew</a> (uint32_t msg_count, uint32_t msg_size, <span class="keyword">const</span> <a class="code" href="group__CMSIS__RTOS__Message.html#structosMessageQueueAttr__t">osMessageQueueAttr_t</a> *attr);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get name of a Message Queue object.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \return name as NULL terminated string.</span></div>
<div class="line"><span class="comment"></span><span class="keyword">const</span> <span class="keywordtype">char</span> *<a class="code" href="group__CMSIS__RTOS__Message.html#gae7cf7bf2b97a5ae481fb60fcce99247a">osMessageQueueGetName</a> (osMessageQueueId_t mq_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Put a Message into a Queue or timeout if Queue is full.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \param[in] msg_ptr pointer to buffer with message to put into a queue.</span></div>
<div class="line"><span class="comment">/// \param[in] msg_prio message priority.</span></div>
<div class="line"><span class="comment">/// \param[in] timeout \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__Message.html#gadd5c8996850d1213976ba89cda689acc">osMessageQueuePut</a> (osMessageQueueId_t mq_id, <span class="keyword">const</span> <span class="keywordtype">void</span> *msg_ptr, uint8_t msg_prio, uint32_t timeout);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get a Message from a Queue or timeout if Queue is empty.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \param[out] msg_ptr pointer to buffer for message to get from a queue.</span></div>
<div class="line"><span class="comment">/// \param[out] msg_prio pointer to buffer for message priority or NULL.</span></div>
<div class="line"><span class="comment">/// \param[in] timeout \ref CMSIS_RTOS_TimeOutValue or 0 in case of no time-out.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__Message.html#gad90d4959466a7a65105061da8256ab9e">osMessageQueueGet</a> (osMessageQueueId_t mq_id, <span class="keywordtype">void</span> *msg_ptr, uint8_t *msg_prio, uint32_t timeout);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get maximum number of messages in a Message Queue.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \return maximum number of messages.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__Message.html#gac24f87d4f395e9e9c900c320e45ade8a">osMessageQueueGetCapacity</a> (osMessageQueueId_t mq_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get maximum message size in a Memory Pool.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \return maximum message size in bytes.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__Message.html#ga96d3d84069b20359de48109e28a1a89e">osMessageQueueGetMsgSize</a> (osMessageQueueId_t mq_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get number of queued messages in a Message Queue.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \return number of queued messages.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__Message.html#ga6a32ac394fcff568b251c160cc3014b2">osMessageQueueGetCount</a> (osMessageQueueId_t mq_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Get number of available slots for messages in a Message Queue.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \return number of available slots for messages.</span></div>
<div class="line"><span class="comment"></span>uint32_t <a class="code" href="group__CMSIS__RTOS__Message.html#gaddf0904427436dd3880d46263c2dc9fa">osMessageQueueGetSpace</a> (osMessageQueueId_t mq_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Reset a Message Queue to initial empty state.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__Message.html#gac6dce7f9ad132d266292c2e979d861b4">osMessageQueueReset</a> (osMessageQueueId_t mq_id);</div>
<div class="line"> <span class="comment"></span></div>
<div class="line"><span class="comment">/// Delete a Message Queue object.</span></div>
<div class="line"><span class="comment">/// \param[in] mq_id message queue ID obtained by \ref osMessageQueueNew.</span></div>
<div class="line"><span class="comment">/// \return status code that indicates the execution status of the function.</span></div>
<div class="line"><span class="comment"></span><a class="code" href="group__CMSIS__RTOS__Definitions.html#ga6c0dbe6069e4e7f47bb4cd32ae2b813e">osStatus_t</a> <a class="code" href="group__CMSIS__RTOS__Message.html#gaba987f665444e0d83fa6a3a68bc72abe">osMessageQueueDelete</a> (osMessageQueueId_t mq_id);</div>
<div class="line"> </div>
<div class="line"> </div>
<div class="line"><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><span class="preprocessor"></span>}</div>
<div class="line"><span class="preprocessor">#endif</span></div>
<div class="line"><span class="preprocessor"></span> </div>
<div class="line"><span class="preprocessor">#endif // CMSIS_OS2_H_</span></div>
</div><!-- fragment --> </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 Feb 8 2017 10:21:03 for CMSIS-RTOS2 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>