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: sensors/isl29023_drv.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  <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_c77a8e2546a9c75bbba96be2ef542c8e.html">sensors</a></li> </ul> 44</div> 45</div><!-- top --> 46<div class="header"> 47 <div class="headertitle"> 48<div class="title">isl29023_drv.c</div> </div> 49</div><!--header--> 50<div class="contents"> 51<a href="a00107.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 2018 NXP</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * All rights reserved.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> */</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"> * @file isl29023_drv.c</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * @brief The isl29023_drv.c file implements the isl29023 functional interface.</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> */</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</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> <span class="comment">// ISSDK Includes</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include "<a class="code" href="a00110.html">isl29023_drv.h</a>"</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="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="comment">// Functions</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="comment">//-----------------------------------------------------------------------</span></div><div class="line"><a name="l00021"></a><span class="lineno"><a class="line" href="a00110.html#a0a00346af6811d0cc28de254c2d5db93"> 21</a></span> <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00107.html#a590d476df5662e5e3eaf99a0789136ca">ISL29023_I2C_Initialize</a>(</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  <a class="code" href="a02947.html">isl29023_i2c_sensorhandle_t</a> *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t test)</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> {</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a>;</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  uint8_t reg;</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="comment"></span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="comment"> /*! Check the input parameters. */</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="keywordflow">if</span> ((pSensorHandle == NULL) || (pBus == NULL))</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  {</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca78230e17f41b0ec3e31a708f36c7eaa7">SENSOR_ERROR_INVALID_PARAM</a>;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  }</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> </div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>.<a class="code" href="a03819.html#a693f84e28d48677a73cd40d7e5fc79ed">deviceInstance</a> = index;</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>.<a class="code" href="a03819.html#abb8c8f961a02b447e127bd6ef3215c7d">functionParam</a> = NULL;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>.<a class="code" href="a03819.html#acf9a866fc6b31f72a8e26437420e0354">idleFunction</a> = NULL;</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"> /*! Read and store the device's test.*/</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  status = <a class="code" href="a00167.html#ac8a60c799d9dbc84531b4680762eb8dc">Register_I2C_Read</a>(pBus, &pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>, sAddress, <a class="code" href="a00104.html#a82f2c6e4d47f62f6b65c5887eb096fd5a922c33ea55138f286ed8240d77cb02a8">ISL29023_TEST</a>, 1, &reg);</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keywordflow">if</span> ((ARM_DRIVER_OK != status) || (test != reg))</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  {</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  pSensorHandle-><a class="code" href="a02947.html#a1fdc2bf5595c2e64dc06d987769834eb">isInitialized</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca7f5031b1497c3a8a4bcb78cce879dedd">SENSOR_ERROR_INIT</a>;</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  }</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="comment"></span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="comment"> /*! Initialize the sensor handle. */</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  pSensorHandle-><a class="code" href="a02947.html#af6d4d51d4fb48cfb392eeb03ac26abed">pCommDrv</a> = pBus;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  pSensorHandle-><a class="code" href="a02947.html#a67af74c3fc959654c6dc8bcff3a2ea80">slaveAddress</a> = sAddress;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  pSensorHandle-><a class="code" href="a02947.html#a1fdc2bf5595c2e64dc06d987769834eb">isInitialized</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274">SENSOR_ERROR_NONE</a>;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> }</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="a00110.html#a8dcf1dde0281c8d82fa296ede1d80157"> 52</a></span> <span class="keywordtype">void</span> <a class="code" href="a00107.html#a8dcf1dde0281c8d82fa296ede1d80157">ISL29023_I2C_SetIdleTask</a>(<a class="code" href="a02947.html">isl29023_i2c_sensorhandle_t</a> *pSensorHandle,</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <a class="code" href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a> idleTask,</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordtype">void</span> *userParam)</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> {</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>.<a class="code" href="a03819.html#abb8c8f961a02b447e127bd6ef3215c7d">functionParam</a> = userParam;</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>.<a class="code" href="a03819.html#acf9a866fc6b31f72a8e26437420e0354">idleFunction</a> = idleTask;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> }</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> </div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="a00110.html#a7080e6e4c87f884467ded36ad2a1846a"> 60</a></span> <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00107.html#a7080e6e4c87f884467ded36ad2a1846a">ISL29023_I2C_Configure</a>(<a class="code" href="a02947.html">isl29023_i2c_sensorhandle_t</a> *pSensorHandle, <span class="keyword">const</span> <a class="code" href="a03807.html">registerwritelist_t</a> *pRegWriteList)</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> {</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a>;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> <span class="comment"></span></div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span> <span class="comment"> /*! Validate for the correct handle and register write list.*/</span></div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordflow">if</span> ((pSensorHandle == NULL) || (pRegWriteList == NULL))</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  {</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca78230e17f41b0ec3e31a708f36c7eaa7">SENSOR_ERROR_INVALID_PARAM</a>;</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  }</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="comment"></span></div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> <span class="comment"> /*! Check whether sensor handle is initialized before applying configuration.*/</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="keywordflow">if</span> (pSensorHandle-><a class="code" href="a02947.html#a1fdc2bf5595c2e64dc06d987769834eb">isInitialized</a> != <span class="keyword">true</span>)</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca7f5031b1497c3a8a4bcb78cce879dedd">SENSOR_ERROR_INIT</a>;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  }</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> <span class="comment"></span></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <span class="comment"> /*! Apply the Sensor Configuration based on the Register Write List */</span></div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  status = <a class="code" href="a00182.html#aaac4c4f34b4dd37d3f202a1dbb4b000b">Sensor_I2C_Write</a>(pSensorHandle-><a class="code" href="a02947.html#af6d4d51d4fb48cfb392eeb03ac26abed">pCommDrv</a>, &pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>, pSensorHandle-><a class="code" href="a02947.html#a67af74c3fc959654c6dc8bcff3a2ea80">slaveAddress</a>,</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  pRegWriteList);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  <span class="keywordflow">if</span> (ARM_DRIVER_OK != status)</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  {</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5acae2a1d27a0c4405ab02566a7fc618d193">SENSOR_ERROR_WRITE</a>;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  }</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274">SENSOR_ERROR_NONE</a>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span> }</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="a00110.html#aa8ca6dc6e2e7a435afab374d122233c3"> 87</a></span> <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00107.html#aa8ca6dc6e2e7a435afab374d122233c3">ISL29023_I2C_ReadData</a>(<a class="code" href="a02947.html">isl29023_i2c_sensorhandle_t</a> *pSensorHandle,</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keyword">const</span> <a class="code" href="a03811.html">registerreadlist_t</a> *pReadList,</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  uint8_t *pBuffer)</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span> {</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a>;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span> <span class="comment"></span></div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="comment"> /*! Validate for the correct handle and register read list.*/</span></div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  <span class="keywordflow">if</span> ((pSensorHandle == NULL) || (pReadList == NULL) || (pBuffer == NULL))</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  {</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca78230e17f41b0ec3e31a708f36c7eaa7">SENSOR_ERROR_INVALID_PARAM</a>;</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  }</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span> <span class="comment"></span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> <span class="comment"> /*! Check whether sensor handle is initialized before reading sensor data.*/</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <span class="keywordflow">if</span> (pSensorHandle-><a class="code" href="a02947.html#a1fdc2bf5595c2e64dc06d987769834eb">isInitialized</a> != <span class="keyword">true</span>)</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  {</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca7f5031b1497c3a8a4bcb78cce879dedd">SENSOR_ERROR_INIT</a>;</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  }</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span> <span class="comment"></span></div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> <span class="comment"> /*! Parse through the read list and read the data one by one. */</span></div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  status = <a class="code" href="a00182.html#aa75349faed7c77807cb88d9224aa2636">Sensor_I2C_Read</a>(pSensorHandle-><a class="code" href="a02947.html#af6d4d51d4fb48cfb392eeb03ac26abed">pCommDrv</a>, &pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>, pSensorHandle-><a class="code" href="a02947.html#a67af74c3fc959654c6dc8bcff3a2ea80">slaveAddress</a>,</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  pReadList, pBuffer);</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">if</span> (ARM_DRIVER_OK != status)</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  {</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5acab93ad77156e08d1bebe52bf46936cccc">SENSOR_ERROR_READ</a>;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span> </div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274">SENSOR_ERROR_NONE</a>;</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span> }</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="a00110.html#a0f976578dc6fcb91186ecbbae243681c"> 116</a></span> <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00107.html#a0f976578dc6fcb91186ecbbae243681c">ISL29023_I2C_DeInit</a>(<a class="code" href="a02947.html">isl29023_i2c_sensorhandle_t</a> *pSensorHandle)</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> {</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <a class="code" href="a00521.html#a5d7069350a7d7e65686c77a8038f462f">int32_t</a> <a class="code" href="a00359.html#a369536ebfe385731562c0b55dd6f3a7c">status</a>;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span> </div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">if</span> (pSensorHandle == NULL)</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  {</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca78230e17f41b0ec3e31a708f36c7eaa7">SENSOR_ERROR_INVALID_PARAM</a>;</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  }</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> <span class="comment"></span></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> <span class="comment"> /*! Check whether sensor handle is initialized before triggering sensor reset.*/</span></div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">if</span> (pSensorHandle-><a class="code" href="a02947.html#a1fdc2bf5595c2e64dc06d987769834eb">isInitialized</a> != <span class="keyword">true</span>)</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca7f5031b1497c3a8a4bcb78cce879dedd">SENSOR_ERROR_INIT</a>;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</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"> /*! Trigger sensor device reset.*/</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  status = <a class="code" href="a00167.html#ad08d2c7880bc5f09fd27eee247311448">Register_I2C_Write</a>(pSensorHandle-><a class="code" href="a02947.html#af6d4d51d4fb48cfb392eeb03ac26abed">pCommDrv</a>, &pSensorHandle-><a class="code" href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">deviceInfo</a>, pSensorHandle-><a class="code" href="a02947.html#a67af74c3fc959654c6dc8bcff3a2ea80">slaveAddress</a>,</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <a class="code" href="a00104.html#a82f2c6e4d47f62f6b65c5887eb096fd5a4751b76e648b9068c57edb07cd9e95c8">ISL29023_CMD_I</a>, <a class="code" href="a00104.html#acff35b3e7629c3d450d281421894cab7">ISL29023_CMD_I_OP_POWER_DOWN</a>, <a class="code" href="a00104.html#affe26f35291d4fef4fc4505c88ade452">ISL29023_CMD_I_OP_MASK</a>, <span class="keyword">false</span>);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keywordflow">if</span> (ARM_DRIVER_OK != status)</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  {</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5acae2a1d27a0c4405ab02566a7fc618d193">SENSOR_ERROR_WRITE</a>;</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  }</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">else</span></div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  {<span class="comment"></span></div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span> <span class="comment"> /*! De-initialize sensor handle. */</span></div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  pSensorHandle-><a class="code" href="a02947.html#a1fdc2bf5595c2e64dc06d987769834eb">isInitialized</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  }</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span> </div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <span class="keywordflow">return</span> <a class="code" href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274">SENSOR_ERROR_NONE</a>;</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> }</div><div class="ttc" id="a00179_html_a18a00cbfd8ad83c7fd229cd0d5fad5acae2a1d27a0c4405ab02566a7fc618d193"><div class="ttname"><a href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5acae2a1d27a0c4405ab02566a7fc618d193">SENSOR_ERROR_WRITE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00037">sensor_drv.h:37</a></div></div> 52<div class="ttc" id="a00104_html_affe26f35291d4fef4fc4505c88ade452"><div class="ttname"><a href="a00104.html#affe26f35291d4fef4fc4505c88ade452">ISL29023_CMD_I_OP_MASK</a></div><div class="ttdeci">#define ISL29023_CMD_I_OP_MASK</div><div class="ttdef"><b>Definition:</b> <a href="a00104_source.html#l00058">isl29023.h:58</a></div></div> 53<div class="ttc" id="a00110_html"><div class="ttname"><a href="a00110.html">isl29023_drv.h</a></div><div class="ttdoc">The isl29023_drv.h file describes the ISL29023 driver interface and structures. </div></div> 54<div class="ttc" id="a00182_html_aa75349faed7c77807cb88d9224aa2636"><div class="ttname"><a href="a00182.html#aa75349faed7c77807cb88d9224aa2636">Sensor_I2C_Read</a></div><div class="ttdeci">int32_t Sensor_I2C_Read(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerreadlist_t *pReadList, uint8_t *pOutBuffer)</div><div class="ttdoc">Read register data from a sensor. </div><div class="ttdef"><b>Definition:</b> <a href="a00182_source.html#l00105">sensor_io_i2c.c:105</a></div></div> 55<div class="ttc" id="a03807_html"><div class="ttname"><a href="a03807.html">registerwritelist_t</a></div><div class="ttdoc">This structure defines the Write command List. </div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00068">sensor_drv.h:68</a></div></div> 56<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> 57<div class="ttc" id="a00104_html_acff35b3e7629c3d450d281421894cab7"><div class="ttname"><a href="a00104.html#acff35b3e7629c3d450d281421894cab7">ISL29023_CMD_I_OP_POWER_DOWN</a></div><div class="ttdeci">#define ISL29023_CMD_I_OP_POWER_DOWN</div><div class="ttdef"><b>Definition:</b> <a href="a00104_source.html#l00071">isl29023.h:71</a></div></div> 58<div class="ttc" id="a00179_html_a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274"><div class="ttname"><a href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca961b6871536a27c9e4718100e0024274">SENSOR_ERROR_NONE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00033">sensor_drv.h:33</a></div></div> 59<div class="ttc" id="a00167_html_ac8a60c799d9dbc84531b4680762eb8dc"><div class="ttname"><a href="a00167.html#ac8a60c799d9dbc84531b4680762eb8dc">Register_I2C_Read</a></div><div class="ttdeci">int32_t Register_I2C_Read(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t length, uint8_t *pOutBuffer)</div><div class="ttdoc">The interface function to read a sensor register. </div><div class="ttdef"><b>Definition:</b> <a href="a00167_source.html#l00310">register_io_i2c.c:310</a></div></div> 60<div class="ttc" id="a00167_html_ad08d2c7880bc5f09fd27eee247311448"><div class="ttname"><a href="a00167.html#ad08d2c7880bc5f09fd27eee247311448">Register_I2C_Write</a></div><div class="ttdeci">int32_t Register_I2C_Write(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t value, uint8_t mask, bool repeatedStart)</div><div class="ttdoc">The interface function to write a sensor register. </div><div class="ttdef"><b>Definition:</b> <a href="a00167_source.html#l00193">register_io_i2c.c:193</a></div></div> 61<div class="ttc" id="a00179_html_a18a00cbfd8ad83c7fd229cd0d5fad5aca7f5031b1497c3a8a4bcb78cce879dedd"><div class="ttname"><a href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca7f5031b1497c3a8a4bcb78cce879dedd">SENSOR_ERROR_INIT</a></div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00036">sensor_drv.h:36</a></div></div> 62<div class="ttc" id="a00107_html_aa8ca6dc6e2e7a435afab374d122233c3"><div class="ttname"><a href="a00107.html#aa8ca6dc6e2e7a435afab374d122233c3">ISL29023_I2C_ReadData</a></div><div class="ttdeci">int32_t ISL29023_I2C_ReadData(isl29023_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)</div><div class="ttdoc">The interface function to read the sensor data. </div><div class="ttdef"><b>Definition:</b> <a href="a00107_source.html#l00087">isl29023_drv.c:87</a></div></div> 63<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> 64<div class="ttc" id="a00107_html_a7080e6e4c87f884467ded36ad2a1846a"><div class="ttname"><a href="a00107.html#a7080e6e4c87f884467ded36ad2a1846a">ISL29023_I2C_Configure</a></div><div class="ttdeci">int32_t ISL29023_I2C_Configure(isl29023_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)</div><div class="ttdoc">The interface function to configure he sensor. </div><div class="ttdef"><b>Definition:</b> <a href="a00107_source.html#l00060">isl29023_drv.c:60</a></div></div> 65<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> 66<div class="ttc" id="a00107_html_a0f976578dc6fcb91186ecbbae243681c"><div class="ttname"><a href="a00107.html#a0f976578dc6fcb91186ecbbae243681c">ISL29023_I2C_DeInit</a></div><div class="ttdeci">int32_t ISL29023_I2C_DeInit(isl29023_i2c_sensorhandle_t *pSensorHandle)</div><div class="ttdoc">The interface function to De Initialize sensor.. </div><div class="ttdef"><b>Definition:</b> <a href="a00107_source.html#l00116">isl29023_drv.c:116</a></div></div> 67<div class="ttc" id="a02947_html_ae75b47fd9e098d6bd3b28f6be6586998"><div class="ttname"><a href="a02947.html#ae75b47fd9e098d6bd3b28f6be6586998">isl29023_i2c_sensorhandle_t::deviceInfo</a></div><div class="ttdeci">registerDeviceInfo_t deviceInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00110_source.html#l00030">isl29023_drv.h:30</a></div></div> 68<div class="ttc" id="a02947_html"><div class="ttname"><a href="a02947.html">isl29023_i2c_sensorhandle_t</a></div><div class="ttdoc">This defines the sensor specific information. </div><div class="ttdef"><b>Definition:</b> <a href="a00110_source.html#l00028">isl29023_drv.h:28</a></div></div> 69<div class="ttc" id="a00182_html_aaac4c4f34b4dd37d3f202a1dbb4b000b"><div class="ttname"><a href="a00182.html#aaac4c4f34b4dd37d3f202a1dbb4b000b">Sensor_I2C_Write</a></div><div class="ttdeci">int32_t Sensor_I2C_Write(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerwritelist_t *pRegWriteList)</div><div class="ttdoc">Write register data to a sensor. </div><div class="ttdef"><b>Definition:</b> <a href="a00182_source.html#l00071">sensor_io_i2c.c:71</a></div></div> 70<div class="ttc" id="a00179_html_a5deff6bd688b60b97b84fc7e78d3ea63"><div class="ttname"><a href="a00179.html#a5deff6bd688b60b97b84fc7e78d3ea63">registeridlefunction_t</a></div><div class="ttdeci">void(* registeridlefunction_t)(void *userParam)</div><div class="ttdoc">This is the register idle function type. </div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00097">sensor_drv.h:97</a></div></div> 71<div class="ttc" id="a02947_html_af6d4d51d4fb48cfb392eeb03ac26abed"><div class="ttname"><a href="a02947.html#af6d4d51d4fb48cfb392eeb03ac26abed">isl29023_i2c_sensorhandle_t::pCommDrv</a></div><div class="ttdeci">ARM_DRIVER_I2C * pCommDrv</div><div class="ttdef"><b>Definition:</b> <a href="a00110_source.html#l00031">isl29023_drv.h:31</a></div></div> 72<div class="ttc" id="a00179_html_a18a00cbfd8ad83c7fd229cd0d5fad5acab93ad77156e08d1bebe52bf46936cccc"><div class="ttname"><a href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5acab93ad77156e08d1bebe52bf46936cccc">SENSOR_ERROR_READ</a></div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00038">sensor_drv.h:38</a></div></div> 73<div class="ttc" id="a00107_html_a590d476df5662e5e3eaf99a0789136ca"><div class="ttname"><a href="a00107.html#a590d476df5662e5e3eaf99a0789136ca">ISL29023_I2C_Initialize</a></div><div class="ttdeci">int32_t ISL29023_I2C_Initialize(isl29023_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t test)</div><div class="ttdoc">The interface function to initialize the sensor. </div><div class="ttdef"><b>Definition:</b> <a href="a00107_source.html#l00021">isl29023_drv.c:21</a></div></div> 74<div class="ttc" id="a03819_html_abb8c8f961a02b447e127bd6ef3215c7d"><div class="ttname"><a href="a03819.html#abb8c8f961a02b447e127bd6ef3215c7d">registerDeviceInfo_t::functionParam</a></div><div class="ttdeci">void * functionParam</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00105">sensor_drv.h:105</a></div></div> 75<div class="ttc" id="a00179_html_a18a00cbfd8ad83c7fd229cd0d5fad5aca78230e17f41b0ec3e31a708f36c7eaa7"><div class="ttname"><a href="a00179.html#a18a00cbfd8ad83c7fd229cd0d5fad5aca78230e17f41b0ec3e31a708f36c7eaa7">SENSOR_ERROR_INVALID_PARAM</a></div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00034">sensor_drv.h:34</a></div></div> 76<div class="ttc" id="a00104_html_a82f2c6e4d47f62f6b65c5887eb096fd5a922c33ea55138f286ed8240d77cb02a8"><div class="ttname"><a href="a00104.html#a82f2c6e4d47f62f6b65c5887eb096fd5a922c33ea55138f286ed8240d77cb02a8">ISL29023_TEST</a></div><div class="ttdef"><b>Definition:</b> <a href="a00104_source.html#l00023">isl29023.h:23</a></div></div> 77<div class="ttc" id="a00104_html_a82f2c6e4d47f62f6b65c5887eb096fd5a4751b76e648b9068c57edb07cd9e95c8"><div class="ttname"><a href="a00104.html#a82f2c6e4d47f62f6b65c5887eb096fd5a4751b76e648b9068c57edb07cd9e95c8">ISL29023_CMD_I</a></div><div class="ttdef"><b>Definition:</b> <a href="a00104_source.html#l00015">isl29023.h:15</a></div></div> 78<div class="ttc" id="a03811_html"><div class="ttname"><a href="a03811.html">registerreadlist_t</a></div><div class="ttdoc">This structure defines the Read command List. </div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00078">sensor_drv.h:78</a></div></div> 79<div class="ttc" id="a02947_html_a67af74c3fc959654c6dc8bcff3a2ea80"><div class="ttname"><a href="a02947.html#a67af74c3fc959654c6dc8bcff3a2ea80">isl29023_i2c_sensorhandle_t::slaveAddress</a></div><div class="ttdeci">uint16_t slaveAddress</div><div class="ttdef"><b>Definition:</b> <a href="a00110_source.html#l00033">isl29023_drv.h:33</a></div></div> 80<div class="ttc" id="a02947_html_a1fdc2bf5595c2e64dc06d987769834eb"><div class="ttname"><a href="a02947.html#a1fdc2bf5595c2e64dc06d987769834eb">isl29023_i2c_sensorhandle_t::isInitialized</a></div><div class="ttdeci">bool isInitialized</div><div class="ttdef"><b>Definition:</b> <a href="a00110_source.html#l00032">isl29023_drv.h:32</a></div></div> 81<div class="ttc" id="a00107_html_a8dcf1dde0281c8d82fa296ede1d80157"><div class="ttname"><a href="a00107.html#a8dcf1dde0281c8d82fa296ede1d80157">ISL29023_I2C_SetIdleTask</a></div><div class="ttdeci">void ISL29023_I2C_SetIdleTask(isl29023_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)</div><div class="ttdoc">: The interface function to set the I2C Idle Task. </div><div class="ttdef"><b>Definition:</b> <a href="a00107_source.html#l00052">isl29023_drv.c:52</a></div></div> 82<div class="ttc" id="a03819_html_acf9a866fc6b31f72a8e26437420e0354"><div class="ttname"><a href="a03819.html#acf9a866fc6b31f72a8e26437420e0354">registerDeviceInfo_t::idleFunction</a></div><div class="ttdeci">registeridlefunction_t idleFunction</div><div class="ttdef"><b>Definition:</b> <a href="a00179_source.html#l00104">sensor_drv.h:104</a></div></div> 83</div><!-- fragment --></div><!-- contents --> 84 85<hr class="footer"/><address class="footer"><small> 86© Copyright 2016-2022 NXP. All Rights Reserved. SPDX-License-Identifier: BSD-3-Clause 87</small></address> 88</body> 89</html> 90