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/main_freertos_two_tasks.c Source File</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   &#160;<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="headertitle">
48<div class="title">main_freertos_two_tasks.c</div>  </div>
49</div><!--header-->
50<div class="contents">
51<a href="a00884.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2015, Freescale Semiconductor, Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> * Copyright 2016-2017 NXP</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment">/*! \file main_freertos_two_tasks.c</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment">    \brief FreeRTOS (two task) implementation of sensor fusion on FRDM-K64F.</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment">    This file shows one recommended way to incorporate sensor fusion capabilities</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment">    into a FreeRTOS project.</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;</div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment">/* FreeRTOS kernel includes. */</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="preprocessor">#include &quot;FreeRTOS.h&quot;</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="preprocessor">#include &quot;task.h&quot;</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="preprocessor">#include &quot;queue.h&quot;</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="preprocessor">#include &quot;timers.h&quot;</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="preprocessor">#include &quot;event_groups.h&quot;</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="comment">// KSDK and ISSDK Headers</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;<span class="preprocessor">#include &quot;fsl_debug_console.h&quot;</span>  <span class="comment">// KSDK header file for the debug interface</span></div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;<span class="preprocessor">#include &quot;board.h&quot;</span>              <span class="comment">// KSDK header file to define board configuration</span></div><div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="preprocessor">#include &quot;pin_mux.h&quot;</span>            <span class="comment">// KSDK header file for pin mux initialization functions</span></div><div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160;<span class="preprocessor">#include &quot;clock_config.h&quot;</span>       <span class="comment">// KSDK header file for clock configuration</span></div><div class="line"><a name="l00028"></a><span class="lineno">   28</span>&#160;<span class="preprocessor">#include &quot;fsl_port.h&quot;</span>           <span class="comment">// KSDK header file for Port I/O control</span></div><div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160;<span class="preprocessor">#include &quot;fsl_i2c.h&quot;</span>            <span class="comment">// KSDK header file for I2C interfaces</span></div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00026.html">fxas21002.h</a>&quot;</span>          <span class="comment">// register address and bit field definitions</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00158.html">mpl3115.h</a>&quot;</span>            <span class="comment">// register address and bit field definitions</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00080.html">fxos8700.h</a>&quot;</span>           <span class="comment">// register address and bit field definitions</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#include &quot;fsl_i2c_cmsis.h&quot;</span></div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00170.html">register_io_i2c.h</a>&quot;</span></div><div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;<span class="preprocessor">#include &quot;fsl_smc.h&quot;</span></div><div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno">   37</span>&#160;<span class="comment">// Sensor Fusion Headers</span></div><div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00914.html">sensor_fusion.h</a>&quot;</span>      <span class="comment">// top level magCal and sensor fusion interfaces</span></div><div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00779.html">control.h</a>&quot;</span>                    <span class="comment">// Command/Streaming interface - application specific</span></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00923.html">status.h</a>&quot;</span>                     <span class="comment">// Sta:tus indicator interface - application specific</span></div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a00842.html">drivers.h</a>&quot;</span>                    <span class="comment">// NXP sensor drivers OR customer-supplied drivers</span></div><div class="line"><a name="l00042"></a><span class="lineno">   42</span>&#160;</div><div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="comment">// Global data structures</span></div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="a00884.html#afa81c629d378fe700f351a1bce411ad5">   44</a></span>&#160;<a class="code" href="a04047.html">SensorFusionGlobals</a> <a class="code" href="a00884.html#afa81c629d378fe700f351a1bce411ad5">sfg</a>;                <span class="comment">///&lt; This is the primary sensor fusion data structure</span></div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="a00884.html#a641b380af068b4004bc5b9dff5e5a6db">   45</a></span>&#160;<span class="comment"></span><a class="code" href="a03967.html">ControlSubsystem</a> <a class="code" href="a00884.html#a641b380af068b4004bc5b9dff5e5a6db">controlSubsystem</a>;      <span class="comment">///&lt; used for serial communications</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="a00884.html#a875f795e25aaef1b828061bbfae4764a">   46</a></span>&#160;<span class="comment"></span><a class="code" href="a04051.html">StatusSubsystem</a> <a class="code" href="a00884.html#a875f795e25aaef1b828061bbfae4764a">statusSubsystem</a>;        <span class="comment">///&lt; provides visual (usually LED) status indicator</span></div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="a00884.html#a84786a835b4ead54496764473c994db5">   47</a></span>&#160;<span class="comment"></span><span class="keyword">struct </span><a class="code" href="a03991.html">PhysicalSensor</a> <a class="code" href="a00884.html#a84786a835b4ead54496764473c994db5">sensors</a>[3];              <span class="comment">///&lt; This implementation uses three physical sensors</span></div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="a00884.html#a729bc9c4006e68fecea92342c3c3700b">   48</a></span>&#160;<span class="comment"></span>EventGroupHandle_t <a class="code" href="a00884.html#a729bc9c4006e68fecea92342c3c3700b">event_group</a> = NULL;</div><div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;<span class="comment">registerDeviceInfo_t i2cBusInfo = {</span></div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;<span class="comment">    .deviceInstance     = I2C_S_DEVICE_INDEX,</span></div><div class="line"><a name="l00052"></a><span class="lineno">   52</span>&#160;<span class="comment">    .functionParam      = SMC,</span></div><div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160;<span class="comment">    .idleFunction       = (registeridlefunction_t) SMC_SetPowerModeWait</span></div><div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="comment">};</span></div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="comment">*/</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="a00884.html#a75f40af5caf43ce58b7a18015c210e4a">   56</a></span>&#160;<a class="code" href="a03819.html">registerDeviceInfo_t</a> <a class="code" href="a00884.html#a75f40af5caf43ce58b7a18015c210e4a">i2cBusInfo</a> = {</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    .<a class="code" href="a03819.html#a693f84e28d48677a73cd40d7e5fc79ed">deviceInstance</a>     = <a class="code" href="a04343.html#ab0c7969a7fffaabe78d43db2b12ad840">I2C_S_DEVICE_INDEX</a>,</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    .functionParam      = NULL,</div><div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160;    .idleFunction       = NULL</div><div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;};</div><div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> read_task(<span class="keywordtype">void</span> *pvParameters);              <span class="comment">// FreeRTOS Task definition</span></div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> fusion_task(<span class="keywordtype">void</span> *pvParameters);            <span class="comment">// FreeRTOS Task definition</span></div><div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160;<span class="comment">/// This is a FreeRTOS (dual task) implementation of the NXP sensor fusion demo build.</span></div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="a00884.html#a840291bc02cba5474a4cb46a9b9566fe">   66</a></span>&#160;<span class="comment"></span><span class="keywordtype">int</span> <a class="code" href="a00884.html#a840291bc02cba5474a4cb46a9b9566fe">main</a>(<span class="keywordtype">void</span>)</div><div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;{</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="a00959.html#ga2c9fe54b6b84723fbaa590a6f4576966">BOARD_InitPins</a>();                   <span class="comment">// defined in pin_mux.c, initializes pkg pins</span></div><div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="a04292.html#a8d81431cbbc4b01da56afbff0f766379">BOARD_BootClockRUN</a>();               <span class="comment">// defined in clock_config.c, initializes clocks</span></div><div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    <a class="code" href="a04109.html#a4c84ccb952cb083367d7040cf9de3db8">BOARD_InitDebugConsole</a>();           <span class="comment">// defined in board.c, initializes the OpenSDA port</span></div><div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;    ARM_DRIVER_I2C* <a class="code" href="a00368.html#a3c22bed16a7c769894081222aa6107d8">I2Cdrv</a> = &amp;<a class="code" href="a04343.html#ad6a14737695a4218d07182b86b21f570">I2C_S_DRIVER</a>;           <span class="comment">// defined in the &lt;shield&gt;.h file</span></div><div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;</div><div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;    <span class="comment">//I2Cdrv-&gt;Initialize(I2C_S_SIGNAL_EVENT);           // Initialize the KSDK driver for the I2C port</span></div><div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160;    I2Cdrv-&gt;Initialize(<a class="code" href="a04343.html#a60ac2e3bb32ae33e2fd542f607a58ac4">I2C_S_SIGNAL_EVENT</a>);  <span class="comment">// Initialize the KSDK driver for the I2C port</span></div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    I2Cdrv-&gt;PowerControl(ARM_POWER_FULL);      <span class="comment">// Set the I2C Power mode.</span></div><div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160;    I2Cdrv-&gt;Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);      <span class="comment">// Configure the I2C bus speed</span></div><div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160;    <a class="code" href="a00776.html#a67029acf1be9712c5d30c625132ad958">initializeControlPort</a>(&amp;controlSubsystem);                           <span class="comment">// configure pins and ports for the control sub-system</span></div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <a class="code" href="a00920.html#a01619741119cf3432f8cfff23334c793">initializeStatusSubsystem</a>(&amp;statusSubsystem);                        <span class="comment">// configure pins and ports for the status sub-system</span></div><div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;    <a class="code" href="a00911.html#a43b44018042fabb5179c2e62277cc942">initSensorFusionGlobals</a>(&amp;sfg, &amp;statusSubsystem, &amp;controlSubsystem); <span class="comment">// Initialize sensor fusion structures</span></div><div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;    <span class="comment">// &quot;install&quot; the sensors we will be using</span></div><div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    sfg.<a class="code" href="a04047.html#a22ddc1cea4daa0d93be0fe7d48365dbb">installSensor</a>(&amp;sfg, &amp;<a class="code" href="a00884.html#a84786a835b4ead54496764473c994db5">sensors</a>[0], <a class="code" href="a00545.html#a88d604d4e5776dfa8f16848425223cbb">FXOS8700_I2C_ADDR</a>,  1, (<span class="keywordtype">void</span>*) I2Cdrv, &amp;i2cBusInfo, <a class="code" href="a00812.html#ac61bf451efc3a4eab179dbc59268b3e7">FXOS8700_Init</a>,  <a class="code" href="a00812.html#a5388755d21701d88d79a4bfda99dbebf">FXOS8700_Read</a>);</div><div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    sfg.<a class="code" href="a04047.html#a22ddc1cea4daa0d93be0fe7d48365dbb">installSensor</a>(&amp;sfg, &amp;<a class="code" href="a00884.html#a84786a835b4ead54496764473c994db5">sensors</a>[1], <a class="code" href="a00545.html#a16a56b988ac0de778585d40fdada58f0">FXAS21002_I2C_ADDR</a>, 1, (<span class="keywordtype">void</span>*) I2Cdrv, &amp;i2cBusInfo, <a class="code" href="a00842.html#a81c5b987e709b3991bc7c1bc1e659c1f">FXAS21002_Init</a>, <a class="code" href="a00842.html#a1e2a1a192ed7f150fc24fc11df8d4c1e">FXAS21002_Read</a>);</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    sfg.<a class="code" href="a04047.html#a22ddc1cea4daa0d93be0fe7d48365dbb">installSensor</a>(&amp;sfg, &amp;<a class="code" href="a00884.html#a84786a835b4ead54496764473c994db5">sensors</a>[2], <a class="code" href="a00545.html#adec31513f28aceda1b78b1dba2f161fb">MPL3115_I2C_ADDR</a>,   2, (<span class="keywordtype">void</span>*) I2Cdrv, &amp;i2cBusInfo, <a class="code" href="a00842.html#af48197046b6d2f232932bf5ac61c4534">MPL3115_Init</a>, <a class="code" href="a00842.html#a54f6d4249d7a6d3484b35f7c98970425">MPL3115_Read</a>);</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;    sfg.<a class="code" href="a04047.html#a4c9ce90c92e284691468585f6a55d79e">initializeFusionEngine</a>(&amp;sfg);                   <span class="comment">// This will initialize sensors and magnetic calibration</span></div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;    <a class="code" href="a00884.html#a729bc9c4006e68fecea92342c3c3700b">event_group</a> = xEventGroupCreate();</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;    xTaskCreate(read_task, <span class="stringliteral">&quot;READ&quot;</span>, configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 2, NULL);</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;    xTaskCreate(fusion_task, <span class="stringliteral">&quot;FUSION&quot;</span>, configMINIMAL_STACK_SIZE, NULL, tskIDLE_PRIORITY + 1, NULL);</div><div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;</div><div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    sfg.<a class="code" href="a04047.html#aa22f9fd7adaca53616ef6bfb6cb051b4">setStatus</a>(&amp;sfg, <a class="code" href="a00914.html#a69ee883e1c22b117df163c0bd83f66dda50d1448013c6f17125caee18aa418af7">NORMAL</a>);                <span class="comment">// If we got this far, let&#39;s set status state to NORMAL</span></div><div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160;    vTaskStartScheduler();                      <span class="comment">// Start the RTOS scheduler</span></div><div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    sfg.<a class="code" href="a04047.html#aa22f9fd7adaca53616ef6bfb6cb051b4">setStatus</a>(&amp;sfg, <a class="code" href="a00914.html#a69ee883e1c22b117df163c0bd83f66dda2142c7e506bbaf9dba4175fee014862f">HARD_FAULT</a>);            <span class="comment">// If we got this far, FreeRTOS does not have enough memory allocated</span></div><div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;    <span class="keywordflow">for</span> (;;) ;</div><div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160;}</div><div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;</div><div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> read_task(<span class="keywordtype">void</span> *pvParameters)</div><div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;{</div><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;    uint16_t i=0;                       <span class="comment">// general counter variable</span></div><div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    portTickType lastWakeTime;</div><div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keyword">const</span> portTickType frequency = 1;   <span class="comment">// tick counter runs at the read rate</span></div><div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;    lastWakeTime = xTaskGetTickCount();</div><div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;    <span class="keywordflow">while</span> (1)</div><div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;    {</div><div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        <span class="keywordflow">for</span> (i=1; i&lt;=<a class="code" href="a00917.html#aeb731cd530cb2f5c3d2bc08e2a9c358a">OVERSAMPLE_RATE</a>; i++) {</div><div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160;            vTaskDelayUntil(&amp;lastWakeTime, frequency);</div><div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;            sfg.<a class="code" href="a04047.html#a15e66ae3ad63ad091317ad0aefa53ce7">readSensors</a>(&amp;sfg, i);              <span class="comment">// Reads sensors, applies HAL and does averaging (if applicable)</span></div><div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;        }</div><div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        xEventGroupSetBits(<a class="code" href="a00884.html#a729bc9c4006e68fecea92342c3c3700b">event_group</a>, <a class="code" href="a00914.html#a8a03ef52aa4926d1d75cb647ac768622">B0</a>);</div><div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;    }</div><div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;}</div><div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;</div><div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="keyword">static</span> <span class="keywordtype">void</span> fusion_task(<span class="keywordtype">void</span> *pvParameters)</div><div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;{</div><div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;    uint16_t i=0;  <span class="comment">// general counter variable</span></div><div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;    <span class="keywordflow">while</span> (1)</div><div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;    {</div><div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;        xEventGroupWaitBits(<a class="code" href="a00884.html#a729bc9c4006e68fecea92342c3c3700b">event_group</a>,    <span class="comment">/* The event group handle. */</span></div><div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;                            <a class="code" href="a00914.html#a8a03ef52aa4926d1d75cb647ac768622">B0</a>,             <span class="comment">/* The bit pattern the event group is waiting for. */</span></div><div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;                            pdTRUE,         <span class="comment">/* BIT_0 and BIT_4 will be cleared automatically. */</span></div><div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;                            pdFALSE,        <span class="comment">/* Don&#39;t wait for both bits, either bit unblock task. */</span></div><div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;                            portMAX_DELAY); <span class="comment">/* Block indefinitely to wait for the condition to be met. */</span></div><div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;</div><div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;        sfg.<a class="code" href="a04047.html#a7466779558c661297ca6dc36d829605c">conditionSensorReadings</a>(&amp;sfg);  <span class="comment">// magCal is run as part of this</span></div><div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        sfg.<a class="code" href="a04047.html#afc72aca0c3842cde4aa4bb0dcdfb4237">runFusion</a>(&amp;sfg);                <span class="comment">// Run the actual fusion algorithms</span></div><div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;        sfg.<a class="code" href="a04047.html#ac01270fc7330df24acd1cd888397ef07">applyPerturbation</a>(&amp;sfg);        <span class="comment">// apply debug perturbation (testing only)</span></div><div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;</div><div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;        sfg.<a class="code" href="a04047.html#a0e90feae26cd26ab80bc78cfd9364512">loopcounter</a>++;                  <span class="comment">// The loop counter is used to &quot;serialize&quot; mag cal operations</span></div><div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;        i=i+1;</div><div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160;        <span class="keywordflow">if</span> (i&gt;=4) {                         <span class="comment">// Some status codes include a &quot;blink&quot; feature.  This loop</span></div><div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;                i=0;                        <span class="comment">// should cycle at least four times for that to operate correctly.</span></div><div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160;                sfg.<a class="code" href="a04047.html#a186a484bdd7f6c3210a2ee6d2763c6a2">updateStatus</a>(&amp;sfg);     <span class="comment">// This is where pending status updates are made visible</span></div><div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;        }</div><div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;        sfg.<a class="code" href="a04047.html#af6a232c7866a9093f9a5cb51372d4f97">queueStatus</a>(&amp;sfg, <a class="code" href="a00914.html#a69ee883e1c22b117df163c0bd83f66dda50d1448013c6f17125caee18aa418af7">NORMAL</a>);      <span class="comment">// assume NORMAL status for next pass through the loop</span></div><div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;        sfg.<a class="code" href="a04047.html#a51cbe943cdee0fd0a2ff72d2a04fad9a">pControlSubsystem</a>-&gt;<a class="code" href="a03967.html#a2fc3f3736130dec532bf7f12d4091e55">stream</a>(&amp;sfg, <a class="code" href="a00776.html#a3b6c71dda245dccb73352c7264176527">sUARTOutputBuffer</a>);      <span class="comment">// Send stream data to the Sensor Fusion Toolbox</span></div><div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;    }</div><div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;}</div><div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;<span class="comment"></span></div><div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;<span class="comment">/// \endcode</span></div><div class="ttc" id="a00914_html_a8a03ef52aa4926d1d75cb647ac768622"><div class="ttname"><a href="a00914.html#a8a03ef52aa4926d1d75cb647ac768622">B0</a></div><div class="ttdeci">#define B0</div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00072">sensor_fusion.h:72</a></div></div>
52<div class="ttc" id="a04047_html_a15e66ae3ad63ad091317ad0aefa53ce7"><div class="ttname"><a href="a04047.html#a15e66ae3ad63ad091317ad0aefa53ce7">SensorFusionGlobals::readSensors</a></div><div class="ttdeci">readSensors_t * readSensors</div><div class="ttdoc">read all physical sensors </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00527">sensor_fusion.h:527</a></div></div>
53<div class="ttc" id="a03819_html"><div class="ttname"><a href="a03819.html">registerDeviceInfo_t</a></div><div class="ttdoc">This structure defines the device specific info required by register I/O. </div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00102">sensor_drv.h:102</a></div></div>
54<div class="ttc" id="a04047_html_a4c9ce90c92e284691468585f6a55d79e"><div class="ttname"><a href="a04047.html#a4c9ce90c92e284691468585f6a55d79e">SensorFusionGlobals::initializeFusionEngine</a></div><div class="ttdeci">initializeFusionEngine_t * initializeFusionEngine</div><div class="ttdoc">set sensor fusion structures to initial values </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00525">sensor_fusion.h:525</a></div></div>
55<div class="ttc" id="a00842_html_a54f6d4249d7a6d3484b35f7c98970425"><div class="ttname"><a href="a00842.html#a54f6d4249d7a6d3484b35f7c98970425">MPL3115_Read</a></div><div class="ttdeci">int8_t MPL3115_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)</div></div>
56<div class="ttc" id="a00812_html_ac61bf451efc3a4eab179dbc59268b3e7"><div class="ttname"><a href="a00812.html#ac61bf451efc3a4eab179dbc59268b3e7">FXOS8700_Init</a></div><div class="ttdeci">int8_t FXOS8700_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)</div><div class="ttdef"><b>Definition:</b> <a href="a00812_source.html#l00130">driver_FXOS8700.c:130</a></div></div>
57<div class="ttc" id="a04343_html_a60ac2e3bb32ae33e2fd542f607a58ac4"><div class="ttname"><a href="a04343.html#a60ac2e3bb32ae33e2fd542f607a58ac4">I2C_S_SIGNAL_EVENT</a></div><div class="ttdeci">#define I2C_S_SIGNAL_EVENT</div><div class="ttdef"><b>Definition:</b> <a href="a04343_source.html#l00034">issdk_hal.h:34</a></div></div>
58<div class="ttc" id="a00917_html_aeb731cd530cb2f5c3d2bc08e2a9c358a"><div class="ttname"><a href="a00917.html#aeb731cd530cb2f5c3d2bc08e2a9c358a">OVERSAMPLE_RATE</a></div><div class="ttdeci">#define OVERSAMPLE_RATE</div><div class="ttdef"><b>Definition:</b> <a href="a00917_source.html#l00070">standard_build.h:70</a></div></div>
59<div class="ttc" id="a00842_html"><div class="ttname"><a href="a00842.html">drivers.h</a></div><div class="ttdoc">Provides function prototypes for driver level interfaces. </div></div>
60<div class="ttc" id="a00884_html_a875f795e25aaef1b828061bbfae4764a"><div class="ttname"><a href="a00884.html#a875f795e25aaef1b828061bbfae4764a">statusSubsystem</a></div><div class="ttdeci">StatusSubsystem statusSubsystem</div><div class="ttdoc">provides visual (usually LED) status indicator </div><div class="ttdef"><b>Definition:</b> <a href="a00884_source.html#l00046">main_freertos_two_tasks.c:46</a></div></div>
61<div class="ttc" id="a00914_html_a69ee883e1c22b117df163c0bd83f66dda50d1448013c6f17125caee18aa418af7"><div class="ttname"><a href="a00914.html#a69ee883e1c22b117df163c0bd83f66dda50d1448013c6f17125caee18aa418af7">NORMAL</a></div><div class="ttdoc">Operation is Nominal. </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00108">sensor_fusion.h:108</a></div></div>
62<div class="ttc" id="a03991_html"><div class="ttname"><a href="a03991.html">PhysicalSensor</a></div><div class="ttdoc">An instance of PhysicalSensor structure type should be allocated for each physical sensors (combo dev...</div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00155">sensor_fusion.h:155</a></div></div>
63<div class="ttc" id="a04047_html_af6a232c7866a9093f9a5cb51372d4f97"><div class="ttname"><a href="a04047.html#af6a232c7866a9093f9a5cb51372d4f97">SensorFusionGlobals::queueStatus</a></div><div class="ttdeci">setStatus_t * queueStatus</div><div class="ttdoc">queue status change for next regular interval </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00532">sensor_fusion.h:532</a></div></div>
64<div class="ttc" id="a04292_html_a8d81431cbbc4b01da56afbff0f766379"><div class="ttname"><a href="a04292.html#a8d81431cbbc4b01da56afbff0f766379">BOARD_BootClockRUN</a></div><div class="ttdeci">#define BOARD_BootClockRUN</div><div class="ttdef"><b>Definition:</b> <a href="a04292_source.html#l00019">clock_config.h:19</a></div></div>
65<div class="ttc" id="a00884_html_a75f40af5caf43ce58b7a18015c210e4a"><div class="ttname"><a href="a00884.html#a75f40af5caf43ce58b7a18015c210e4a">i2cBusInfo</a></div><div class="ttdeci">registerDeviceInfo_t i2cBusInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00884_source.html#l00056">main_freertos_two_tasks.c:56</a></div></div>
66<div class="ttc" id="a03819_html_a693f84e28d48677a73cd40d7e5fc79ed"><div class="ttname"><a href="a03819.html#a693f84e28d48677a73cd40d7e5fc79ed">registerDeviceInfo_t::deviceInstance</a></div><div class="ttdeci">uint8_t deviceInstance</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00106">sensor_drv.h:106</a></div></div>
67<div class="ttc" id="a00923_html"><div class="ttname"><a href="a00923.html">status.h</a></div><div class="ttdoc">Application-specific status subsystem. </div></div>
68<div class="ttc" id="a04047_html_a7466779558c661297ca6dc36d829605c"><div class="ttname"><a href="a04047.html#a7466779558c661297ca6dc36d829605c">SensorFusionGlobals::conditionSensorReadings</a></div><div class="ttdeci">conditionSensorReadings_t * conditionSensorReadings</div><div class="ttdoc">preprocessing step for sensor fusion </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00529">sensor_fusion.h:529</a></div></div>
69<div class="ttc" id="a00779_html"><div class="ttname"><a href="a00779.html">control.h</a></div><div class="ttdoc">Defines control sub-system. </div></div>
70<div class="ttc" id="a04047_html"><div class="ttname"><a href="a04047.html">SensorFusionGlobals</a></div><div class="ttdoc">The top level fusion structure. </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00454">sensor_fusion.h:454</a></div></div>
71<div class="ttc" id="a04109_html_a4c84ccb952cb083367d7040cf9de3db8"><div class="ttname"><a href="a04109.html#a4c84ccb952cb083367d7040cf9de3db8">BOARD_InitDebugConsole</a></div><div class="ttdeci">void BOARD_InitDebugConsole(void)</div><div class="ttdef"><b>Definition:</b> <a href="a04109_source.html#l00015">board.c:15</a></div></div>
72<div class="ttc" id="a00884_html_a840291bc02cba5474a4cb46a9b9566fe"><div class="ttname"><a href="a00884.html#a840291bc02cba5474a4cb46a9b9566fe">main</a></div><div class="ttdeci">int main(void)</div><div class="ttdoc">This is a FreeRTOS (dual task) implementation of the NXP sensor fusion demo build. </div><div class="ttdef"><b>Definition:</b> <a href="a00884_source.html#l00066">main_freertos_two_tasks.c:66</a></div></div>
73<div class="ttc" id="a00911_html_a43b44018042fabb5179c2e62277cc942"><div class="ttname"><a href="a00911.html#a43b44018042fabb5179c2e62277cc942">initSensorFusionGlobals</a></div><div class="ttdeci">void initSensorFusionGlobals(SensorFusionGlobals *sfg, StatusSubsystem *pStatusSubsystem, ControlSubsystem *pControlSubsystem)</div><div class="ttdoc">utility function to insert default values in the top level structure </div><div class="ttdef"><b>Definition:</b> <a href="a00911_source.html#l00051">sensor_fusion.c:51</a></div></div>
74<div class="ttc" id="a00842_html_a81c5b987e709b3991bc7c1bc1e659c1f"><div class="ttname"><a href="a00842.html#a81c5b987e709b3991bc7c1bc1e659c1f">FXAS21002_Init</a></div><div class="ttdeci">int8_t FXAS21002_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)</div></div>
75<div class="ttc" id="a00170_html"><div class="ttname"><a href="a00170.html">register_io_i2c.h</a></div><div class="ttdoc">The register_io_i2c.h file declares low-level interface functions for reading and writing sensor regi...</div></div>
76<div class="ttc" id="a00884_html_a641b380af068b4004bc5b9dff5e5a6db"><div class="ttname"><a href="a00884.html#a641b380af068b4004bc5b9dff5e5a6db">controlSubsystem</a></div><div class="ttdeci">ControlSubsystem controlSubsystem</div><div class="ttdoc">used for serial communications </div><div class="ttdef"><b>Definition:</b> <a href="a00884_source.html#l00045">main_freertos_two_tasks.c:45</a></div></div>
77<div class="ttc" id="a00884_html_a84786a835b4ead54496764473c994db5"><div class="ttname"><a href="a00884.html#a84786a835b4ead54496764473c994db5">sensors</a></div><div class="ttdeci">struct PhysicalSensor sensors[3]</div><div class="ttdoc">This implementation uses three physical sensors. </div><div class="ttdef"><b>Definition:</b> <a href="a00884_source.html#l00047">main_freertos_two_tasks.c:47</a></div></div>
78<div class="ttc" id="a03967_html"><div class="ttname"><a href="a03967.html">ControlSubsystem</a></div><div class="ttdoc">he ControlSubsystem encapsulates command and data streaming functions. </div><div class="ttdef"><b>Definition:</b> <a href="a00779_source.html#l00042">control.h:42</a></div></div>
79<div class="ttc" id="a00842_html_af48197046b6d2f232932bf5ac61c4534"><div class="ttname"><a href="a00842.html#af48197046b6d2f232932bf5ac61c4534">MPL3115_Init</a></div><div class="ttdeci">int8_t MPL3115_Init(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)</div></div>
80<div class="ttc" id="a04047_html_afc72aca0c3842cde4aa4bb0dcdfb4237"><div class="ttname"><a href="a04047.html#afc72aca0c3842cde4aa4bb0dcdfb4237">SensorFusionGlobals::runFusion</a></div><div class="ttdeci">runFusion_t * runFusion</div><div class="ttdoc">run the fusion routines </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00528">sensor_fusion.h:528</a></div></div>
81<div class="ttc" id="a00026_html"><div class="ttname"><a href="a00026.html">fxas21002.h</a></div><div class="ttdoc">The fxas21002.h contains the fxas21002 sensor register definitions and its bit mask. </div></div>
82<div class="ttc" id="a00545_html_a16a56b988ac0de778585d40fdada58f0"><div class="ttname"><a href="a00545.html#a16a56b988ac0de778585d40fdada58f0">FXAS21002_I2C_ADDR</a></div><div class="ttdeci">#define FXAS21002_I2C_ADDR</div><div class="ttdef"><b>Definition:</b> <a href="a00545_source.html#l00032">auto_detection_shield.h:32</a></div></div>
83<div class="ttc" id="a00914_html_a69ee883e1c22b117df163c0bd83f66dda2142c7e506bbaf9dba4175fee014862f"><div class="ttname"><a href="a00914.html#a69ee883e1c22b117df163c0bd83f66dda2142c7e506bbaf9dba4175fee014862f">HARD_FAULT</a></div><div class="ttdoc">Non-recoverable FAULT = something went very wrong. </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00111">sensor_fusion.h:111</a></div></div>
84<div class="ttc" id="a00914_html"><div class="ttname"><a href="a00914.html">sensor_fusion.h</a></div><div class="ttdoc">The sensor_fusion.h file implements the top level programming interface. </div></div>
85<div class="ttc" id="a00158_html"><div class="ttname"><a href="a00158.html">mpl3115.h</a></div></div>
86<div class="ttc" id="a04047_html_aa22f9fd7adaca53616ef6bfb6cb051b4"><div class="ttname"><a href="a04047.html#aa22f9fd7adaca53616ef6bfb6cb051b4">SensorFusionGlobals::setStatus</a></div><div class="ttdeci">setStatus_t * setStatus</div><div class="ttdoc">change status indicator immediately </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00531">sensor_fusion.h:531</a></div></div>
87<div class="ttc" id="a04343_html_ad6a14737695a4218d07182b86b21f570"><div class="ttname"><a href="a04343.html#ad6a14737695a4218d07182b86b21f570">I2C_S_DRIVER</a></div><div class="ttdeci">#define I2C_S_DRIVER</div><div class="ttdef"><b>Definition:</b> <a href="a04343_source.html#l00033">issdk_hal.h:33</a></div></div>
88<div class="ttc" id="a00884_html_afa81c629d378fe700f351a1bce411ad5"><div class="ttname"><a href="a00884.html#afa81c629d378fe700f351a1bce411ad5">sfg</a></div><div class="ttdeci">SensorFusionGlobals sfg</div><div class="ttdoc">This is the primary sensor fusion data structure. </div><div class="ttdef"><b>Definition:</b> <a href="a00884_source.html#l00044">main_freertos_two_tasks.c:44</a></div></div>
89<div class="ttc" id="a00368_html_a3c22bed16a7c769894081222aa6107d8"><div class="ttname"><a href="a00368.html#a3c22bed16a7c769894081222aa6107d8">I2Cdrv</a></div><div class="ttdeci">ARM_DRIVER_I2C * I2Cdrv</div><div class="ttdef"><b>Definition:</b> <a href="a00368_source.html#l00083">fxls896xaf_motion_wakeup.c:83</a></div></div>
90<div class="ttc" id="a00776_html_a3b6c71dda245dccb73352c7264176527"><div class="ttname"><a href="a00776.html#a3b6c71dda245dccb73352c7264176527">sUARTOutputBuffer</a></div><div class="ttdeci">uint8_t sUARTOutputBuffer[256]</div><div class="ttdoc">main output buffer defined in control.c </div><div class="ttdef"><b>Definition:</b> <a href="a00776_source.html#l00037">control.c:37</a></div></div>
91<div class="ttc" id="a04047_html_a186a484bdd7f6c3210a2ee6d2763c6a2"><div class="ttname"><a href="a04047.html#a186a484bdd7f6c3210a2ee6d2763c6a2">SensorFusionGlobals::updateStatus</a></div><div class="ttdeci">updateStatus_t * updateStatus</div><div class="ttdoc">status=next status </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00533">sensor_fusion.h:533</a></div></div>
92<div class="ttc" id="a04047_html_a22ddc1cea4daa0d93be0fe7d48365dbb"><div class="ttname"><a href="a04047.html#a22ddc1cea4daa0d93be0fe7d48365dbb">SensorFusionGlobals::installSensor</a></div><div class="ttdeci">installSensor_t * installSensor</div><div class="ttdoc">function for installing a new sensor into t </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00524">sensor_fusion.h:524</a></div></div>
93<div class="ttc" id="a04047_html_a51cbe943cdee0fd0a2ff72d2a04fad9a"><div class="ttname"><a href="a04047.html#a51cbe943cdee0fd0a2ff72d2a04fad9a">SensorFusionGlobals::pControlSubsystem</a></div><div class="ttdeci">struct ControlSubsystem * pControlSubsystem</div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00462">sensor_fusion.h:462</a></div></div>
94<div class="ttc" id="a00776_html_a67029acf1be9712c5d30c625132ad958"><div class="ttname"><a href="a00776.html#a67029acf1be9712c5d30c625132ad958">initializeControlPort</a></div><div class="ttdeci">int8_t initializeControlPort(ControlSubsystem *pComm)</div><div class="ttdoc">Initialize the control subsystem and all related hardware. </div><div class="ttdef"><b>Definition:</b> <a href="a00776_source.html#l00160">control.c:160</a></div></div>
95<div class="ttc" id="a00884_html_a729bc9c4006e68fecea92342c3c3700b"><div class="ttname"><a href="a00884.html#a729bc9c4006e68fecea92342c3c3700b">event_group</a></div><div class="ttdeci">EventGroupHandle_t event_group</div><div class="ttdef"><b>Definition:</b> <a href="a00884_source.html#l00048">main_freertos_two_tasks.c:48</a></div></div>
96<div class="ttc" id="a00812_html_a5388755d21701d88d79a4bfda99dbebf"><div class="ttname"><a href="a00812.html#a5388755d21701d88d79a4bfda99dbebf">FXOS8700_Read</a></div><div class="ttdeci">int8_t FXOS8700_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)</div><div class="ttdef"><b>Definition:</b> <a href="a00812_source.html#l00249">driver_FXOS8700.c:249</a></div></div>
97<div class="ttc" id="a00545_html_adec31513f28aceda1b78b1dba2f161fb"><div class="ttname"><a href="a00545.html#adec31513f28aceda1b78b1dba2f161fb">MPL3115_I2C_ADDR</a></div><div class="ttdeci">#define MPL3115_I2C_ADDR</div><div class="ttdef"><b>Definition:</b> <a href="a00545_source.html#l00046">auto_detection_shield.h:46</a></div></div>
98<div class="ttc" id="a00842_html_a1e2a1a192ed7f150fc24fc11df8d4c1e"><div class="ttname"><a href="a00842.html#a1e2a1a192ed7f150fc24fc11df8d4c1e">FXAS21002_Read</a></div><div class="ttdeci">int8_t FXAS21002_Read(struct PhysicalSensor *sensor, SensorFusionGlobals *sfg)</div></div>
99<div class="ttc" id="a00080_html"><div class="ttname"><a href="a00080.html">fxos8700.h</a></div><div class="ttdoc">The fxos8700.h file contains the register definitions for FXOS8700 sensor driver. ...</div></div>
100<div class="ttc" id="a00920_html_a01619741119cf3432f8cfff23334c793"><div class="ttname"><a href="a00920.html#a01619741119cf3432f8cfff23334c793">initializeStatusSubsystem</a></div><div class="ttdeci">void initializeStatusSubsystem(StatusSubsystem *pStatus)</div><div class="ttdef"><b>Definition:</b> <a href="a00920_source.html#l00165">status.c:165</a></div></div>
101<div class="ttc" id="a04343_html_ab0c7969a7fffaabe78d43db2b12ad840"><div class="ttname"><a href="a04343.html#ab0c7969a7fffaabe78d43db2b12ad840">I2C_S_DEVICE_INDEX</a></div><div class="ttdeci">#define I2C_S_DEVICE_INDEX</div><div class="ttdef"><b>Definition:</b> <a href="a04343_source.html#l00035">issdk_hal.h:35</a></div></div>
102<div class="ttc" id="a00545_html_a88d604d4e5776dfa8f16848425223cbb"><div class="ttname"><a href="a00545.html#a88d604d4e5776dfa8f16848425223cbb">FXOS8700_I2C_ADDR</a></div><div class="ttdeci">#define FXOS8700_I2C_ADDR</div><div class="ttdef"><b>Definition:</b> <a href="a00545_source.html#l00025">auto_detection_shield.h:25</a></div></div>
103<div class="ttc" id="a00959_html_ga2c9fe54b6b84723fbaa590a6f4576966"><div class="ttname"><a href="a00959.html#ga2c9fe54b6b84723fbaa590a6f4576966">BOARD_InitPins</a></div><div class="ttdeci">void BOARD_InitPins(void)</div><div class="ttdoc">Configures pin routing and optionally pin electrical features. </div><div class="ttdef"><b>Definition:</b> <a href="a04541_source.html#l00047">pin_mux.c:47</a></div></div>
104<div class="ttc" id="a03967_html_a2fc3f3736130dec532bf7f12d4091e55"><div class="ttname"><a href="a03967.html#a2fc3f3736130dec532bf7f12d4091e55">ControlSubsystem::stream</a></div><div class="ttdeci">streamData_t * stream</div><div class="ttdoc">function to create packets for serial stream </div><div class="ttdef"><b>Definition:</b> <a href="a00779_source.html#l00051">control.h:51</a></div></div>
105<div class="ttc" id="a04047_html_ac01270fc7330df24acd1cd888397ef07"><div class="ttname"><a href="a04047.html#ac01270fc7330df24acd1cd888397ef07">SensorFusionGlobals::applyPerturbation</a></div><div class="ttdeci">applyPerturbation_t * applyPerturbation</div><div class="ttdoc">apply step function for testing purposes </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00526">sensor_fusion.h:526</a></div></div>
106<div class="ttc" id="a04051_html"><div class="ttname"><a href="a04051.html">StatusSubsystem</a></div><div class="ttdoc">StatusSubsystem() provides an object-like interface for communicating status to the user...</div><div class="ttdef"><b>Definition:</b> <a href="a00923_source.html#l00022">status.h:22</a></div></div>
107<div class="ttc" id="a04047_html_a0e90feae26cd26ab80bc78cfd9364512"><div class="ttname"><a href="a04047.html#a0e90feae26cd26ab80bc78cfd9364512">SensorFusionGlobals::loopcounter</a></div><div class="ttdeci">int32_t loopcounter</div><div class="ttdoc">counter incrementing each iteration of sensor fusion (typically 25Hz) </div><div class="ttdef"><b>Definition:</b> <a href="a00914_source.html#l00471">sensor_fusion.h:471</a></div></div>
108</div><!-- fragment --></div><!-- contents -->
109
110<hr class="footer"/><address class="footer"><small>
111&copy; Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause
112</small></address>
113</body>
114</html>
115