Files
MicrochipFor32/Doc/docbook/inv__mpu_8h_source.xml

132 lines
29 KiB
XML
Raw Normal View History

<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_inv__mpu_8h_source" xml:lang="zh">
<title>inv_mpu.h</title>
<indexterm><primary>D:/gitt/MicrochipFor32/bsp_MPU6050/inv_mpu.h</primary></indexterm>
浏览该文件的文档.<programlisting linenumbering="unnumbered"><anchor xml:id="_inv__mpu_8h_source_1l00001"/>00001 <emphasis role="comment">/*</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00002"/>00002 <emphasis role="comment">&#32;$License:</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00003"/>00003 <emphasis role="comment">&#32;&#32;&#32;&#32;Copyright&#32;(C)&#32;2011-2012&#32;InvenSense&#32;Corporation,&#32;All&#32;Rights&#32;Reserved.</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00004"/>00004 <emphasis role="comment">&#32;&#32;&#32;&#32;See&#32;included&#32;License.txt&#32;for&#32;License&#32;information.</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00005"/>00005 <emphasis role="comment">&#32;$</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00006"/>00006 <emphasis role="comment">&#32;*/</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00021"/>00021 <emphasis role="preprocessor">#ifndef&#32;_INV_MPU_H_</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00022"/>00022 <emphasis role="preprocessor">#define&#32;_INV_MPU_H_</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00023"/>00023 <emphasis role="preprocessor">#include&#32;&quot;main.h&quot;</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00024"/>00024 <emphasis role="preprocessor">#include&#32;&quot;<link linkend="_varint_8h">varint.h</link>&quot;</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00025"/>00025
<anchor xml:id="_inv__mpu_8h_source_1l00026"/>00026 <emphasis role="comment">//定义输出速度</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00027"/><link linkend="_group___d_r_i_v_e_r_s_1ga292d717406e906831952ce46612fe4cd">00027</link> <emphasis role="preprocessor">#define&#32;DEFAULT_MPU_HZ&#32;&#32;(100)&#32;&#32;&#32;&#32;&#32;&#32;&#32;</emphasis><emphasis role="comment">//100Hz</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00028"/>00028
<anchor xml:id="_inv__mpu_8h_source_1l00029"/><link linkend="_group___d_r_i_v_e_r_s_1gabf02bf28541421d59f8be764f2b95407">00029</link> <emphasis role="preprocessor">#define&#32;INV_X_GYRO&#32;&#32;&#32;&#32;&#32;&#32;(0x40)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00030"/><link linkend="_group___d_r_i_v_e_r_s_1gacdd8ff833a34dba08ca2aa145eb92b44">00030</link> <emphasis role="preprocessor">#define&#32;INV_Y_GYRO&#32;&#32;&#32;&#32;&#32;&#32;(0x20)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00031"/><link linkend="_group___d_r_i_v_e_r_s_1ga50205b5cc6089b33b2561c854eb8b0fd">00031</link> <emphasis role="preprocessor">#define&#32;INV_Z_GYRO&#32;&#32;&#32;&#32;&#32;&#32;(0x10)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00032"/><link linkend="_group___d_r_i_v_e_r_s_1ga3fdc30f9c0a26c2c4e2bb88921f91629">00032</link> <emphasis role="preprocessor">#define&#32;INV_XYZ_GYRO&#32;&#32;&#32;&#32;(INV_X_GYRO&#32;|&#32;INV_Y_GYRO&#32;|&#32;INV_Z_GYRO)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00033"/><link linkend="_group___d_r_i_v_e_r_s_1gaa03f025a17ed491e70b88274e89c75c5">00033</link> <emphasis role="preprocessor">#define&#32;INV_XYZ_ACCEL&#32;&#32;&#32;(0x08)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00034"/><link linkend="_group___d_r_i_v_e_r_s_1ga7fc9c1dbdcb2ac8cc2a4128a5799482a">00034</link> <emphasis role="preprocessor">#define&#32;INV_XYZ_COMPASS&#32;(0x01)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00035"/>00035
<anchor xml:id="_inv__mpu_8h_source_1l00036"/>00036 <emphasis role="comment">//移植官方MSP430&#32;DMP驱动过来</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00037"/><link linkend="_structint__param__s">00037</link> <emphasis role="keyword">struct&#32;</emphasis><link linkend="_structint__param__s">int_param_s</link>&#32;{
<anchor xml:id="_inv__mpu_8h_source_1l00038"/>00038 <emphasis role="comment">//#if&#32;defined&#32;EMPL_TARGET_MSP430&#32;||&#32;defined&#32;MOTION_DRIVER_TARGET_MSP430</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00039"/><link linkend="_group___d_r_i_v_e_r_s_1ga97093754f1f13b06492990e3da77965d">00039</link> &#32;&#32;&#32;&#32;void&#32;(*<link linkend="_group___d_r_i_v_e_r_s_1ga97093754f1f13b06492990e3da77965d">cb</link>)(void);
<anchor xml:id="_inv__mpu_8h_source_1l00040"/><link linkend="_group___d_r_i_v_e_r_s_1ga5c682e1b664acf566f985b48dd7acbb7">00040</link> &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga5c682e1b664acf566f985b48dd7acbb7">pin</link>;
<anchor xml:id="_inv__mpu_8h_source_1l00041"/><link linkend="_group___d_r_i_v_e_r_s_1ga46dfad5a278a8b40a68d71beca0d2be4">00041</link> &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga46dfad5a278a8b40a68d71beca0d2be4">lp_exit</link>;
<anchor xml:id="_inv__mpu_8h_source_1l00042"/><link linkend="_group___d_r_i_v_e_r_s_1ga9b859a3332d9bd9287d5766494f261fb">00042</link> &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga9b859a3332d9bd9287d5766494f261fb">active_low</link>;
<anchor xml:id="_inv__mpu_8h_source_1l00043"/>00043 <emphasis role="comment">//#elif&#32;defined&#32;EMPL_TARGET_UC3L0</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00044"/>00044 <emphasis role="comment">//&#32;&#32;&#32;&#32;unsigned&#32;long&#32;pin;</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00045"/>00045 <emphasis role="comment">//&#32;&#32;&#32;&#32;void&#32;(*cb)(volatile&#32;void*);</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00046"/>00046 <emphasis role="comment">//&#32;&#32;&#32;&#32;void&#32;*arg;</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00047"/>00047 <emphasis role="comment">//#endif</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00048"/>00048 };
<anchor xml:id="_inv__mpu_8h_source_1l00049"/>00049
<anchor xml:id="_inv__mpu_8h_source_1l00050"/><link linkend="_group___d_r_i_v_e_r_s_1ga0cddf0dffaf3bf65fd3ed92dda4f3193">00050</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DATA_READY&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0001)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00051"/><link linkend="_group___d_r_i_v_e_r_s_1ga380dd1ef256931e99302c371ad7752f4">00051</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DMP&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0002)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00052"/><link linkend="_group___d_r_i_v_e_r_s_1gaa38d7976e86186bf353cb89ca7561f29">00052</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_PLL_READY&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0004)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00053"/><link linkend="_group___d_r_i_v_e_r_s_1ga5755e84f3a2e7d331f7612dbfea18ecc">00053</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_I2C_MST&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0008)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00054"/><link linkend="_group___d_r_i_v_e_r_s_1gaf8e1684698ad837d0318a72b1ef73b13">00054</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_FIFO_OVERFLOW&#32;&#32;&#32;&#32;(0x0010)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00055"/><link linkend="_group___d_r_i_v_e_r_s_1gad5eee7ff393f842ca4ae969cc0019030">00055</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_ZMOT&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0020)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00056"/><link linkend="_group___d_r_i_v_e_r_s_1gaa1ab51fb5995e568edd425f8486cb2c8">00056</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_MOT&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0040)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00057"/><link linkend="_group___d_r_i_v_e_r_s_1ga000cfa5230cb895c6bad322856465552">00057</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_FREE_FALL&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0080)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00058"/><link linkend="_group___d_r_i_v_e_r_s_1ga2398e82f93220e3cfa1ef31bfb6d76bd">00058</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DMP_0&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0100)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00059"/><link linkend="_group___d_r_i_v_e_r_s_1ga5ac2e94db5083456fa531fceee0997f5">00059</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DMP_1&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0200)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00060"/><link linkend="_group___d_r_i_v_e_r_s_1gab7543433b9679174597e00e5d7cb6279">00060</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DMP_2&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0400)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00061"/><link linkend="_group___d_r_i_v_e_r_s_1gaea5cac4528bb19757de4eb4fa46a374f">00061</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DMP_3&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x0800)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00062"/><link linkend="_group___d_r_i_v_e_r_s_1ga4345dc987e1b65ef8ddc6160f592e144">00062</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DMP_4&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x1000)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00063"/><link linkend="_group___d_r_i_v_e_r_s_1ga101643480b83c302a4a3089fe9149e8e">00063</link> <emphasis role="preprocessor">#define&#32;MPU_INT_STATUS_DMP_5&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;&#32;(0x2000)</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00064"/>00064
<anchor xml:id="_inv__mpu_8h_source_1l00065"/>00065 <emphasis role="comment">/*&#32;Set&#32;up&#32;APIs&#32;*/</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00066"/>00066 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gac48a36b51e23bc4191ec13916bbb9d0b">mpu_init</link>(<emphasis role="keywordtype">void</emphasis>);
<anchor xml:id="_inv__mpu_8h_source_1l00067"/><link linkend="_group___d_r_i_v_e_r_s_1ga9093183fe619360b3b1bfb8aab030592">00067</link> <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga9093183fe619360b3b1bfb8aab030592">mpu_init_slave</link>(<emphasis role="keywordtype">void</emphasis>);
<anchor xml:id="_inv__mpu_8h_source_1l00068"/>00068 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga36f70f38371b48d81094d3b061233e15">mpu_set_bypass</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;bypass_on);
<anchor xml:id="_inv__mpu_8h_source_1l00069"/>00069
<anchor xml:id="_inv__mpu_8h_source_1l00070"/>00070 <emphasis role="comment">/*&#32;Configuration&#32;APIs&#32;*/</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00071"/>00071 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga3a4fea75686ab7d2e68634e81ccac04c">mpu_lp_accel_mode</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;rate);
<anchor xml:id="_inv__mpu_8h_source_1l00072"/>00072 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga7d0b3259346898ccd1ba6ef78bf7df97">mpu_lp_motion_interrupt</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;thresh,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;time,
<anchor xml:id="_inv__mpu_8h_source_1l00073"/>00073 &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;lpa_freq);
<anchor xml:id="_inv__mpu_8h_source_1l00074"/>00074 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gacc92fb1489ef32a04bcb6b0ebde4d657">mpu_set_int_level</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;active_low);
<anchor xml:id="_inv__mpu_8h_source_1l00075"/>00075 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga653cb855300bff9285ce4b8dca6a503b">mpu_set_int_latched</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;enable);
<anchor xml:id="_inv__mpu_8h_source_1l00076"/>00076
<anchor xml:id="_inv__mpu_8h_source_1l00077"/>00077 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga68ed20e6c9663cd7c50469329af8715f">mpu_set_dmp_state</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;enable);
<anchor xml:id="_inv__mpu_8h_source_1l00078"/>00078 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gafe0f60ed0d7f8fd2dcd55d45b95a2363">mpu_get_dmp_state</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*enabled);
<anchor xml:id="_inv__mpu_8h_source_1l00079"/>00079
<anchor xml:id="_inv__mpu_8h_source_1l00080"/>00080 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gaa95c7e216dcb2d888e9796001ca555f8">mpu_get_lpf</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;*lpf);
<anchor xml:id="_inv__mpu_8h_source_1l00081"/>00081 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga5661a9dee25152166769910767a2a93d">mpu_set_lpf</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;lpf);
<anchor xml:id="_inv__mpu_8h_source_1l00082"/>00082
<anchor xml:id="_inv__mpu_8h_source_1l00083"/>00083 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gaf973c32c73ba912ff512aab948fc31ca">mpu_get_gyro_fsr</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;*fsr);
<anchor xml:id="_inv__mpu_8h_source_1l00084"/>00084 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gad09e6031c8677adc0b8a39b6deea8e27">mpu_set_gyro_fsr</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;fsr);
<anchor xml:id="_inv__mpu_8h_source_1l00085"/>00085
<anchor xml:id="_inv__mpu_8h_source_1l00086"/>00086 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gab6087a15ee23db23b6aec41590329a60">mpu_get_accel_fsr</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*fsr);
<anchor xml:id="_inv__mpu_8h_source_1l00087"/>00087 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga2713a96af104cfb2ae8e0ed4c3718119">mpu_set_accel_fsr</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;fsr);
<anchor xml:id="_inv__mpu_8h_source_1l00088"/>00088
<anchor xml:id="_inv__mpu_8h_source_1l00089"/>00089 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gade8589573d09e0f14b84130428f286df">mpu_get_compass_fsr</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;*fsr);
<anchor xml:id="_inv__mpu_8h_source_1l00090"/>00090
<anchor xml:id="_inv__mpu_8h_source_1l00091"/>00091 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga023c0cc94aa8f162dc33b15048a49421">mpu_get_gyro_sens</link>(<emphasis role="keywordtype">float</emphasis>&#32;*sens);
<anchor xml:id="_inv__mpu_8h_source_1l00092"/>00092 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga620408949052b96e856cad920f856583">mpu_get_accel_sens</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;*sens);
<anchor xml:id="_inv__mpu_8h_source_1l00093"/>00093
<anchor xml:id="_inv__mpu_8h_source_1l00094"/>00094 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga2487dd551b701c1c7ed4d6335f02b2f1">mpu_get_sample_rate</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;*rate);
<anchor xml:id="_inv__mpu_8h_source_1l00095"/>00095 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga0144d666a67a82888b8580002afe8b55">mpu_set_sample_rate</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;rate);
<anchor xml:id="_inv__mpu_8h_source_1l00096"/>00096 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gab5a45cd7783f6937788c0decb0b18b16">mpu_get_compass_sample_rate</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;*rate);
<anchor xml:id="_inv__mpu_8h_source_1l00097"/>00097 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga78da3828de0ef9d080c4d03e7bc45e7b">mpu_set_compass_sample_rate</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;rate);
<anchor xml:id="_inv__mpu_8h_source_1l00098"/>00098
<anchor xml:id="_inv__mpu_8h_source_1l00099"/>00099 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga093f11eb10b2639a4b9fe344ea348c54">mpu_get_fifo_config</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*sensors);
<anchor xml:id="_inv__mpu_8h_source_1l00100"/>00100 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gababbdda287e1f19323489f90a0889dd7">mpu_configure_fifo</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;sensors);
<anchor xml:id="_inv__mpu_8h_source_1l00101"/>00101
<anchor xml:id="_inv__mpu_8h_source_1l00102"/>00102 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gaec8fa7a067988d174516bb735a4a0bc9">mpu_get_power_state</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*power_on);
<anchor xml:id="_inv__mpu_8h_source_1l00103"/>00103 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga6e77e7cc1cf6be5e8fdf617c5b4586d1">mpu_set_sensors</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;sensors);
<anchor xml:id="_inv__mpu_8h_source_1l00104"/>00104
<anchor xml:id="_inv__mpu_8h_source_1l00105"/>00105 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga4968cc2ec80f0da0d72436551c81f134">mpu_set_accel_bias</link>(<emphasis role="keyword">const</emphasis>&#32;<emphasis role="keywordtype">long</emphasis>&#32;*accel_bias);
<anchor xml:id="_inv__mpu_8h_source_1l00106"/>00106
<anchor xml:id="_inv__mpu_8h_source_1l00107"/>00107 <emphasis role="comment">/*&#32;Data&#32;getter/setter&#32;APIs&#32;*/</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00108"/>00108 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga5555854590ad11495c0e30401294bae2">mpu_get_gyro_reg</link>(<emphasis role="keywordtype">short</emphasis>&#32;*data,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">long</emphasis>&#32;*timestamp);
<anchor xml:id="_inv__mpu_8h_source_1l00109"/>00109 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gae4ae960e5df78049ece2647772a3d809">mpu_get_accel_reg</link>(<emphasis role="keywordtype">short</emphasis>&#32;*data,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">long</emphasis>&#32;*timestamp);
<anchor xml:id="_inv__mpu_8h_source_1l00110"/>00110 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga65e6b0ce980b8c0255d7be9b55c88c08">mpu_get_compass_reg</link>(<emphasis role="keywordtype">short</emphasis>&#32;*data,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">long</emphasis>&#32;*timestamp);
<anchor xml:id="_inv__mpu_8h_source_1l00111"/>00111 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gaa449b565a157b4b8ca0f491b7ed46018">mpu_get_temperature</link>(<emphasis role="keywordtype">long</emphasis>&#32;*data,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">long</emphasis>&#32;*timestamp);
<anchor xml:id="_inv__mpu_8h_source_1l00112"/>00112
<anchor xml:id="_inv__mpu_8h_source_1l00113"/>00113 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga0afd02d8c76d3278b488ef7038c26e3e">mpu_get_int_status</link>(<emphasis role="keywordtype">short</emphasis>&#32;*status);
<anchor xml:id="_inv__mpu_8h_source_1l00114"/>00114 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga2da20453aafbbba4a0f6fb9fbdd25572">mpu_read_fifo</link>(<emphasis role="keywordtype">short</emphasis>&#32;*gyro,&#32;<emphasis role="keywordtype">short</emphasis>&#32;*accel,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">long</emphasis>&#32;*timestamp,
<anchor xml:id="_inv__mpu_8h_source_1l00115"/>00115 &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*sensors,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*more);
<anchor xml:id="_inv__mpu_8h_source_1l00116"/>00116 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga13593044949b460e9f571eb57e9a0788">mpu_read_fifo_stream</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;length,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*data,
<anchor xml:id="_inv__mpu_8h_source_1l00117"/>00117 &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*more);
<anchor xml:id="_inv__mpu_8h_source_1l00118"/>00118 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gaf23e9f57c0059be6ec57862f0584de10">mpu_reset_fifo</link>(<emphasis role="keywordtype">void</emphasis>);
<anchor xml:id="_inv__mpu_8h_source_1l00119"/>00119
<anchor xml:id="_inv__mpu_8h_source_1l00120"/>00120 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gafea59910bc3dd30ba3356b1c75213a5f">mpu_write_mem</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;mem_addr,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;length,
<anchor xml:id="_inv__mpu_8h_source_1l00121"/>00121 &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*data);
<anchor xml:id="_inv__mpu_8h_source_1l00122"/>00122 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga3374bececb6743893c9eab27645c1182">mpu_read_mem</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;mem_addr,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;length,
<anchor xml:id="_inv__mpu_8h_source_1l00123"/>00123 &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*data);
<anchor xml:id="_inv__mpu_8h_source_1l00124"/>00124 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga8fbdfe1a50285d4ab438e29c2efc70f5">mpu_load_firmware</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;length,&#32;<emphasis role="keyword">const</emphasis>&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*firmware,
<anchor xml:id="_inv__mpu_8h_source_1l00125"/>00125 &#32;&#32;&#32;&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;start_addr,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;sample_rate);
<anchor xml:id="_inv__mpu_8h_source_1l00126"/>00126
<anchor xml:id="_inv__mpu_8h_source_1l00127"/>00127 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga0e1201ecfd8453f1d89e4299528baaf6">mpu_reg_dump</link>(<emphasis role="keywordtype">void</emphasis>);
<anchor xml:id="_inv__mpu_8h_source_1l00128"/>00128 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga5c35a3363337014e11769a0ea7c0dfa9">mpu_read_reg</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga5448c351fc95ff052b110eee80e5f75c">reg</link>,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*data);
<anchor xml:id="_inv__mpu_8h_source_1l00129"/>00129 <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga3773dc98eb1ba15da0091ae75abcf62f">mpu_run_self_test</link>(<emphasis role="keywordtype">long</emphasis>&#32;*gyro,&#32;<emphasis role="keywordtype">long</emphasis>&#32;*accel);
<anchor xml:id="_inv__mpu_8h_source_1l00130"/><link linkend="_group___d_r_i_v_e_r_s_1ga0d528114a4e355a10ffd354a4c89a17f">00130</link> <emphasis role="keywordtype">int</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga0d528114a4e355a10ffd354a4c89a17f">mpu_register_tap_cb</link>(<emphasis role="keywordtype">void</emphasis>&#32;(*func)(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>,&#32;<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>));
<anchor xml:id="_inv__mpu_8h_source_1l00131"/>00131 <emphasis role="comment">//自行添加的一些函数</emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00132"/>00132 <emphasis role="keywordtype">void</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gafa3071c8321f6e8dd2036be8a1e57ad0">mget_ms</link>(<emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">long</emphasis>&#32;*time);
<anchor xml:id="_inv__mpu_8h_source_1l00133"/>00133 <emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga2b58dae1c0567f3f9f6dcbfb07476de7">inv_row_2_scale</link>(<emphasis role="keyword">const</emphasis>&#32;<emphasis role="keywordtype">signed</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*row);
<anchor xml:id="_inv__mpu_8h_source_1l00134"/>00134 <emphasis role="keywordtype">unsigned</emphasis>&#32;<emphasis role="keywordtype">short</emphasis>&#32;<link linkend="_group___d_r_i_v_e_r_s_1ga3ff6037a69f37bb6174355936ad67ef3">inv_orientation_matrix_to_scalar</link>(<emphasis role="keyword">const</emphasis>&#32;<emphasis role="keywordtype">signed</emphasis>&#32;<emphasis role="keywordtype">char</emphasis>&#32;*mtx);
<anchor xml:id="_inv__mpu_8h_source_1l00135"/>00135 <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gaff893f93277595387023c71d46b03c42">run_self_test</link>(<emphasis role="keywordtype">void</emphasis>);
<anchor xml:id="_inv__mpu_8h_source_1l00136"/>00136 <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gafac8fcbf24cfa1b69737e02238580f3a">mpu_dmp_init</link>(<emphasis role="keywordtype">void</emphasis>);
<anchor xml:id="_inv__mpu_8h_source_1l00137"/>00137 <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link>&#32;<link linkend="_group___d_r_i_v_e_r_s_1gacb825f2fd99c3044d012a9b25608cc18">mpu_dmp_get_data</link>(<emphasis role="keywordtype">float</emphasis>&#32;*pitch,<emphasis role="keywordtype">float</emphasis>&#32;*roll,<emphasis role="keywordtype">float</emphasis>&#32;*yaw);
<anchor xml:id="_inv__mpu_8h_source_1l00138"/>00138
<anchor xml:id="_inv__mpu_8h_source_1l00139"/>00139 <emphasis role="preprocessor">#endif&#32;&#32;</emphasis><emphasis role="comment">/*&#32;#ifndef&#32;_INV_MPU_H_&#32;*/</emphasis><emphasis role="preprocessor"></emphasis>
<anchor xml:id="_inv__mpu_8h_source_1l00140"/>00140
</programlisting></section>