]> Git Repo - pico-vscode.git/blob - web/docs/group__pico__async__context.html
Merge branch 'main' into main
[pico-vscode.git] / web / docs / group__pico__async__context.html
1 <!-- HTML header for doxygen 1.8.20-->
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3 <html xmlns="http://www.w3.org/1999/xhtml">
4 <head>
5         <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
6         <meta http-equiv="X-UA-Compatible" content="IE=9"/>
7         <meta name="generator" content="Doxygen 1.9.4"/>
8         <meta name="viewport" content="width=device-width, initial-scale=1"/>
9         <title>Raspberry Pi Pico SDK: pico_async_context</title>
10         <!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
11         <script type="text/javascript" src="jquery.js"></script>
12         <script type="text/javascript" src="dynsections.js"></script>
13         <link href="navtree.css" rel="stylesheet" type="text/css"/>
14 <script type="text/javascript" src="resize.js"></script>
15 <script type="text/javascript" src="navtreedata.js"></script>
16 <script type="text/javascript" src="navtree.js"></script>
17         <link href="search/search.css" rel="stylesheet" type="text/css"/>
18 <script type="text/javascript" src="search/searchdata.js"></script>
19 <script type="text/javascript" src="search/search.js"></script>
20     <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
21         <link href="doxygen.css" rel="stylesheet" type="text/css" />
22         <link href="normalise.css" rel="stylesheet" type="text/css"/>
23 <link href="main.css" rel="stylesheet" type="text/css"/>
24 <link href="styles.css" rel="stylesheet" type="text/css"/>
25 </head>
26 <body>
27         <div class="navigation-mobile">
28                 <div class="logo--mobile">
29                         <a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
30                 </div>
31                 <div class="navigation-toggle">
32                         <span class="line-1"></span>
33                         <span class="line-2">
34                                 <p>Menu Toggle</p>
35                         </span>
36                         <span class="line-3"></span>
37                 </div>
38         </div>
39         <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
40                 <div class="logo">
41                         <a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
42                         <span style="display: inline-block; margin-top: 10px;">
43                                 v2.0.0
44                         </span>
45                 </div>
46                 <div class="navigation-footer">
47                         <img src="logo-mobile.svg" alt="Raspberry Pi">
48                         <a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
49                 </div>
50 <!--            <div class="search">
51                         <form>
52                                 <input type="search" name="search" id="search" placeholder="Search">
53                                 <input type="submit" value="Search">
54                         </form>
55                 </div> -->
56 <!-- Generated by Doxygen 1.9.4 -->
57 <script type="text/javascript">
58 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
59 var searchBox = new SearchBox("searchBox", "search",'Search','.html');
60 /* @license-end */
61 </script>
62 <script type="text/javascript" src="menudata.js"></script>
63 <script type="text/javascript" src="menu.js"></script>
64 <script type="text/javascript">
65 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
66 $(function() {
67   initMenu('',true,false,'search.php','Search');
68   $(document).ready(function() { init_search(); });
69 });
70 /* @license-end */
71 </script>
72 <div id="main-nav"></div>
73 </div><!-- top -->
74 <div id="side-nav" class="ui-resizable side-nav-resizable">
75   <div id="nav-tree">
76     <div id="nav-tree-contents">
77       <div id="nav-sync" class="sync"></div>
78     </div>
79   </div>
80   <div id="splitbar" style="-moz-user-select:none;" 
81        class="ui-resizable-handle">
82   </div>
83 </div>
84 <script type="text/javascript">
85 /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
86 $(document).ready(function(){initNavTree('group__pico__async__context.html',''); initResizable(); });
87 /* @license-end */
88 </script>
89 <div id="doc-content">
90 <!-- window showing the filter options -->
91 <div id="MSearchSelectWindow"
92      onmouseover="return searchBox.OnSearchSelectShow()"
93      onmouseout="return searchBox.OnSearchSelectHide()"
94      onkeydown="return searchBox.OnSearchSelectKey(event)">
95 </div>
96
97 <!-- iframe showing the search results (closed by default) -->
98 <div id="MSearchResultsWindow">
99 <iframe src="javascript:void(0)" frameborder="0" 
100         name="MSearchResults" id="MSearchResults">
101 </iframe>
102 </div>
103
104 <div class="header">
105   <div class="summary">
106 <a href="#groups">Modules</a> &#124;
107 <a href="#nested-classes">Data Structures</a> &#124;
108 <a href="#typedef-members">Typedefs</a> &#124;
109 <a href="#func-members">Functions</a>  </div>
110   <div class="headertitle"><div class="title">pico_async_context<div class="ingroups"><a class="el" href="group__high__level.html">High Level APIs</a></div></div></div>
111 </div><!--header-->
112 <div class="contents">
113
114 <p>An <a class="el" href="structasync__context.html">async_context</a> provides a logically single-threaded context for performing work, and responding to asynchronous events. Thus an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> instance is suitable for servicing third-party libraries that are not re-entrant.  
115 <a href="#details">More...</a></p>
116 <table class="memberdecls">
117 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="groups" name="groups"></a>
118 Modules</h2></td></tr>
119 <tr class="memitem:group__async__context__freertos"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__async__context__freertos.html">async_context_freertos</a></td></tr>
120 <tr class="memdesc:group__async__context__freertos"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="structasync__context__freertos.html">async_context_freertos</a> provides an implementation of <a class="el" href="structasync__context.html">async_context</a> that handles asynchronous work in a separate FreeRTOS task. <br /></td></tr>
121 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
122 <tr class="memitem:group__async__context__poll"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__async__context__poll.html">async_context_poll</a></td></tr>
123 <tr class="memdesc:group__async__context__poll"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="structasync__context__poll.html">async_context_poll</a> provides an implementation of <a class="el" href="structasync__context.html">async_context</a> that is intended for use with a simple polling loop on one core. It is not thread safe. <br /></td></tr>
124 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
125 <tr class="memitem:group__async__context__threadsafe__background"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__async__context__threadsafe__background.html">async_context_threadsafe_background</a></td></tr>
126 <tr class="memdesc:group__async__context__threadsafe__background"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="structasync__context__threadsafe__background.html">async_context_threadsafe_background</a> provides an implementation of <a class="el" href="structasync__context.html">async_context</a> that handles asynchronous work in a low priority IRQ, and there is no need for the user to poll for work <br /></td></tr>
127 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
128 </table><table class="memberdecls">
129 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
130 Data Structures</h2></td></tr>
131 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structasync__work__on__timeout.html">async_work_on_timeout</a></td></tr>
132 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A "timeout" instance used by an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.  <a href="structasync__work__on__timeout.html#details">More...</a><br /></td></tr>
133 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
134 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structasync__when__pending__worker.html">async_when_pending_worker</a></td></tr>
135 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A "worker" instance used by an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.  <a href="structasync__when__pending__worker.html#details">More...</a><br /></td></tr>
136 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
137 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structasync__context__type.html">async_context_type</a></td></tr>
138 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation of an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> type, providing methods common to that type.  <a href="structasync__context__type.html#details">More...</a><br /></td></tr>
139 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
140 <tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structasync__context.html">async_context</a></td></tr>
141 <tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Base structure type of all async_contexts. For details about its use, see <a class="el" href="group__pico__async__context.html">pico_async_context</a>.  <a href="structasync__context.html#details">More...</a><br /></td></tr>
142 <tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
143 </table><table class="memberdecls">
144 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="typedef-members" name="typedef-members"></a>
145 Typedefs</h2></td></tr>
146 <tr class="memitem:ga74aa4914d98b190d2d4d84d7ff6b469e"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structasync__work__on__timeout.html">async_work_on_timeout</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a></td></tr>
147 <tr class="memdesc:ga74aa4914d98b190d2d4d84d7ff6b469e"><td class="mdescLeft">&#160;</td><td class="mdescRight">A "timeout" instance used by an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.  <a href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">More...</a><br /></td></tr>
148 <tr class="separator:ga74aa4914d98b190d2d4d84d7ff6b469e"><td class="memSeparator" colspan="2">&#160;</td></tr>
149 <tr class="memitem:ga975e8fa20352873b7ac76b06a497eb2b"><td class="memItemLeft" align="right" valign="top">typedef struct <a class="el" href="structasync__when__pending__worker.html">async_when_pending_worker</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a></td></tr>
150 <tr class="memdesc:ga975e8fa20352873b7ac76b06a497eb2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">A "worker" instance used by an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.  <a href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">More...</a><br /></td></tr>
151 <tr class="separator:ga975e8fa20352873b7ac76b06a497eb2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
152 <tr class="memitem:ga1dd6a1433c144f4c4ea28d54176d9fc7"><td class="memItemLeft" align="right" valign="top"><a id="ga1dd6a1433c144f4c4ea28d54176d9fc7" name="ga1dd6a1433c144f4c4ea28d54176d9fc7"></a>
153 typedef struct <a class="el" href="structasync__context__type.html">async_context_type</a>&#160;</td><td class="memItemRight" valign="bottom"><b>async_context_type_t</b></td></tr>
154 <tr class="memdesc:ga1dd6a1433c144f4c4ea28d54176d9fc7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Implementation of an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> type, providing methods common to that type. <br /></td></tr>
155 <tr class="separator:ga1dd6a1433c144f4c4ea28d54176d9fc7"><td class="memSeparator" colspan="2">&#160;</td></tr>
156 </table><table class="memberdecls">
157 <tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="func-members" name="func-members"></a>
158 Functions</h2></td></tr>
159 <tr class="memitem:ga404d5e6a8ef79159c692dc040f2ded44"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga404d5e6a8ef79159c692dc040f2ded44">async_context_acquire_lock_blocking</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context)</td></tr>
160 <tr class="memdesc:ga404d5e6a8ef79159c692dc040f2ded44"><td class="mdescLeft">&#160;</td><td class="mdescRight">Acquire the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> lock.  <a href="group__pico__async__context.html#ga404d5e6a8ef79159c692dc040f2ded44">More...</a><br /></td></tr>
161 <tr class="separator:ga404d5e6a8ef79159c692dc040f2ded44"><td class="memSeparator" colspan="2">&#160;</td></tr>
162 <tr class="memitem:gada9eb6dbc0442ba9cbb44a41526f3b9f"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#gada9eb6dbc0442ba9cbb44a41526f3b9f">async_context_release_lock</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context)</td></tr>
163 <tr class="memdesc:gada9eb6dbc0442ba9cbb44a41526f3b9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Release the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> lock.  <a href="group__pico__async__context.html#gada9eb6dbc0442ba9cbb44a41526f3b9f">More...</a><br /></td></tr>
164 <tr class="separator:gada9eb6dbc0442ba9cbb44a41526f3b9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
165 <tr class="memitem:ga032285b9d1a4aa325813cdbcc1f00a75"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga032285b9d1a4aa325813cdbcc1f00a75">async_context_lock_check</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context)</td></tr>
166 <tr class="memdesc:ga032285b9d1a4aa325813cdbcc1f00a75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assert if the caller does not own the lock for the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.  <a href="group__pico__async__context.html#ga032285b9d1a4aa325813cdbcc1f00a75">More...</a><br /></td></tr>
167 <tr class="separator:ga032285b9d1a4aa325813cdbcc1f00a75"><td class="memSeparator" colspan="2">&#160;</td></tr>
168 <tr class="memitem:gaa4b239c998978b97eabe2aa2ad659720"><td class="memItemLeft" align="right" valign="top">static uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#gaa4b239c998978b97eabe2aa2ad659720">async_context_execute_sync</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, uint32_t(*func)(void *param), void *param)</td></tr>
169 <tr class="memdesc:gaa4b239c998978b97eabe2aa2ad659720"><td class="mdescLeft">&#160;</td><td class="mdescRight">Execute work synchronously on the core the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> belongs to.  <a href="group__pico__async__context.html#gaa4b239c998978b97eabe2aa2ad659720">More...</a><br /></td></tr>
170 <tr class="separator:gaa4b239c998978b97eabe2aa2ad659720"><td class="memSeparator" colspan="2">&#160;</td></tr>
171 <tr class="memitem:gad4ea52957b11c70d908e5af6f0c715ab"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#gad4ea52957b11c70d908e5af6f0c715ab">async_context_add_at_time_worker</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *worker)</td></tr>
172 <tr class="memdesc:gad4ea52957b11c70d908e5af6f0c715ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add an "at time" worker to a context.  <a href="group__pico__async__context.html#gad4ea52957b11c70d908e5af6f0c715ab">More...</a><br /></td></tr>
173 <tr class="separator:gad4ea52957b11c70d908e5af6f0c715ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
174 <tr class="memitem:ga8ef9fba4dd680a576d94c82b40b10fc3"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga8ef9fba4dd680a576d94c82b40b10fc3">async_context_add_at_time_worker_at</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *worker, <a class="el" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> at)</td></tr>
175 <tr class="memdesc:ga8ef9fba4dd680a576d94c82b40b10fc3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add an "at time" worker to a context.  <a href="group__pico__async__context.html#ga8ef9fba4dd680a576d94c82b40b10fc3">More...</a><br /></td></tr>
176 <tr class="separator:ga8ef9fba4dd680a576d94c82b40b10fc3"><td class="memSeparator" colspan="2">&#160;</td></tr>
177 <tr class="memitem:gae0792d86734a6e30b2f043b8eba42438"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#gae0792d86734a6e30b2f043b8eba42438">async_context_add_at_time_worker_in_ms</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *worker, uint32_t ms)</td></tr>
178 <tr class="memdesc:gae0792d86734a6e30b2f043b8eba42438"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add an "at time" worker to a context.  <a href="group__pico__async__context.html#gae0792d86734a6e30b2f043b8eba42438">More...</a><br /></td></tr>
179 <tr class="separator:gae0792d86734a6e30b2f043b8eba42438"><td class="memSeparator" colspan="2">&#160;</td></tr>
180 <tr class="memitem:ga58c96cc02b63e12874cae38442c7c4dd"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga58c96cc02b63e12874cae38442c7c4dd">async_context_remove_at_time_worker</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *worker)</td></tr>
181 <tr class="memdesc:ga58c96cc02b63e12874cae38442c7c4dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove an "at time" worker from a context.  <a href="group__pico__async__context.html#ga58c96cc02b63e12874cae38442c7c4dd">More...</a><br /></td></tr>
182 <tr class="separator:ga58c96cc02b63e12874cae38442c7c4dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
183 <tr class="memitem:ga9d42179771bcc8c99124c43dcc7b1350"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga9d42179771bcc8c99124c43dcc7b1350">async_context_add_when_pending_worker</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a> *worker)</td></tr>
184 <tr class="memdesc:ga9d42179771bcc8c99124c43dcc7b1350"><td class="mdescLeft">&#160;</td><td class="mdescRight">Add a "when pending" worker to a context.  <a href="group__pico__async__context.html#ga9d42179771bcc8c99124c43dcc7b1350">More...</a><br /></td></tr>
185 <tr class="separator:ga9d42179771bcc8c99124c43dcc7b1350"><td class="memSeparator" colspan="2">&#160;</td></tr>
186 <tr class="memitem:ga72b40c2505cd08cb542c3f1759b9e1d5"><td class="memItemLeft" align="right" valign="top">static bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga72b40c2505cd08cb542c3f1759b9e1d5">async_context_remove_when_pending_worker</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a> *worker)</td></tr>
187 <tr class="memdesc:ga72b40c2505cd08cb542c3f1759b9e1d5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Remove a "when pending" worker from a context.  <a href="group__pico__async__context.html#ga72b40c2505cd08cb542c3f1759b9e1d5">More...</a><br /></td></tr>
188 <tr class="separator:ga72b40c2505cd08cb542c3f1759b9e1d5"><td class="memSeparator" colspan="2">&#160;</td></tr>
189 <tr class="memitem:ga1ca51536a6f0344cfcbd30bd09fbaec2"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga1ca51536a6f0344cfcbd30bd09fbaec2">async_context_set_work_pending</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a> *worker)</td></tr>
190 <tr class="memdesc:ga1ca51536a6f0344cfcbd30bd09fbaec2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Mark a "when pending" worker as having work pending.  <a href="group__pico__async__context.html#ga1ca51536a6f0344cfcbd30bd09fbaec2">More...</a><br /></td></tr>
191 <tr class="separator:ga1ca51536a6f0344cfcbd30bd09fbaec2"><td class="memSeparator" colspan="2">&#160;</td></tr>
192 <tr class="memitem:gafdb322c3f1043265624988215d3a8df9"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#gafdb322c3f1043265624988215d3a8df9">async_context_poll</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context)</td></tr>
193 <tr class="memdesc:gafdb322c3f1043265624988215d3a8df9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Perform any pending work for polling style <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.  <a href="group__pico__async__context.html#gafdb322c3f1043265624988215d3a8df9">More...</a><br /></td></tr>
194 <tr class="separator:gafdb322c3f1043265624988215d3a8df9"><td class="memSeparator" colspan="2">&#160;</td></tr>
195 <tr class="memitem:gad2f27b21dbaa264dfe59ef0f59de11db"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#gad2f27b21dbaa264dfe59ef0f59de11db">async_context_wait_until</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> until)</td></tr>
196 <tr class="memdesc:gad2f27b21dbaa264dfe59ef0f59de11db"><td class="mdescLeft">&#160;</td><td class="mdescRight">sleep until the specified time in an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> callback safe way  <a href="group__pico__async__context.html#gad2f27b21dbaa264dfe59ef0f59de11db">More...</a><br /></td></tr>
197 <tr class="separator:gad2f27b21dbaa264dfe59ef0f59de11db"><td class="memSeparator" colspan="2">&#160;</td></tr>
198 <tr class="memitem:ga6207f562c0b69c7a75cd81a783eb1055"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga6207f562c0b69c7a75cd81a783eb1055">async_context_wait_for_work_until</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, <a class="el" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a> until)</td></tr>
199 <tr class="memdesc:ga6207f562c0b69c7a75cd81a783eb1055"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block until work needs to be done or the specified time has been reached.  <a href="group__pico__async__context.html#ga6207f562c0b69c7a75cd81a783eb1055">More...</a><br /></td></tr>
200 <tr class="separator:ga6207f562c0b69c7a75cd81a783eb1055"><td class="memSeparator" colspan="2">&#160;</td></tr>
201 <tr class="memitem:gaae7ea2fed2b274a63455773d056f6d4c"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#gaae7ea2fed2b274a63455773d056f6d4c">async_context_wait_for_work_ms</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context, uint32_t ms)</td></tr>
202 <tr class="memdesc:gaae7ea2fed2b274a63455773d056f6d4c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block until work needs to be done or the specified number of milliseconds have passed.  <a href="group__pico__async__context.html#gaae7ea2fed2b274a63455773d056f6d4c">More...</a><br /></td></tr>
203 <tr class="separator:gaae7ea2fed2b274a63455773d056f6d4c"><td class="memSeparator" colspan="2">&#160;</td></tr>
204 <tr class="memitem:ga604afdcf2e76f1bf99df469edfadf7eb"><td class="memItemLeft" align="right" valign="top">static uint&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga604afdcf2e76f1bf99df469edfadf7eb">async_context_core_num</a> (const <a class="el" href="structasync__context.html">async_context_t</a> *context)</td></tr>
205 <tr class="memdesc:ga604afdcf2e76f1bf99df469edfadf7eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the processor core this <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> belongs to.  <a href="group__pico__async__context.html#ga604afdcf2e76f1bf99df469edfadf7eb">More...</a><br /></td></tr>
206 <tr class="separator:ga604afdcf2e76f1bf99df469edfadf7eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
207 <tr class="memitem:ga66d09e106e04d70971d4fb6f09d5d949"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__pico__async__context.html#ga66d09e106e04d70971d4fb6f09d5d949">async_context_deinit</a> (<a class="el" href="structasync__context.html">async_context_t</a> *context)</td></tr>
208 <tr class="memdesc:ga66d09e106e04d70971d4fb6f09d5d949"><td class="mdescLeft">&#160;</td><td class="mdescRight">End <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> processing, and free any resources.  <a href="group__pico__async__context.html#ga66d09e106e04d70971d4fb6f09d5d949">More...</a><br /></td></tr>
209 <tr class="separator:ga66d09e106e04d70971d4fb6f09d5d949"><td class="memSeparator" colspan="2">&#160;</td></tr>
210 </table>
211 <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
212 <p >An <a class="el" href="structasync__context.html">async_context</a> provides a logically single-threaded context for performing work, and responding to asynchronous events. Thus an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> instance is suitable for servicing third-party libraries that are not re-entrant. </p>
213 <p >The "context" in <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> refers to the fact that when calling workers or timeouts within the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> various pre-conditions hold:</p>
214 <ol>
215 <li>
216 That there is a single logical thread of execution; i.e. that the context does not call any worker functions concurrently. </li>
217 <li>
218 That the context always calls workers from the same processor core, as most uses of <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> rely on interaction with IRQs which are themselves core-specific. </li>
219 </ol>
220 <p >THe <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> provides two mechanisms for asynchronous work:</p>
221 <ul>
222 <li><em>when_pending</em> workers, which are processed whenever they have work pending. See <a class="el" href="group__pico__async__context.html#ga9d42179771bcc8c99124c43dcc7b1350">async_context_add_when_pending_worker</a>, <a class="el" href="group__pico__async__context.html#ga72b40c2505cd08cb542c3f1759b9e1d5">async_context_remove_when_pending_worker</a>, and <a class="el" href="group__pico__async__context.html#ga1ca51536a6f0344cfcbd30bd09fbaec2">async_context_set_work_pending</a>, the latter of which can be used from an interrupt handler to signal that servicing work is required to be performed by the worker from the regular <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.</li>
223 <li><em>at_time</em> workers, that are executed after at a specific time.</li>
224 </ul>
225 <p >Note: "when pending" workers with work pending are executed before "at time" workers.</p>
226 <p >The <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> provides locking mechanisms, see <a class="el" href="group__pico__async__context.html#ga404d5e6a8ef79159c692dc040f2ded44">async_context_acquire_lock_blocking</a>, <a class="el" href="group__pico__async__context.html#gada9eb6dbc0442ba9cbb44a41526f3b9f">async_context_release_lock</a> and <a class="el" href="group__pico__async__context.html#ga032285b9d1a4aa325813cdbcc1f00a75">async_context_lock_check</a> which can be used by external code to ensure execution of external code does not happen concurrently with worker code. Locked code runs on the calling core, however <a class="el" href="group__pico__async__context.html#gaa4b239c998978b97eabe2aa2ad659720">async_context_execute_sync</a> is provided to synchronously run a function from the core of the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>.</p>
227 <p >The SDK ships with the following default async_contexts:</p>
228 <p ><a class="el" href="structasync__context__poll.html">async_context_poll</a> - this context is not thread-safe, and the user is responsible for calling <a class="el" href="group__pico__async__context.html#gafdb322c3f1043265624988215d3a8df9">async_context_poll()</a> periodically, and can use <a class="el" href="group__pico__async__context.html#ga6207f562c0b69c7a75cd81a783eb1055" title="Block until work needs to be done or the specified time has been reached.">async_context_wait_for_work_until()</a> to sleep between calls until work is needed if the user has nothing else to do.</p>
229 <p ><a class="el" href="structasync__context__threadsafe__background.html">async_context_threadsafe_background</a> - in order to work in the background, a low priority IRQ is used to handle callbacks. Code is usually invoked from this IRQ context, but may be invoked after any other code that uses the async context in another (non-IRQ) context on the same core. Calling <a class="el" href="group__pico__async__context.html#gafdb322c3f1043265624988215d3a8df9">async_context_poll()</a> is not required, and is a no-op. This context implements <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> locking and is thus safe to call from either core, according to the specific notes on each API.</p>
230 <p ><a class="el" href="structasync__context__freertos.html">async_context_freertos</a> - Work is performed from a separate "async_context" task, however once again, code may also be invoked after a direct use of the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> on the same core that the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> belongs to. Calling <a class="el" href="group__pico__async__context.html#gafdb322c3f1043265624988215d3a8df9">async_context_poll()</a> is not required, and is a no-op. This context implements <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> locking and is thus safe to call from any task, and from either core, according to the specific notes on each API.</p>
231 <p >Each <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> provides bespoke methods of instantiation which are provided in the corresponding headers (e.g. <a class="el" href="async__context__poll_8h_source.html">async_context_poll.h</a>, <a class="el" href="async__context__threadsafe__background_8h_source.html">async_context_threadsafe_background.h</a>, asycn_context_freertos.h). async_contexts are de-initialized by the common async_context_deint() method.</p>
232 <p >Multiple <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> instances can be used by a single application, and they will operate independently. </p>
233 <h2 class="groupheader">Typedef Documentation</h2>
234 <a id="ga74aa4914d98b190d2d4d84d7ff6b469e" name="ga74aa4914d98b190d2d4d84d7ff6b469e"></a>
235 <h2 class="memtitle"><span class="permalink"><a href="#ga74aa4914d98b190d2d4d84d7ff6b469e">&#9670;&nbsp;</a></span>async_at_time_worker_t</h2>
236
237 <div class="memitem">
238 <div class="memproto">
239       <table class="memname">
240         <tr>
241           <td class="memname">typedef struct <a class="el" href="structasync__work__on__timeout.html">async_work_on_timeout</a> <a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a></td>
242         </tr>
243       </table>
244 </div><div class="memdoc">
245
246 <p>A "timeout" instance used by an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>. </p>
247 <p >A "timeout" represents some future action that must be taken at a specific time. Its methods are called from the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> under lock at the given time</p>
248 <dl class="section see"><dt>See also</dt><dd>async_context_add_worker_at </dd>
249 <dd>
250 async_context_add_worker_in_ms </dd></dl>
251
252 </div>
253 </div>
254 <a id="ga975e8fa20352873b7ac76b06a497eb2b" name="ga975e8fa20352873b7ac76b06a497eb2b"></a>
255 <h2 class="memtitle"><span class="permalink"><a href="#ga975e8fa20352873b7ac76b06a497eb2b">&#9670;&nbsp;</a></span>async_when_pending_worker_t</h2>
256
257 <div class="memitem">
258 <div class="memproto">
259       <table class="memname">
260         <tr>
261           <td class="memname">typedef struct <a class="el" href="structasync__when__pending__worker.html">async_when_pending_worker</a> <a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a></td>
262         </tr>
263       </table>
264 </div><div class="memdoc">
265
266 <p>A "worker" instance used by an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>. </p>
267 <p >A "worker" represents some external entity that must do work in response to some external stimulus (usually an IRQ). Its methods are called from the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> under lock at the given time</p>
268 <dl class="section see"><dt>See also</dt><dd>async_context_add_worker_at </dd>
269 <dd>
270 async_context_add_worker_in_ms </dd></dl>
271
272 </div>
273 </div>
274 <h2 class="groupheader">Function Documentation</h2>
275 <a id="ga404d5e6a8ef79159c692dc040f2ded44" name="ga404d5e6a8ef79159c692dc040f2ded44"></a>
276 <h2 class="memtitle"><span class="permalink"><a href="#ga404d5e6a8ef79159c692dc040f2ded44">&#9670;&nbsp;</a></span>async_context_acquire_lock_blocking()</h2>
277
278 <div class="memitem">
279 <div class="memproto">
280 <table class="mlabels">
281   <tr>
282   <td class="mlabels-left">
283       <table class="memname">
284         <tr>
285           <td class="memname">static void async_context_acquire_lock_blocking </td>
286           <td>(</td>
287           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
288           <td class="paramname"><em>context</em></td><td>)</td>
289           <td></td>
290         </tr>
291       </table>
292   </td>
293   <td class="mlabels-right">
294 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
295   </tr>
296 </table>
297 </div><div class="memdoc">
298
299 <p>Acquire the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> lock. </p>
300 <p >The owner of the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> lock is the logic owner of the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> and other work related to this <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> will not happen concurrently.</p>
301 <p >This method may be called in a nested fashion by the the lock owner.</p>
302 <dl class="section note"><dt>Note</dt><dd>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> lock is nestable by the same caller, so an internal count is maintained</dd>
303 <dd>
304 for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
305 <dl class="params"><dt>Parameters</dt><dd>
306   <table class="params">
307     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a></td></tr>
308   </table>
309   </dd>
310 </dl>
311 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group__pico__async__context.html#gada9eb6dbc0442ba9cbb44a41526f3b9f" title="Release the async_context lock.">async_context_release_lock</a> </dd></dl>
312
313 </div>
314 </div>
315 <a id="gad4ea52957b11c70d908e5af6f0c715ab" name="gad4ea52957b11c70d908e5af6f0c715ab"></a>
316 <h2 class="memtitle"><span class="permalink"><a href="#gad4ea52957b11c70d908e5af6f0c715ab">&#9670;&nbsp;</a></span>async_context_add_at_time_worker()</h2>
317
318 <div class="memitem">
319 <div class="memproto">
320 <table class="mlabels">
321   <tr>
322   <td class="mlabels-left">
323       <table class="memname">
324         <tr>
325           <td class="memname">static bool async_context_add_at_time_worker </td>
326           <td>(</td>
327           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
328           <td class="paramname"><em>context</em>, </td>
329         </tr>
330         <tr>
331           <td class="paramkey"></td>
332           <td></td>
333           <td class="paramtype"><a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *&#160;</td>
334           <td class="paramname"><em>worker</em>&#160;</td>
335         </tr>
336         <tr>
337           <td></td>
338           <td>)</td>
339           <td></td><td></td>
340         </tr>
341       </table>
342   </td>
343   <td class="mlabels-right">
344 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
345   </tr>
346 </table>
347 </div><div class="memdoc">
348
349 <p>Add an "at time" worker to a context. </p>
350 <p >An "at time" worker will run at or after a specific point in time, and is automatically when (just before) it runs.</p>
351 <p >The time to fire is specified in the next_time field of the worker.</p>
352 <dl class="section note"><dt>Note</dt><dd>for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
353 <dl class="params"><dt>Parameters</dt><dd>
354   <table class="params">
355     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
356     <tr><td class="paramname">worker</td><td>the "at time" worker to add </td></tr>
357   </table>
358   </dd>
359 </dl>
360 <dl class="section return"><dt>Returns</dt><dd>true if the worker was added, false if the worker was already present. </dd></dl>
361
362 </div>
363 </div>
364 <a id="ga8ef9fba4dd680a576d94c82b40b10fc3" name="ga8ef9fba4dd680a576d94c82b40b10fc3"></a>
365 <h2 class="memtitle"><span class="permalink"><a href="#ga8ef9fba4dd680a576d94c82b40b10fc3">&#9670;&nbsp;</a></span>async_context_add_at_time_worker_at()</h2>
366
367 <div class="memitem">
368 <div class="memproto">
369 <table class="mlabels">
370   <tr>
371   <td class="mlabels-left">
372       <table class="memname">
373         <tr>
374           <td class="memname">static bool async_context_add_at_time_worker_at </td>
375           <td>(</td>
376           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
377           <td class="paramname"><em>context</em>, </td>
378         </tr>
379         <tr>
380           <td class="paramkey"></td>
381           <td></td>
382           <td class="paramtype"><a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *&#160;</td>
383           <td class="paramname"><em>worker</em>, </td>
384         </tr>
385         <tr>
386           <td class="paramkey"></td>
387           <td></td>
388           <td class="paramtype"><a class="el" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a>&#160;</td>
389           <td class="paramname"><em>at</em>&#160;</td>
390         </tr>
391         <tr>
392           <td></td>
393           <td>)</td>
394           <td></td><td></td>
395         </tr>
396       </table>
397   </td>
398   <td class="mlabels-right">
399 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
400   </tr>
401 </table>
402 </div><div class="memdoc">
403
404 <p>Add an "at time" worker to a context. </p>
405 <p >An "at time" worker will run at or after a specific point in time, and is automatically when (just before) it runs.</p>
406 <p >The time to fire is specified by the at parameter.</p>
407 <dl class="section note"><dt>Note</dt><dd>for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
408 <dl class="params"><dt>Parameters</dt><dd>
409   <table class="params">
410     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
411     <tr><td class="paramname">worker</td><td>the "at time" worker to add </td></tr>
412     <tr><td class="paramname">at</td><td>the time to fire at </td></tr>
413   </table>
414   </dd>
415 </dl>
416 <dl class="section return"><dt>Returns</dt><dd>true if the worker was added, false if the worker was already present. </dd></dl>
417
418 </div>
419 </div>
420 <a id="gae0792d86734a6e30b2f043b8eba42438" name="gae0792d86734a6e30b2f043b8eba42438"></a>
421 <h2 class="memtitle"><span class="permalink"><a href="#gae0792d86734a6e30b2f043b8eba42438">&#9670;&nbsp;</a></span>async_context_add_at_time_worker_in_ms()</h2>
422
423 <div class="memitem">
424 <div class="memproto">
425 <table class="mlabels">
426   <tr>
427   <td class="mlabels-left">
428       <table class="memname">
429         <tr>
430           <td class="memname">static bool async_context_add_at_time_worker_in_ms </td>
431           <td>(</td>
432           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
433           <td class="paramname"><em>context</em>, </td>
434         </tr>
435         <tr>
436           <td class="paramkey"></td>
437           <td></td>
438           <td class="paramtype"><a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *&#160;</td>
439           <td class="paramname"><em>worker</em>, </td>
440         </tr>
441         <tr>
442           <td class="paramkey"></td>
443           <td></td>
444           <td class="paramtype">uint32_t&#160;</td>
445           <td class="paramname"><em>ms</em>&#160;</td>
446         </tr>
447         <tr>
448           <td></td>
449           <td>)</td>
450           <td></td><td></td>
451         </tr>
452       </table>
453   </td>
454   <td class="mlabels-right">
455 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
456   </tr>
457 </table>
458 </div><div class="memdoc">
459
460 <p>Add an "at time" worker to a context. </p>
461 <p >An "at time" worker will run at or after a specific point in time, and is automatically when (just before) it runs.</p>
462 <p >The time to fire is specified by a delay via the ms parameter</p>
463 <dl class="section note"><dt>Note</dt><dd>for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
464 <dl class="params"><dt>Parameters</dt><dd>
465   <table class="params">
466     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
467     <tr><td class="paramname">worker</td><td>the "at time" worker to add </td></tr>
468     <tr><td class="paramname">ms</td><td>the number of milliseconds from now to fire after </td></tr>
469   </table>
470   </dd>
471 </dl>
472 <dl class="section return"><dt>Returns</dt><dd>true if the worker was added, false if the worker was already present. </dd></dl>
473
474 </div>
475 </div>
476 <a id="ga9d42179771bcc8c99124c43dcc7b1350" name="ga9d42179771bcc8c99124c43dcc7b1350"></a>
477 <h2 class="memtitle"><span class="permalink"><a href="#ga9d42179771bcc8c99124c43dcc7b1350">&#9670;&nbsp;</a></span>async_context_add_when_pending_worker()</h2>
478
479 <div class="memitem">
480 <div class="memproto">
481 <table class="mlabels">
482   <tr>
483   <td class="mlabels-left">
484       <table class="memname">
485         <tr>
486           <td class="memname">static bool async_context_add_when_pending_worker </td>
487           <td>(</td>
488           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
489           <td class="paramname"><em>context</em>, </td>
490         </tr>
491         <tr>
492           <td class="paramkey"></td>
493           <td></td>
494           <td class="paramtype"><a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a> *&#160;</td>
495           <td class="paramname"><em>worker</em>&#160;</td>
496         </tr>
497         <tr>
498           <td></td>
499           <td>)</td>
500           <td></td><td></td>
501         </tr>
502       </table>
503   </td>
504   <td class="mlabels-right">
505 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
506   </tr>
507 </table>
508 </div><div class="memdoc">
509
510 <p>Add a "when pending" worker to a context. </p>
511 <p >An "when pending" worker will run when it is pending (can be set via <a class="el" href="group__pico__async__context.html#ga1ca51536a6f0344cfcbd30bd09fbaec2">async_context_set_work_pending</a>), and is NOT automatically removed when it runs.</p>
512 <p >The time to fire is specified by a delay via the ms parameter</p>
513 <dl class="section note"><dt>Note</dt><dd>for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
514 <dl class="params"><dt>Parameters</dt><dd>
515   <table class="params">
516     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
517     <tr><td class="paramname">worker</td><td>the "when pending" worker to add </td></tr>
518   </table>
519   </dd>
520 </dl>
521 <dl class="section return"><dt>Returns</dt><dd>true if the worker was added, false if the worker was already present. </dd></dl>
522
523 </div>
524 </div>
525 <a id="ga604afdcf2e76f1bf99df469edfadf7eb" name="ga604afdcf2e76f1bf99df469edfadf7eb"></a>
526 <h2 class="memtitle"><span class="permalink"><a href="#ga604afdcf2e76f1bf99df469edfadf7eb">&#9670;&nbsp;</a></span>async_context_core_num()</h2>
527
528 <div class="memitem">
529 <div class="memproto">
530 <table class="mlabels">
531   <tr>
532   <td class="mlabels-left">
533       <table class="memname">
534         <tr>
535           <td class="memname">static uint async_context_core_num </td>
536           <td>(</td>
537           <td class="paramtype">const <a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
538           <td class="paramname"><em>context</em></td><td>)</td>
539           <td></td>
540         </tr>
541       </table>
542   </td>
543   <td class="mlabels-right">
544 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
545   </tr>
546 </table>
547 </div><div class="memdoc">
548
549 <p>Return the processor core this <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> belongs to. </p>
550 <dl class="params"><dt>Parameters</dt><dd>
551   <table class="params">
552     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
553   </table>
554   </dd>
555 </dl>
556 <dl class="section return"><dt>Returns</dt><dd>the physical core number </dd></dl>
557
558 </div>
559 </div>
560 <a id="ga66d09e106e04d70971d4fb6f09d5d949" name="ga66d09e106e04d70971d4fb6f09d5d949"></a>
561 <h2 class="memtitle"><span class="permalink"><a href="#ga66d09e106e04d70971d4fb6f09d5d949">&#9670;&nbsp;</a></span>async_context_deinit()</h2>
562
563 <div class="memitem">
564 <div class="memproto">
565 <table class="mlabels">
566   <tr>
567   <td class="mlabels-left">
568       <table class="memname">
569         <tr>
570           <td class="memname">static void async_context_deinit </td>
571           <td>(</td>
572           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
573           <td class="paramname"><em>context</em></td><td>)</td>
574           <td></td>
575         </tr>
576       </table>
577   </td>
578   <td class="mlabels-right">
579 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
580   </tr>
581 </table>
582 </div><div class="memdoc">
583
584 <p>End <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> processing, and free any resources. </p>
585 <p >Note the user should clean up any resources associated with workers in the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> themselves.</p>
586 <p >Asynchronous (non-polled) async_contexts guarantee that no callback is being called once this method returns.</p>
587 <dl class="params"><dt>Parameters</dt><dd>
588   <table class="params">
589     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
590   </table>
591   </dd>
592 </dl>
593
594 </div>
595 </div>
596 <a id="gaa4b239c998978b97eabe2aa2ad659720" name="gaa4b239c998978b97eabe2aa2ad659720"></a>
597 <h2 class="memtitle"><span class="permalink"><a href="#gaa4b239c998978b97eabe2aa2ad659720">&#9670;&nbsp;</a></span>async_context_execute_sync()</h2>
598
599 <div class="memitem">
600 <div class="memproto">
601 <table class="mlabels">
602   <tr>
603   <td class="mlabels-left">
604       <table class="memname">
605         <tr>
606           <td class="memname">static uint32_t async_context_execute_sync </td>
607           <td>(</td>
608           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
609           <td class="paramname"><em>context</em>, </td>
610         </tr>
611         <tr>
612           <td class="paramkey"></td>
613           <td></td>
614           <td class="paramtype">uint32_t(*)(void *param)&#160;</td>
615           <td class="paramname"><em>func</em>, </td>
616         </tr>
617         <tr>
618           <td class="paramkey"></td>
619           <td></td>
620           <td class="paramtype">void *&#160;</td>
621           <td class="paramname"><em>param</em>&#160;</td>
622         </tr>
623         <tr>
624           <td></td>
625           <td>)</td>
626           <td></td><td></td>
627         </tr>
628       </table>
629   </td>
630   <td class="mlabels-right">
631 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
632   </tr>
633 </table>
634 </div><div class="memdoc">
635
636 <p>Execute work synchronously on the core the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> belongs to. </p>
637 <p >This method is intended for code external to the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> (e.g. another thread/task) to execute a function with the same guarantees (single core, logical thread of execution) that <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> workers are called with.</p>
638 <dl class="section note"><dt>Note</dt><dd>you should NOT call this method while holding the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>'s lock</dd></dl>
639 <dl class="params"><dt>Parameters</dt><dd>
640   <table class="params">
641     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
642     <tr><td class="paramname">func</td><td>the function to call </td></tr>
643     <tr><td class="paramname">param</td><td>the parameter to pass to the function </td></tr>
644   </table>
645   </dd>
646 </dl>
647 <dl class="section return"><dt>Returns</dt><dd>the return value from func </dd></dl>
648
649 </div>
650 </div>
651 <a id="ga032285b9d1a4aa325813cdbcc1f00a75" name="ga032285b9d1a4aa325813cdbcc1f00a75"></a>
652 <h2 class="memtitle"><span class="permalink"><a href="#ga032285b9d1a4aa325813cdbcc1f00a75">&#9670;&nbsp;</a></span>async_context_lock_check()</h2>
653
654 <div class="memitem">
655 <div class="memproto">
656 <table class="mlabels">
657   <tr>
658   <td class="mlabels-left">
659       <table class="memname">
660         <tr>
661           <td class="memname">static void async_context_lock_check </td>
662           <td>(</td>
663           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
664           <td class="paramname"><em>context</em></td><td>)</td>
665           <td></td>
666         </tr>
667       </table>
668   </td>
669   <td class="mlabels-right">
670 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
671   </tr>
672 </table>
673 </div><div class="memdoc">
674
675 <p>Assert if the caller does not own the lock for the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>. </p>
676 <dl class="section note"><dt>Note</dt><dd>this method is thread-safe</dd></dl>
677 <dl class="params"><dt>Parameters</dt><dd>
678   <table class="params">
679     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
680   </table>
681   </dd>
682 </dl>
683
684 </div>
685 </div>
686 <a id="gafdb322c3f1043265624988215d3a8df9" name="gafdb322c3f1043265624988215d3a8df9"></a>
687 <h2 class="memtitle"><span class="permalink"><a href="#gafdb322c3f1043265624988215d3a8df9">&#9670;&nbsp;</a></span>async_context_poll()</h2>
688
689 <div class="memitem">
690 <div class="memproto">
691 <table class="mlabels">
692   <tr>
693   <td class="mlabels-left">
694       <table class="memname">
695         <tr>
696           <td class="memname">static void <a class="el" href="structasync__context__poll.html">async_context_poll</a> </td>
697           <td>(</td>
698           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
699           <td class="paramname"><em>context</em></td><td>)</td>
700           <td></td>
701         </tr>
702       </table>
703   </td>
704   <td class="mlabels-right">
705 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
706   </tr>
707 </table>
708 </div><div class="memdoc">
709
710 <p>Perform any pending work for polling style <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a>. </p>
711 <p >For a polled <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> (e.g. <a class="el" href="group__async__context__poll.html">async_context_poll</a>) the user is responsible for calling this method periodically to perform any required work.</p>
712 <p >This method may immediately perform outstanding work on other context types, but is not required to.</p>
713 <dl class="params"><dt>Parameters</dt><dd>
714   <table class="params">
715     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
716   </table>
717   </dd>
718 </dl>
719
720 </div>
721 </div>
722 <a id="gada9eb6dbc0442ba9cbb44a41526f3b9f" name="gada9eb6dbc0442ba9cbb44a41526f3b9f"></a>
723 <h2 class="memtitle"><span class="permalink"><a href="#gada9eb6dbc0442ba9cbb44a41526f3b9f">&#9670;&nbsp;</a></span>async_context_release_lock()</h2>
724
725 <div class="memitem">
726 <div class="memproto">
727 <table class="mlabels">
728   <tr>
729   <td class="mlabels-left">
730       <table class="memname">
731         <tr>
732           <td class="memname">static void async_context_release_lock </td>
733           <td>(</td>
734           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
735           <td class="paramname"><em>context</em></td><td>)</td>
736           <td></td>
737         </tr>
738       </table>
739   </td>
740   <td class="mlabels-right">
741 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
742   </tr>
743 </table>
744 </div><div class="memdoc">
745
746 <p>Release the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> lock. </p>
747 <dl class="section note"><dt>Note</dt><dd>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> lock may be called in a nested fashion, so an internal count is maintained. On the outermost release, When the outermost lock is released, a check is made for work which might have been skipped while the lock was held, and any such work may be performed during this call IF the call is made from the same core that the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> belongs to.</dd>
748 <dd>
749 for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
750 <dl class="params"><dt>Parameters</dt><dd>
751   <table class="params">
752     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a></td></tr>
753   </table>
754   </dd>
755 </dl>
756 <dl class="section see"><dt>See also</dt><dd><a class="el" href="group__pico__async__context.html#ga404d5e6a8ef79159c692dc040f2ded44" title="Acquire the async_context lock.">async_context_acquire_lock_blocking</a> </dd></dl>
757
758 </div>
759 </div>
760 <a id="ga58c96cc02b63e12874cae38442c7c4dd" name="ga58c96cc02b63e12874cae38442c7c4dd"></a>
761 <h2 class="memtitle"><span class="permalink"><a href="#ga58c96cc02b63e12874cae38442c7c4dd">&#9670;&nbsp;</a></span>async_context_remove_at_time_worker()</h2>
762
763 <div class="memitem">
764 <div class="memproto">
765 <table class="mlabels">
766   <tr>
767   <td class="mlabels-left">
768       <table class="memname">
769         <tr>
770           <td class="memname">static bool async_context_remove_at_time_worker </td>
771           <td>(</td>
772           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
773           <td class="paramname"><em>context</em>, </td>
774         </tr>
775         <tr>
776           <td class="paramkey"></td>
777           <td></td>
778           <td class="paramtype"><a class="el" href="group__pico__async__context.html#ga74aa4914d98b190d2d4d84d7ff6b469e">async_at_time_worker_t</a> *&#160;</td>
779           <td class="paramname"><em>worker</em>&#160;</td>
780         </tr>
781         <tr>
782           <td></td>
783           <td>)</td>
784           <td></td><td></td>
785         </tr>
786       </table>
787   </td>
788   <td class="mlabels-right">
789 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
790   </tr>
791 </table>
792 </div><div class="memdoc">
793
794 <p>Remove an "at time" worker from a context. </p>
795 <dl class="section note"><dt>Note</dt><dd>for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
796 <dl class="params"><dt>Parameters</dt><dd>
797   <table class="params">
798     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
799     <tr><td class="paramname">worker</td><td>the "at time" worker to remove </td></tr>
800   </table>
801   </dd>
802 </dl>
803 <dl class="section return"><dt>Returns</dt><dd>true if the worker was removed, false if the instance not present. </dd></dl>
804
805 </div>
806 </div>
807 <a id="ga72b40c2505cd08cb542c3f1759b9e1d5" name="ga72b40c2505cd08cb542c3f1759b9e1d5"></a>
808 <h2 class="memtitle"><span class="permalink"><a href="#ga72b40c2505cd08cb542c3f1759b9e1d5">&#9670;&nbsp;</a></span>async_context_remove_when_pending_worker()</h2>
809
810 <div class="memitem">
811 <div class="memproto">
812 <table class="mlabels">
813   <tr>
814   <td class="mlabels-left">
815       <table class="memname">
816         <tr>
817           <td class="memname">static bool async_context_remove_when_pending_worker </td>
818           <td>(</td>
819           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
820           <td class="paramname"><em>context</em>, </td>
821         </tr>
822         <tr>
823           <td class="paramkey"></td>
824           <td></td>
825           <td class="paramtype"><a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a> *&#160;</td>
826           <td class="paramname"><em>worker</em>&#160;</td>
827         </tr>
828         <tr>
829           <td></td>
830           <td>)</td>
831           <td></td><td></td>
832         </tr>
833       </table>
834   </td>
835   <td class="mlabels-right">
836 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
837   </tr>
838 </table>
839 </div><div class="memdoc">
840
841 <p>Remove a "when pending" worker from a context. </p>
842 <dl class="section note"><dt>Note</dt><dd>for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
843 <dl class="params"><dt>Parameters</dt><dd>
844   <table class="params">
845     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
846     <tr><td class="paramname">worker</td><td>the "when pending" worker to remove </td></tr>
847   </table>
848   </dd>
849 </dl>
850 <dl class="section return"><dt>Returns</dt><dd>true if the worker was removed, false if the instance not present. </dd></dl>
851
852 </div>
853 </div>
854 <a id="ga1ca51536a6f0344cfcbd30bd09fbaec2" name="ga1ca51536a6f0344cfcbd30bd09fbaec2"></a>
855 <h2 class="memtitle"><span class="permalink"><a href="#ga1ca51536a6f0344cfcbd30bd09fbaec2">&#9670;&nbsp;</a></span>async_context_set_work_pending()</h2>
856
857 <div class="memitem">
858 <div class="memproto">
859 <table class="mlabels">
860   <tr>
861   <td class="mlabels-left">
862       <table class="memname">
863         <tr>
864           <td class="memname">static void async_context_set_work_pending </td>
865           <td>(</td>
866           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
867           <td class="paramname"><em>context</em>, </td>
868         </tr>
869         <tr>
870           <td class="paramkey"></td>
871           <td></td>
872           <td class="paramtype"><a class="el" href="group__pico__async__context.html#ga975e8fa20352873b7ac76b06a497eb2b">async_when_pending_worker_t</a> *&#160;</td>
873           <td class="paramname"><em>worker</em>&#160;</td>
874         </tr>
875         <tr>
876           <td></td>
877           <td>)</td>
878           <td></td><td></td>
879         </tr>
880       </table>
881   </td>
882   <td class="mlabels-right">
883 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
884   </tr>
885 </table>
886 </div><div class="memdoc">
887
888 <p>Mark a "when pending" worker as having work pending. </p>
889 <p >The worker will be run from the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> at a later time.</p>
890 <dl class="section note"><dt>Note</dt><dd>this method may be called from any context including IRQs</dd></dl>
891 <dl class="params"><dt>Parameters</dt><dd>
892   <table class="params">
893     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
894     <tr><td class="paramname">worker</td><td>the "when pending" worker to mark as pending. </td></tr>
895   </table>
896   </dd>
897 </dl>
898
899 </div>
900 </div>
901 <a id="gaae7ea2fed2b274a63455773d056f6d4c" name="gaae7ea2fed2b274a63455773d056f6d4c"></a>
902 <h2 class="memtitle"><span class="permalink"><a href="#gaae7ea2fed2b274a63455773d056f6d4c">&#9670;&nbsp;</a></span>async_context_wait_for_work_ms()</h2>
903
904 <div class="memitem">
905 <div class="memproto">
906 <table class="mlabels">
907   <tr>
908   <td class="mlabels-left">
909       <table class="memname">
910         <tr>
911           <td class="memname">static void async_context_wait_for_work_ms </td>
912           <td>(</td>
913           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
914           <td class="paramname"><em>context</em>, </td>
915         </tr>
916         <tr>
917           <td class="paramkey"></td>
918           <td></td>
919           <td class="paramtype">uint32_t&#160;</td>
920           <td class="paramname"><em>ms</em>&#160;</td>
921         </tr>
922         <tr>
923           <td></td>
924           <td>)</td>
925           <td></td><td></td>
926         </tr>
927       </table>
928   </td>
929   <td class="mlabels-right">
930 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
931   </tr>
932 </table>
933 </div><div class="memdoc">
934
935 <p>Block until work needs to be done or the specified number of milliseconds have passed. </p>
936 <dl class="section note"><dt>Note</dt><dd>this method should not be called from a worker callback</dd></dl>
937 <dl class="params"><dt>Parameters</dt><dd>
938   <table class="params">
939     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
940     <tr><td class="paramname">ms</td><td>the number of milliseconds to return after if no work is required </td></tr>
941   </table>
942   </dd>
943 </dl>
944
945 </div>
946 </div>
947 <a id="ga6207f562c0b69c7a75cd81a783eb1055" name="ga6207f562c0b69c7a75cd81a783eb1055"></a>
948 <h2 class="memtitle"><span class="permalink"><a href="#ga6207f562c0b69c7a75cd81a783eb1055">&#9670;&nbsp;</a></span>async_context_wait_for_work_until()</h2>
949
950 <div class="memitem">
951 <div class="memproto">
952 <table class="mlabels">
953   <tr>
954   <td class="mlabels-left">
955       <table class="memname">
956         <tr>
957           <td class="memname">static void async_context_wait_for_work_until </td>
958           <td>(</td>
959           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
960           <td class="paramname"><em>context</em>, </td>
961         </tr>
962         <tr>
963           <td class="paramkey"></td>
964           <td></td>
965           <td class="paramtype"><a class="el" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a>&#160;</td>
966           <td class="paramname"><em>until</em>&#160;</td>
967         </tr>
968         <tr>
969           <td></td>
970           <td>)</td>
971           <td></td><td></td>
972         </tr>
973       </table>
974   </td>
975   <td class="mlabels-right">
976 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
977   </tr>
978 </table>
979 </div><div class="memdoc">
980
981 <p>Block until work needs to be done or the specified time has been reached. </p>
982 <dl class="section note"><dt>Note</dt><dd>this method should not be called from a worker callback</dd></dl>
983 <dl class="params"><dt>Parameters</dt><dd>
984   <table class="params">
985     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
986     <tr><td class="paramname">until</td><td>the time to return at if no work is required </td></tr>
987   </table>
988   </dd>
989 </dl>
990
991 </div>
992 </div>
993 <a id="gad2f27b21dbaa264dfe59ef0f59de11db" name="gad2f27b21dbaa264dfe59ef0f59de11db"></a>
994 <h2 class="memtitle"><span class="permalink"><a href="#gad2f27b21dbaa264dfe59ef0f59de11db">&#9670;&nbsp;</a></span>async_context_wait_until()</h2>
995
996 <div class="memitem">
997 <div class="memproto">
998 <table class="mlabels">
999   <tr>
1000   <td class="mlabels-left">
1001       <table class="memname">
1002         <tr>
1003           <td class="memname">static void async_context_wait_until </td>
1004           <td>(</td>
1005           <td class="paramtype"><a class="el" href="structasync__context.html">async_context_t</a> *&#160;</td>
1006           <td class="paramname"><em>context</em>, </td>
1007         </tr>
1008         <tr>
1009           <td class="paramkey"></td>
1010           <td></td>
1011           <td class="paramtype"><a class="el" href="group__timestamp.html#ga8b7f3d602cc053f05bacceeacc257ed8">absolute_time_t</a>&#160;</td>
1012           <td class="paramname"><em>until</em>&#160;</td>
1013         </tr>
1014         <tr>
1015           <td></td>
1016           <td>)</td>
1017           <td></td><td></td>
1018         </tr>
1019       </table>
1020   </td>
1021   <td class="mlabels-right">
1022 <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
1023   </tr>
1024 </table>
1025 </div><div class="memdoc">
1026
1027 <p>sleep until the specified time in an <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> callback safe way </p>
1028 <dl class="section note"><dt>Note</dt><dd>for async_contexts that provide locking (not <a class="el" href="structasync__context__poll.html">async_context_poll</a>), this method is threadsafe. and may be called from within any worker method called by the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> or from any other non-IRQ context.</dd></dl>
1029 <dl class="params"><dt>Parameters</dt><dd>
1030   <table class="params">
1031     <tr><td class="paramname">context</td><td>the <a class="el" href="structasync__context.html" title="Base structure type of all async_contexts. For details about its use, see pico_async_context.">async_context</a> </td></tr>
1032     <tr><td class="paramname">until</td><td>the time to sleep until </td></tr>
1033   </table>
1034   </dd>
1035 </dl>
1036
1037 </div>
1038 </div>
1039 </div><!-- contents -->
1040 </div><!-- doc-content -->
1041
1042         <script src="main.js"></script>
1043 </body>
1044 </html>
This page took 0.088979 seconds and 4 git commands to generate.