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/pedometer/include/pedometer.h 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  <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_fee404f6f831fcfa321ee67f90b1e1c1.html">pedometer</a></li><li class="navelem"><a class="el" href="dir_0ad8eb24ff6e81580c7f28d977c24fc7.html">include</a></li> </ul> 44</div> 45</div><!-- top --> 46<div class="header"> 47 <div class="headertitle"> 48<div class="title">pedometer.h</div> </div> 49</div><!--header--> 50<div class="contents"> 51<a href="a00956.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Copyright (c) 2015, Freescale Semiconductor, Inc.</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Copyright 2016-2017 NXP</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> *</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> */</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"></span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment">/** </span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment">* @file pedometer.h</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment">* @brief The pedometer.h file contains the interface and structure definitions for</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment">* pedometer application.</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment">*/</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> </div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#ifndef PEDOMETER_H_</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#define PEDOMETER_H_</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> </div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="preprocessor">#include <stddef.h></span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <stdint.h></span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <stdbool.h></span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include "KeynetikPedometer.h"</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment"> * Public Datatypes</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment"> *****************************************************************************/</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"><a class="line" href="a00956.html#a0595338a17265357f0d301dba63e3fd3"> 26</a></span> <span class="keyword">typedef</span> KeynetikActivityLevel <a class="code" href="a00956.html#a0595338a17265357f0d301dba63e3fd3">activitylevel_t</a>; <span class="comment">/* alias to a shorter name for readability */</span></div><div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="a00956.html#a00fabbe7008a793b4929533264562c79"> 27</a></span> <span class="keyword">typedef</span> uint16_t <a class="code" href="a00956.html#a00fabbe7008a793b4929533264562c79">debounce_count_t</a>;</div><div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="a00956.html#a50d24b234d9d75077968d54a23baac13"> 28</a></span> <span class="preprocessor">#define PEDO_ONEG_8G 4096 </span><span class="comment">/* One G value for 8G mode.*/</span><span class="preprocessor"></span></div><div class="line"><a name="l00029"></a><span class="lineno"><a class="line" href="a00956.html#ac458a17d63e2edfb42ce8d057199b006"> 29</a></span> <span class="preprocessor">#define PEDO_ONEG_4G 8192 </span><span class="comment">/* One G value for 4G mode.*/</span><span class="preprocessor"></span></div><div class="line"><a name="l00030"></a><span class="lineno"><a class="line" href="a00956.html#a17d20b7d617372405447c7cbd580017b"> 30</a></span> <span class="preprocessor">#define PEDO_ONEG_2G 16384 </span><span class="comment">/* One G value for 2G mode.*/</span><span class="preprocessor"></span></div><div class="line"><a name="l00031"></a><span class="lineno"><a class="line" href="a00956.html#a3cc9f28cb35404b33588dde34f3ff99f"> 31</a></span> <span class="preprocessor">#define PEDO_FREQHZ_DEFAULT 50 </span><span class="comment">/* Default frequency*/</span><span class="preprocessor"></span></div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="a00956.html#a7aa4476f16cc506cd6353a5f367dbe43"> 32</a></span> <span class="preprocessor">#define PEDO_STEP_THRESHOLD_DEFAULT 130</span></div><div class="line"><a name="l00033"></a><span class="lineno"><a class="line" href="a00956.html#a9b92edaeb7dec66a37b4c4689a8c1d42"> 33</a></span> <span class="preprocessor">#define PEDO_SPEED_PERIOD_DEFAULT 5</span></div><div class="line"><a name="l00034"></a><span class="lineno"><a class="line" href="a00956.html#acc76895a3812c086ea1cc0e665075103"> 34</a></span> <span class="preprocessor">#define PEDO_FILTER_TIME_DEFAULT 3</span></div><div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="a00956.html#ab257f08978fd8335aad1859c1c9905e3"> 35</a></span> <span class="preprocessor">#define PEDO_FILTER_STEPS_DEFAULT 4</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="comment">/*!</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="comment"> * @brief This defines the acceleration input data for the pedometer.</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="comment"> */</span></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="a04055.html"> 39</a></span> <span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> {</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="a04055.html#a661660001effc417fb684db96e973688"> 41</a></span>  int16_t accel[3];</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> } <a class="code" href="a04055.html">ped_accel_t</a>;<span class="comment"></span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="comment">/*!</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"> * @brief This defines the configuration structure of the pedometer.</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment"> */</span></div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="a04059.html"> 46</a></span> <span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> {</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="a04059.html#a867687de96d2347342441466c8e837bb"> 48</a></span>  uint16_t <a class="code" href="a04059.html#a867687de96d2347342441466c8e837bb">sleepminimum</a>; <span class="comment">/* Sleep vector magnitude minimum */</span></div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="a04059.html#afd0819d26b95dad6c81ed177e3b8841a"> 49</a></span>  uint16_t <a class="code" href="a04059.html#afd0819d26b95dad6c81ed177e3b8841a">sleepmaximum</a>; <span class="comment">/* Sleep vector magnitude maximum */</span></div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="a04059.html#a2c49d77dccbc74c7e51171069a0f2709"> 50</a></span>  <a class="code" href="a00956.html#a00fabbe7008a793b4929533264562c79">debounce_count_t</a> <a class="code" href="a04059.html#a2c49d77dccbc74c7e51171069a0f2709">sleepcount_threshold</a>; <span class="comment">/* Sleep debounce counter threshold */</span></div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keyword">struct</span></div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  {</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="a04059.html#a8b4eebe79ded0459acec2f4950102ba3"> 53</a></span>  uint8_t : 5; <span class="comment">/* Reserved */</span></div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="a04059.html#a49c062ff578f76fa902e43245024202c"> 54</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04059.html#a49c062ff578f76fa902e43245024202c">sleep_dbcntm</a> : 1; <span class="comment">/* Sleep debounce counter mode. Set to 1 to clear the debounce counter when the test</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> <span class="comment"> condition fails, otherwise decrement. */</span></div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="a04059.html#a80ad04273bcbca039bf53f5224b96f4e"> 56</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04059.html#a80ad04273bcbca039bf53f5224b96f4e">activity_dbcntm</a> : 1; <span class="comment">/* Activity debounce counter mode. Set to 1 to clear the debounce counter when the</span></div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="comment"> test condition fails, otherwise decrement. */</span></div><div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="a04059.html#aadde00e0c01172f078246131d26bdace"> 58</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04059.html#aadde00e0c01172f078246131d26bdace">config</a> : 1; <span class="comment">/* Set to 1 to initialize the pedometer and configure it with the other configuration</span></div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> <span class="comment"> variables. */</span></div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  } bits;</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="a04059.html#a31a77bbdd26e32b3982f054d600f7d9a"> 61</a></span>  KeynetikConfig <a class="code" href="a04059.html#a31a77bbdd26e32b3982f054d600f7d9a">keynetik</a>; <span class="comment">/* Keynetik parameters (step length, height, weight, etc) */</span></div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="a04059.html#a458f550d6843e8fb60674eae971c0cb9"> 62</a></span>  <a class="code" href="a00956.html#a00fabbe7008a793b4929533264562c79">debounce_count_t</a> <a class="code" href="a04059.html#a458f550d6843e8fb60674eae971c0cb9">activitycount_threshold</a>; <span class="comment">/* Activity debounce counter threshold */</span></div><div class="line"><a name="l00063"></a><span class="lineno"><a class="line" href="a04059.html#ac86ef7d4985c951ba8930d11e2f3a485"> 63</a></span>  uint8_t <a class="code" href="a04059.html#ac86ef7d4985c951ba8930d11e2f3a485">stepcoalesce</a>; <span class="comment">/* Number of steps to coalesce for step interrupt */</span></div><div class="line"><a name="l00064"></a><span class="lineno"><a class="line" href="a04059.html#a0afa045b0bbb9be99912c04821d883f6"> 64</a></span>  uint16_t <a class="code" href="a04059.html#a0afa045b0bbb9be99912c04821d883f6">oneG</a>; <span class="comment">/* One G value for the range at accelerometer is running. refer the data sheet of the accelerometer</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span> <span class="comment"> and compute this value.</span></div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span> <span class="comment"> eg. 2G Mode, 1G is 4096.*/</span></div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="a04059.html#aea762e0e67fcafaf5b3cd61201769926"> 67</a></span>  uint16_t <a class="code" href="a04059.html#aea762e0e67fcafaf5b3cd61201769926">frequency</a>; <span class="comment">/* The frequency at which accelerometer runs in HZ. best set frequencies are 25HZ or 50HZ. It</span></div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="comment"> can run at higher too.*/</span></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> } <a class="code" href="a04059.html">pedometer_config_t</a>;<span class="comment"></span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment">/*!</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> <span class="comment"> * @brief This defines the pedometer instance.</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> <span class="comment"> */</span></div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="a04067.html"> 73</a></span> <span class="keyword">typedef</span> <span class="keyword">struct</span></div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span> {</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="a04071.html"> 75</a></span>  <span class="keyword">struct </span><a class="code" href="a04071.html">pedometer_status_tag</a></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  {</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  <span class="keyword">union</span></div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  {</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keyword">struct</span></div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  {</div><div class="line"><a name="l00081"></a><span class="lineno"><a class="line" href="a04071.html#a9a9af171021693cd007b9bd7a2c36c88"> 81</a></span>  <a class="code" href="a00956.html#a0595338a17265357f0d301dba63e3fd3">activitylevel_t</a> <a class="code" href="a04071.html#a9a9af171021693cd007b9bd7a2c36c88">activity</a> : 3; <span class="comment">/* Activity level. */</span></div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="a04071.html#a7465e84269976320bca6706735ed03b9"> 82</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04071.html#a7465e84269976320bca6706735ed03b9">suspend</a> : 1; <span class="comment">/* Pedometer autonomously suspended. */</span></div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="a04071.html#ae115099b8f821074b4bd78b8cb59ff1b"> 83</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04071.html#ae115099b8f821074b4bd78b8cb59ff1b">activitychange</a> : 1; <span class="comment">/* Change in activity level. */</span></div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="a04071.html#a99cf7af215662a92acf812184e934c45"> 84</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04071.html#a99cf7af215662a92acf812184e934c45">stepchange</a> : 1; <span class="comment">/* Change in step count. */</span></div><div class="line"><a name="l00085"></a><span class="lineno"><a class="line" href="a04071.html#a5104f60d694a7a97300f45b9f101affc"> 85</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04071.html#a5104f60d694a7a97300f45b9f101affc">suspendchange</a> : 1; <span class="comment">/* Change in suspend state .*/</span></div><div class="line"><a name="l00086"></a><span class="lineno"><a class="line" href="a04071.html#ab9d0f0a4c97ad0fd0b0be794a7b4bc9d"> 86</a></span>  <span class="keywordtype">bool</span> <a class="code" href="a04071.html#ab9d0f0a4c97ad0fd0b0be794a7b4bc9d">mergedflags</a> : 1; <span class="comment">/* Merged status flags. */</span></div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>  } bits;</div><div class="line"><a name="l00088"></a><span class="lineno"><a class="line" href="a04071.html#a96f44d20f1dbf1c8785a7bc99a46164c"> 88</a></span>  uint8_t <a class="code" href="a04071.html#a96f44d20f1dbf1c8785a7bc99a46164c">byte</a>;</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  } <a class="code" href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a>;</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="a04071.html#ab22abc2906422da61885ac6c8e6a1a59"> 90</a></span>  uint8_t <a class="code" href="a04071.html#ab22abc2906422da61885ac6c8e6a1a59">version</a>; <span class="comment">/* Pedometer version number. */</span></div><div class="line"><a name="l00091"></a><span class="lineno"><a class="line" href="a04071.html#ace0ff960f4cd3ce9aa8452dc57a97c2e"> 91</a></span>  uint16_t <a class="code" href="a04071.html#ace0ff960f4cd3ce9aa8452dc57a97c2e">stepcount</a>; <span class="comment">/* Step count. */</span></div><div class="line"><a name="l00092"></a><span class="lineno"><a class="line" href="a04071.html#a7ae9d3ad463ec7a0eb38ee23a15c51e7"> 92</a></span>  uint16_t <a class="code" href="a04071.html#a7ae9d3ad463ec7a0eb38ee23a15c51e7">distance</a>; <span class="comment">/* Total distance in meters or activity state. */</span></div><div class="line"><a name="l00093"></a><span class="lineno"><a class="line" href="a04071.html#a12633132d07532aac2bd05fa1d5c8a72"> 93</a></span>  uint16_t <a class="code" href="a04071.html#a12633132d07532aac2bd05fa1d5c8a72">speed</a>; <span class="comment">/* Average speed in meters per hour. The value is updated on the completion of each step. */</span></div><div class="line"><a name="l00094"></a><span class="lineno"><a class="line" href="a04071.html#a1317c431cecdc37eca645ff53566ff97"> 94</a></span>  uint16_t <a class="code" href="a04071.html#a1317c431cecdc37eca645ff53566ff97">calories</a>; <span class="comment">/* Calorie count expended. */</span></div><div class="line"><a name="l00095"></a><span class="lineno"><a class="line" href="a04071.html#aa002fd6818c81cabd8ad9e41ba63951f"> 95</a></span>  <a class="code" href="a00956.html#a00fabbe7008a793b4929533264562c79">debounce_count_t</a> <a class="code" href="a04071.html#aa002fd6818c81cabd8ad9e41ba63951f">sleepcount</a>; <span class="comment">/* Sleep debounce counter. */</span></div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  } <a class="code" href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a>;</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="a04067.html#a2f1259e55605da0fb4eed707f775c170"> 97</a></span>  <a class="code" href="a04059.html">pedometer_config_t</a> <a class="code" href="a04067.html#a2f1259e55605da0fb4eed707f775c170">config</a>; <span class="comment">/* Pedometer configuration.*/</span></div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="a04083.html"> 98</a></span>  <span class="keyword">struct </span><a class="code" href="a04083.html">pedometer_private_tag</a></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  {</div><div class="line"><a name="l00100"></a><span class="lineno"><a class="line" href="a04083.html#a5a3edadb40c8bc1e3ba7bdcce7ed47e8"> 100</a></span>  <a class="code" href="a00956.html#a00fabbe7008a793b4929533264562c79">debounce_count_t</a> <a class="code" href="a04083.html#a5a3edadb40c8bc1e3ba7bdcce7ed47e8">activitycount</a>; <span class="comment">/* Activity debounce counter. */</span></div><div class="line"><a name="l00101"></a><span class="lineno"><a class="line" href="a04083.html#ae71e38a7c4c0d6be723c1bc142d988f3"> 101</a></span>  uint16_t <a class="code" href="a04083.html#ae71e38a7c4c0d6be723c1bc142d988f3">stepchg_stepcount</a>; <span class="comment">/* Step count at last stepchange interrupt (for step coalesing) */</span></div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  } <span class="keyword">private</span>;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> } <a class="code" href="a04067.html">pedometer_t</a>;</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> </div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="comment">/******************************************************************************</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="comment"> * Public Function Declarations</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span> <span class="comment"> ******************************************************************************/</span></div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> <span class="comment">/*******************************************************************************</span></div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span> <span class="comment"> * API</span></div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span> <span class="comment"> ******************************************************************************/</span><span class="comment"></span></div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span> <span class="comment">/*! @brief The interface function initialize the pedometer.</span></div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> <span class="comment"> * @details This function initialize the pedometer structure and return the handle.</span></div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span> <span class="comment"></span></div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> <span class="comment"> * @param[in] pPedometer handle to the pedometer.</span></div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> <span class="comment"> *</span></div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> <span class="comment"> * @return void.</span></div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> <span class="comment"> *</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span> <span class="comment"> * @Constraints None</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> <span class="comment"> *</span></div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span> <span class="comment"> * @Reentrant Yes</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> <span class="comment"> */</span></div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span> <span class="keywordtype">void</span> <a class="code" href="a00956.html#a594d690252fcfc6713fe8374f384fe69">pedometer_init</a>(<a class="code" href="a04067.html">pedometer_t</a> *pPedometer);</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span> <span class="comment"></span></div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment">/*! @brief The interface function to configure the pedometer.</span></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"> *</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> <span class="comment"> * @param[in] pedometer_t handle to the pedometer.</span></div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span> <span class="comment"> * @param[in] config configuration value.</span></div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> <span class="comment"> *</span></div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span> <span class="comment"> * @return void.</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> <span class="comment"> *</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span> <span class="comment"> * @Constraints None</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span> <span class="comment"> *</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span> <span class="comment"> * @Reentrant Yes</span></div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> <span class="comment"> */</span></div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span> <span class="keywordtype">void</span> <a class="code" href="a00956.html#a5ea8580b8a07ce9ece550f8b6fd37ced">pedometer_configure</a>(<a class="code" href="a04067.html">pedometer_t</a> *pPedometer, <span class="keyword">const</span> <a class="code" href="a04059.html">pedometer_config_t</a> *pConfig);<span class="comment"></span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <span class="comment">/*! @brief The interface function excutes the pedometer algorithm.</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span> <span class="comment"> * @details Call this function the rate at which accelerometer runs.</span></div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span> <span class="comment"></span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> <span class="comment"> * @param[in] pPedometer handle to the pedometer.</span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="comment"> * @param[in] accel_data acceleration data.</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span> <span class="comment"> * @return ::pedometer_run() returns the status .</span></div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> <span class="comment"> *</span></div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> <span class="comment"> * @Constraints None</span></div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span> <span class="comment"> *</span></div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> <span class="comment"> * @Reentrant Yes</span></div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="comment"> */</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span> <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00956.html#a87224a70b303355a416beaca80ed1b2f">pedometer_run</a>(<a class="code" href="a04067.html">pedometer_t</a> *pPedometer, <a class="code" href="a04055.html">ped_accel_t</a> *pData);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span> </div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span> <span class="preprocessor">#endif // PEDOMETER_H_</span></div><div class="ttc" id="a04059_html_a31a77bbdd26e32b3982f054d600f7d9a"><div class="ttname"><a href="a04059.html#a31a77bbdd26e32b3982f054d600f7d9a">pedometer_config_t::keynetik</a></div><div class="ttdeci">KeynetikConfig keynetik</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00061">pedometer.h:61</a></div></div> 52<div class="ttc" id="a00956_html_a0595338a17265357f0d301dba63e3fd3"><div class="ttname"><a href="a00956.html#a0595338a17265357f0d301dba63e3fd3">activitylevel_t</a></div><div class="ttdeci">KeynetikActivityLevel activitylevel_t</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00026">pedometer.h:26</a></div></div> 53<div class="ttc" id="a04071_html"><div class="ttname"><a href="a04071.html">pedometer_t::pedometer_status_tag</a></div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00075">pedometer.h:75</a></div></div> 54<div class="ttc" id="a00359_html_a369536ebfe385731562c0b55dd6f3a7c"><div class="ttname"><a href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a></div><div class="ttdeci">int32_t status</div><div class="ttdef"><b>Definition:</b> <a href="a00359_source.html#l00248">fxls896xaf_freemaster_demo.c:248</a></div></div> 55<div class="ttc" id="a04059_html_ac86ef7d4985c951ba8930d11e2f3a485"><div class="ttname"><a href="a04059.html#ac86ef7d4985c951ba8930d11e2f3a485">pedometer_config_t::stepcoalesce</a></div><div class="ttdeci">uint8_t stepcoalesce</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00063">pedometer.h:63</a></div></div> 56<div class="ttc" id="a04071_html_a7ae9d3ad463ec7a0eb38ee23a15c51e7"><div class="ttname"><a href="a04071.html#a7ae9d3ad463ec7a0eb38ee23a15c51e7">pedometer_t::pedometer_status_tag::distance</a></div><div class="ttdeci">uint16_t distance</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00092">pedometer.h:92</a></div></div> 57<div class="ttc" id="a04071_html_a96f44d20f1dbf1c8785a7bc99a46164c"><div class="ttname"><a href="a04071.html#a96f44d20f1dbf1c8785a7bc99a46164c">pedometer_t::pedometer_status_tag::byte</a></div><div class="ttdeci">uint8_t byte</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00088">pedometer.h:88</a></div></div> 58<div class="ttc" id="a04059_html_a80ad04273bcbca039bf53f5224b96f4e"><div class="ttname"><a href="a04059.html#a80ad04273bcbca039bf53f5224b96f4e">pedometer_config_t::activity_dbcntm</a></div><div class="ttdeci">bool activity_dbcntm</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00056">pedometer.h:56</a></div></div> 59<div class="ttc" id="a04059_html_a49c062ff578f76fa902e43245024202c"><div class="ttname"><a href="a04059.html#a49c062ff578f76fa902e43245024202c">pedometer_config_t::sleep_dbcntm</a></div><div class="ttdeci">bool sleep_dbcntm</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00054">pedometer.h:54</a></div></div> 60<div class="ttc" id="a04059_html"><div class="ttname"><a href="a04059.html">pedometer_config_t</a></div><div class="ttdoc">This defines the configuration structure of the pedometer. </div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00046">pedometer.h:46</a></div></div> 61<div class="ttc" id="a04059_html_a2c49d77dccbc74c7e51171069a0f2709"><div class="ttname"><a href="a04059.html#a2c49d77dccbc74c7e51171069a0f2709">pedometer_config_t::sleepcount_threshold</a></div><div class="ttdeci">debounce_count_t sleepcount_threshold</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00050">pedometer.h:50</a></div></div> 62<div class="ttc" id="a04071_html_a99cf7af215662a92acf812184e934c45"><div class="ttname"><a href="a04071.html#a99cf7af215662a92acf812184e934c45">pedometer_t::pedometer_status_tag::stepchange</a></div><div class="ttdeci">bool stepchange</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00084">pedometer.h:84</a></div></div> 63<div class="ttc" id="a00521_html_a5d7069350a7d7e65686c77a8038f462f"><div class="ttname"><a href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a></div><div class="ttdeci">typedef int32_t(DATA_FORMAT_Append_t))(void *pData</div><div class="ttdoc">The interface function to append the data on the formated stream. </div></div> 64<div class="ttc" id="a04059_html_a458f550d6843e8fb60674eae971c0cb9"><div class="ttname"><a href="a04059.html#a458f550d6843e8fb60674eae971c0cb9">pedometer_config_t::activitycount_threshold</a></div><div class="ttdeci">debounce_count_t activitycount_threshold</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00062">pedometer.h:62</a></div></div> 65<div class="ttc" id="a04067_html"><div class="ttname"><a href="a04067.html">pedometer_t</a></div><div class="ttdoc">This defines the pedometer instance. </div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00073">pedometer.h:73</a></div></div> 66<div class="ttc" id="a04071_html_ae115099b8f821074b4bd78b8cb59ff1b"><div class="ttname"><a href="a04071.html#ae115099b8f821074b4bd78b8cb59ff1b">pedometer_t::pedometer_status_tag::activitychange</a></div><div class="ttdeci">bool activitychange</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00083">pedometer.h:83</a></div></div> 67<div class="ttc" id="a04083_html_ae71e38a7c4c0d6be723c1bc142d988f3"><div class="ttname"><a href="a04083.html#ae71e38a7c4c0d6be723c1bc142d988f3">pedometer_t::pedometer_private_tag::stepchg_stepcount</a></div><div class="ttdeci">uint16_t stepchg_stepcount</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00101">pedometer.h:101</a></div></div> 68<div class="ttc" id="a04055_html"><div class="ttname"><a href="a04055.html">ped_accel_t</a></div><div class="ttdoc">This defines the acceleration input data for the pedometer. </div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00039">pedometer.h:39</a></div></div> 69<div class="ttc" id="a04071_html_a1317c431cecdc37eca645ff53566ff97"><div class="ttname"><a href="a04071.html#a1317c431cecdc37eca645ff53566ff97">pedometer_t::pedometer_status_tag::calories</a></div><div class="ttdeci">uint16_t calories</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00094">pedometer.h:94</a></div></div> 70<div class="ttc" id="a04071_html_a7465e84269976320bca6706735ed03b9"><div class="ttname"><a href="a04071.html#a7465e84269976320bca6706735ed03b9">pedometer_t::pedometer_status_tag::suspend</a></div><div class="ttdeci">bool suspend</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00082">pedometer.h:82</a></div></div> 71<div class="ttc" id="a04071_html_ab22abc2906422da61885ac6c8e6a1a59"><div class="ttname"><a href="a04071.html#ab22abc2906422da61885ac6c8e6a1a59">pedometer_t::pedometer_status_tag::version</a></div><div class="ttdeci">uint8_t version</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00090">pedometer.h:90</a></div></div> 72<div class="ttc" id="a04059_html_aea762e0e67fcafaf5b3cd61201769926"><div class="ttname"><a href="a04059.html#aea762e0e67fcafaf5b3cd61201769926">pedometer_config_t::frequency</a></div><div class="ttdeci">uint16_t frequency</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00067">pedometer.h:67</a></div></div> 73<div class="ttc" id="a04059_html_aadde00e0c01172f078246131d26bdace"><div class="ttname"><a href="a04059.html#aadde00e0c01172f078246131d26bdace">pedometer_config_t::config</a></div><div class="ttdeci">bool config</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00058">pedometer.h:58</a></div></div> 74<div class="ttc" id="a04071_html_a5104f60d694a7a97300f45b9f101affc"><div class="ttname"><a href="a04071.html#a5104f60d694a7a97300f45b9f101affc">pedometer_t::pedometer_status_tag::suspendchange</a></div><div class="ttdeci">bool suspendchange</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00085">pedometer.h:85</a></div></div> 75<div class="ttc" id="a04059_html_a867687de96d2347342441466c8e837bb"><div class="ttname"><a href="a04059.html#a867687de96d2347342441466c8e837bb">pedometer_config_t::sleepminimum</a></div><div class="ttdeci">uint16_t sleepminimum</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00048">pedometer.h:48</a></div></div> 76<div class="ttc" id="a04083_html"><div class="ttname"><a href="a04083.html">pedometer_t::pedometer_private_tag</a></div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00098">pedometer.h:98</a></div></div> 77<div class="ttc" id="a04083_html_a5a3edadb40c8bc1e3ba7bdcce7ed47e8"><div class="ttname"><a href="a04083.html#a5a3edadb40c8bc1e3ba7bdcce7ed47e8">pedometer_t::pedometer_private_tag::activitycount</a></div><div class="ttdeci">debounce_count_t activitycount</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00100">pedometer.h:100</a></div></div> 78<div class="ttc" id="a04071_html_a12633132d07532aac2bd05fa1d5c8a72"><div class="ttname"><a href="a04071.html#a12633132d07532aac2bd05fa1d5c8a72">pedometer_t::pedometer_status_tag::speed</a></div><div class="ttdeci">uint16_t speed</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00093">pedometer.h:93</a></div></div> 79<div class="ttc" id="a04067_html_a2f1259e55605da0fb4eed707f775c170"><div class="ttname"><a href="a04067.html#a2f1259e55605da0fb4eed707f775c170">pedometer_t::config</a></div><div class="ttdeci">pedometer_config_t config</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00097">pedometer.h:97</a></div></div> 80<div class="ttc" id="a00956_html_a00fabbe7008a793b4929533264562c79"><div class="ttname"><a href="a00956.html#a00fabbe7008a793b4929533264562c79">debounce_count_t</a></div><div class="ttdeci">uint16_t debounce_count_t</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00027">pedometer.h:27</a></div></div> 81<div class="ttc" id="a04059_html_afd0819d26b95dad6c81ed177e3b8841a"><div class="ttname"><a href="a04059.html#afd0819d26b95dad6c81ed177e3b8841a">pedometer_config_t::sleepmaximum</a></div><div class="ttdeci">uint16_t sleepmaximum</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00049">pedometer.h:49</a></div></div> 82<div class="ttc" id="a04071_html_aa002fd6818c81cabd8ad9e41ba63951f"><div class="ttname"><a href="a04071.html#aa002fd6818c81cabd8ad9e41ba63951f">pedometer_t::pedometer_status_tag::sleepcount</a></div><div class="ttdeci">debounce_count_t sleepcount</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00095">pedometer.h:95</a></div></div> 83<div class="ttc" id="a04059_html_a0afa045b0bbb9be99912c04821d883f6"><div class="ttname"><a href="a04059.html#a0afa045b0bbb9be99912c04821d883f6">pedometer_config_t::oneG</a></div><div class="ttdeci">uint16_t oneG</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00064">pedometer.h:64</a></div></div> 84<div class="ttc" id="a00956_html_a87224a70b303355a416beaca80ed1b2f"><div class="ttname"><a href="a00956.html#a87224a70b303355a416beaca80ed1b2f">pedometer_run</a></div><div class="ttdeci">int32_t pedometer_run(pedometer_t *pPedometer, ped_accel_t *pData)</div><div class="ttdoc">The interface function excutes the pedometer algorithm. </div><div class="ttdef"><b>Definition:</b> <a href="a00926_source.html#l00125">pedometer.c:125</a></div></div> 85<div class="ttc" id="a00956_html_a5ea8580b8a07ce9ece550f8b6fd37ced"><div class="ttname"><a href="a00956.html#a5ea8580b8a07ce9ece550f8b6fd37ced">pedometer_configure</a></div><div class="ttdeci">void pedometer_configure(pedometer_t *pPedometer, const pedometer_config_t *pConfig)</div><div class="ttdoc">The interface function to configure the pedometer. </div><div class="ttdef"><b>Definition:</b> <a href="a00926_source.html#l00111">pedometer.c:111</a></div></div> 86<div class="ttc" id="a04071_html_ab9d0f0a4c97ad0fd0b0be794a7b4bc9d"><div class="ttname"><a href="a04071.html#ab9d0f0a4c97ad0fd0b0be794a7b4bc9d">pedometer_t::pedometer_status_tag::mergedflags</a></div><div class="ttdeci">bool mergedflags</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00086">pedometer.h:86</a></div></div> 87<div class="ttc" id="a04071_html_ace0ff960f4cd3ce9aa8452dc57a97c2e"><div class="ttname"><a href="a04071.html#ace0ff960f4cd3ce9aa8452dc57a97c2e">pedometer_t::pedometer_status_tag::stepcount</a></div><div class="ttdeci">uint16_t stepcount</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00091">pedometer.h:91</a></div></div> 88<div class="ttc" id="a04071_html_a9a9af171021693cd007b9bd7a2c36c88"><div class="ttname"><a href="a04071.html#a9a9af171021693cd007b9bd7a2c36c88">pedometer_t::pedometer_status_tag::activity</a></div><div class="ttdeci">activitylevel_t activity</div><div class="ttdef"><b>Definition:</b> <a href="a00956_source.html#l00081">pedometer.h:81</a></div></div> 89<div class="ttc" id="a00956_html_a594d690252fcfc6713fe8374f384fe69"><div class="ttname"><a href="a00956.html#a594d690252fcfc6713fe8374f384fe69">pedometer_init</a></div><div class="ttdeci">void pedometer_init(pedometer_t *pPedometer)</div><div class="ttdoc">The interface function initialize the pedometer. </div><div class="ttdef"><b>Definition:</b> <a href="a00926_source.html#l00097">pedometer.c:97</a></div></div> 90</div><!-- fragment --></div><!-- contents --> 91 92<hr class="footer"/><address class="footer"><small> 93© Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause 94</small></address> 95</body> 96</html> 97