1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xmlns="http://www.w3.org/1999/xhtml"> 3<head> 4<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> 5<meta http-equiv="X-UA-Compatible" content="IE=9"/> 6<meta name="generator" content="Doxygen 1.8.13"/> 7<meta name="viewport" content="width=device-width, initial-scale=1"/> 8<title>ISSDK: algorithms/sensorfusion/sources/driver_ctimer.c File Reference</title> 9<link href="tabs.css" rel="stylesheet" type="text/css"/> 10<script type="text/javascript" src="jquery.js"></script> 11<script type="text/javascript" src="dynsections.js"></script> 12<link href="issdk_stylesheet.css" rel="stylesheet" type="text/css" /> 13</head> 14<body> 15<div id="top"><!-- do not remove this div, it is closed by doxygen! --> 16<div id="titlearea"> 17<table cellspacing="0" cellpadding="0"> 18 <tbody> 19 <tr style="height: 56px;"> 20 <td id="projectlogo"><img alt="Logo" src="nxp_logo_small.png"/></td> 21 <td id="projectalign" style="padding-left: 0.5em;"> 22 <div id="projectname">ISSDK 23  <span id="projectnumber">1.8</span> 24 </div> 25 <div id="projectbrief">IoT Sensing Software Development Kit</div> 26 </td> 27 </tr> 28 </tbody> 29</table> 30</div> 31<!-- end header part --> 32<!-- Generated by Doxygen 1.8.13 --> 33<script type="text/javascript" src="menudata.js"></script> 34<script type="text/javascript" src="menu.js"></script> 35<script type="text/javascript"> 36$(function() { 37 initMenu('',false,false,'search.php','Search'); 38}); 39</script> 40<div id="main-nav"></div> 41<div id="nav-path" class="navpath"> 42 <ul> 43<li class="navelem"><a class="el" href="dir_c0ce462e37efe0a8d60c01d75f78f8a0.html">algorithms</a></li><li class="navelem"><a class="el" href="dir_cb8ed5ffd1f20a5af7e420f81f312621.html">sensorfusion</a></li><li class="navelem"><a class="el" href="dir_c60867674b20e7d761cd401b87ce879d.html">sources</a></li> </ul> 44</div> 45</div><!-- top --> 46<div class="header"> 47 <div class="summary"> 48<a href="#define-members">Macros</a> | 49<a href="#func-members">Functions</a> | 50<a href="#var-members">Variables</a> </div> 51 <div class="headertitle"> 52<div class="title">driver_ctimer.c File Reference</div> </div> 53</div><!--header--> 54<div class="contents"> 55 56<p>Provides a simple abstraction for a periodic interval timer. 57<a href="#details">More...</a></p> 58<div class="textblock"><code>#include "issdk_hal.h"</code><br /> 59<code>#include "board.h"</code><br /> 60<code>#include "fsl_ctimer.h"</code><br /> 61<code>#include "pin_mux.h"</code><br /> 62<code>#include "clock_config.h"</code><br /> 63</div><div class="textblock"><div class="dynheader"> 64Include dependency graph for driver_ctimer.c:</div> 65<div class="dyncontent"> 66<div class="center"><img src="a00798.png" border="0" usemap="#algorithms_2sensorfusion_2sources_2driver__ctimer_8c" alt=""/></div> 67</div> 68</div> 69<p><a href="a00797_source.html">Go to the source code of this file.</a></p> 70<table class="memberdecls"> 71<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> 72Macros</h2></td></tr> 73<tr class="memitem:ab7786fe5adcd1d885491257b0ebc27b8"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00797.html#ab7786fe5adcd1d885491257b0ebc27b8">CTIMER</a>   CTIMER0 /* Timer 0 */</td></tr> 74<tr class="separator:ab7786fe5adcd1d885491257b0ebc27b8"><td class="memSeparator" colspan="2"> </td></tr> 75<tr class="memitem:a31628cf818c8dea7d3311a53c65cb924"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00797.html#a31628cf818c8dea7d3311a53c65cb924">CTIMER_MAT0_OUT</a>   kCTIMER_Match_0 /* Match output 0 */</td></tr> 76<tr class="separator:a31628cf818c8dea7d3311a53c65cb924"><td class="memSeparator" colspan="2"> </td></tr> 77<tr class="memitem:a2843c40242a2189260e8fb4bbad4b06a"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="a00797.html#a2843c40242a2189260e8fb4bbad4b06a">BUS_CLK_FREQ</a>   CLOCK_GetFreq(kCLOCK_BusClk)</td></tr> 78<tr class="separator:a2843c40242a2189260e8fb4bbad4b06a"><td class="memSeparator" colspan="2"> </td></tr> 79</table><table class="memberdecls"> 80<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> 81Functions</h2></td></tr> 82<tr class="memitem:a9ad9361b48550aacb336c3a1f0776953"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00797.html#a9ad9361b48550aacb336c3a1f0776953">ctimer_callback</a> (uint32_t flags)</td></tr> 83<tr class="separator:a9ad9361b48550aacb336c3a1f0776953"><td class="memSeparator" colspan="2"> </td></tr> 84<tr class="memitem:aa9242caadd99e8ac4fdce86681b61740"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00797.html#aa9242caadd99e8ac4fdce86681b61740">pit_init</a> (uint32_t microseconds)</td></tr> 85<tr class="separator:aa9242caadd99e8ac4fdce86681b61740"><td class="memSeparator" colspan="2"> </td></tr> 86</table><table class="memberdecls"> 87<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a> 88Variables</h2></td></tr> 89<tr class="memitem:af2243d3e8556d4be713b2ef15c9a2738"><td class="memItemLeft" align="right" valign="top">ctimer_callback_t </td><td class="memItemRight" valign="bottom"><a class="el" href="a00797.html#af2243d3e8556d4be713b2ef15c9a2738">ctimer_callback_table</a> []</td></tr> 90<tr class="separator:af2243d3e8556d4be713b2ef15c9a2738"><td class="memSeparator" colspan="2"> </td></tr> 91<tr class="memitem:a4bd7666380e01cee8eb7cd5f0df5e3bf"><td class="memItemLeft" align="right" valign="top">volatile bool </td><td class="memItemRight" valign="bottom"><a class="el" href="a00797.html#a4bd7666380e01cee8eb7cd5f0df5e3bf">pitIsrFlag</a> = <a class="el" href="a00914.html#a65e9886d74aaee76545e83dd09011727">false</a></td></tr> 92<tr class="separator:a4bd7666380e01cee8eb7cd5f0df5e3bf"><td class="memSeparator" colspan="2"> </td></tr> 93</table> 94<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> 95<div class="textblock"><p>Provides a simple abstraction for a periodic interval timer. </p> 96<p>Bare metal implementations of the sensor fusion library require at least one periodic interrupt for use as a timebase for sensor fusion functions. The CTIMER module on the LPC is one such module. The timer functions are only referenced at the <a class="el" href="a04751.html#a840291bc02cba5474a4cb46a9b9566fe" title="Main function. ">main()</a> level. There is no interaction within the fusion routines themselves. </p> 97 98<p class="definition">Definition in file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 99</div><h2 class="groupheader">Macro Definition Documentation</h2> 100<a id="a2843c40242a2189260e8fb4bbad4b06a"></a> 101<h2 class="memtitle"><span class="permalink"><a href="#a2843c40242a2189260e8fb4bbad4b06a">◆ </a></span>BUS_CLK_FREQ</h2> 102 103<div class="memitem"> 104<div class="memproto"> 105 <table class="memname"> 106 <tr> 107 <td class="memname">#define BUS_CLK_FREQ   CLOCK_GetFreq(kCLOCK_BusClk)</td> 108 </tr> 109 </table> 110</div><div class="memdoc"> 111 112<p class="definition">Definition at line <a class="el" href="a00797_source.html#l00029">29</a> of file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 113 114<p class="reference">Referenced by <a class="el" href="a00797_source.html#l00064">pit_init()</a>.</p> 115 116</div> 117</div> 118<a id="ab7786fe5adcd1d885491257b0ebc27b8"></a> 119<h2 class="memtitle"><span class="permalink"><a href="#ab7786fe5adcd1d885491257b0ebc27b8">◆ </a></span>CTIMER</h2> 120 121<div class="memitem"> 122<div class="memproto"> 123 <table class="memname"> 124 <tr> 125 <td class="memname">#define CTIMER   CTIMER0 /* Timer 0 */</td> 126 </tr> 127 </table> 128</div><div class="memdoc"> 129 130<p class="definition">Definition at line <a class="el" href="a00797_source.html#l00027">27</a> of file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 131 132<p class="reference">Referenced by <a class="el" href="a00797_source.html#l00051">ctimer_callback()</a>, and <a class="el" href="a00797_source.html#l00064">pit_init()</a>.</p> 133 134</div> 135</div> 136<a id="a31628cf818c8dea7d3311a53c65cb924"></a> 137<h2 class="memtitle"><span class="permalink"><a href="#a31628cf818c8dea7d3311a53c65cb924">◆ </a></span>CTIMER_MAT0_OUT</h2> 138 139<div class="memitem"> 140<div class="memproto"> 141 <table class="memname"> 142 <tr> 143 <td class="memname">#define CTIMER_MAT0_OUT   kCTIMER_Match_0 /* Match output 0 */</td> 144 </tr> 145 </table> 146</div><div class="memdoc"> 147 148<p class="definition">Definition at line <a class="el" href="a00797_source.html#l00028">28</a> of file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 149 150</div> 151</div> 152<h2 class="groupheader">Function Documentation</h2> 153<a id="a9ad9361b48550aacb336c3a1f0776953"></a> 154<h2 class="memtitle"><span class="permalink"><a href="#a9ad9361b48550aacb336c3a1f0776953">◆ </a></span>ctimer_callback()</h2> 155 156<div class="memitem"> 157<div class="memproto"> 158 <table class="memname"> 159 <tr> 160 <td class="memname">void ctimer_callback </td> 161 <td>(</td> 162 <td class="paramtype">uint32_t </td> 163 <td class="paramname"><em>flags</em></td><td>)</td> 164 <td></td> 165 </tr> 166 </table> 167</div><div class="memdoc"> 168 169<p class="definition">Definition at line <a class="el" href="a00797_source.html#l00051">51</a> of file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 170 171<p class="reference">References <a class="el" href="a00797_source.html#l00027">CTIMER</a>, and <a class="el" href="a00797_source.html#l00049">pitIsrFlag</a>.</p> 172 173</div> 174</div> 175<a id="aa9242caadd99e8ac4fdce86681b61740"></a> 176<h2 class="memtitle"><span class="permalink"><a href="#aa9242caadd99e8ac4fdce86681b61740">◆ </a></span>pit_init()</h2> 177 178<div class="memitem"> 179<div class="memproto"> 180 <table class="memname"> 181 <tr> 182 <td class="memname">void pit_init </td> 183 <td>(</td> 184 <td class="paramtype">uint32_t </td> 185 <td class="paramname"><em>microseconds</em></td><td>)</td> 186 <td></td> 187 </tr> 188 </table> 189</div><div class="memdoc"> 190 191<p class="definition">Definition at line <a class="el" href="a00797_source.html#l00064">64</a> of file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 192 193<p class="reference">Referenced by <a class="el" href="a00869_source.html#l00055">main()</a>.</p> 194<div class="dynheader"> 195Here is the caller graph for this function:</div> 196<div class="dyncontent"> 197<div class="center"><img src="a00797_aa9242caadd99e8ac4fdce86681b61740_icgraph.png" border="0" usemap="#a00797_aa9242caadd99e8ac4fdce86681b61740_icgraph" alt=""/></div> 198<map name="a00797_aa9242caadd99e8ac4fdce86681b61740_icgraph" id="a00797_aa9242caadd99e8ac4fdce86681b61740_icgraph"> 199<area shape="rect" id="node2" href="a00869.html#a840291bc02cba5474a4cb46a9b9566fe" title="This is a bare-metal implementation of the NXP sensor fusion demo build. " alt="" coords="113,5,164,32"/> 200</map> 201</div> 202 203</div> 204</div> 205<h2 class="groupheader">Variable Documentation</h2> 206<a id="af2243d3e8556d4be713b2ef15c9a2738"></a> 207<h2 class="memtitle"><span class="permalink"><a href="#af2243d3e8556d4be713b2ef15c9a2738">◆ </a></span>ctimer_callback_table</h2> 208 209<div class="memitem"> 210<div class="memproto"> 211 <table class="memname"> 212 <tr> 213 <td class="memname">ctimer_callback_t ctimer_callback_table[]</td> 214 </tr> 215 </table> 216</div><div class="memdoc"> 217<b>Initial value:</b><div class="fragment"><div class="line">=</div><div class="line">{</div><div class="line"> <a class="code" href="a00797.html#a9ad9361b48550aacb336c3a1f0776953">ctimer_callback</a>,</div><div class="line"> NULL,</div><div class="line"> NULL,</div><div class="line"> NULL,</div><div class="line"> NULL,</div><div class="line"> NULL,</div><div class="line"> NULL,</div><div class="line"> NULL</div><div class="line">}</div><div class="ttc" id="a00797_html_a9ad9361b48550aacb336c3a1f0776953"><div class="ttname"><a href="a00797.html#a9ad9361b48550aacb336c3a1f0776953">ctimer_callback</a></div><div class="ttdeci">void ctimer_callback(uint32_t flags)</div><div class="ttdef"><b>Definition:</b> <a href="a00797_source.html#l00051">driver_ctimer.c:51</a></div></div> 218</div><!-- fragment --> 219<p class="definition">Definition at line <a class="el" href="a00797_source.html#l00037">37</a> of file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 220 221</div> 222</div> 223<a id="a4bd7666380e01cee8eb7cd5f0df5e3bf"></a> 224<h2 class="memtitle"><span class="permalink"><a href="#a4bd7666380e01cee8eb7cd5f0df5e3bf">◆ </a></span>pitIsrFlag</h2> 225 226<div class="memitem"> 227<div class="memproto"> 228 <table class="memname"> 229 <tr> 230 <td class="memname">volatile bool pitIsrFlag = <a class="el" href="a00914.html#a65e9886d74aaee76545e83dd09011727">false</a></td> 231 </tr> 232 </table> 233</div><div class="memdoc"> 234 235<p class="definition">Definition at line <a class="el" href="a00797_source.html#l00049">49</a> of file <a class="el" href="a00797_source.html">driver_ctimer.c</a>.</p> 236 237<p class="reference">Referenced by <a class="el" href="a00797_source.html#l00051">ctimer_callback()</a>, and <a class="el" href="a00869_source.html#l00055">main()</a>.</p> 238 239</div> 240</div> 241</div><!-- contents --> 242 243<hr class="footer"/><address class="footer"><small> 244© Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause 245</small></address> 246</body> 247</html> 248