734 lines
31 KiB
XML
734 lines
31 KiB
XML
|
|
<?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="_mpu6050_8cpp" xml:lang="zh">
|
||
|
|
<title>D:/gitt/MicrochipFor32/bsp_MPU6050/mpu6050.cpp 文件参考</title>
|
||
|
|
<indexterm><primary>D:/gitt/MicrochipFor32/bsp_MPU6050/mpu6050.cpp</primary></indexterm>
|
||
|
|
<programlisting linenumbering="unnumbered">#include "bscpp_IIC_STM32.h"<?linebreak?>#include "mpu6050.h"<?linebreak?></programlisting>mpu6050.cpp 的引用(Include)关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp__incl.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
<simplesect>
|
||
|
|
<title>宏定义 </title>
|
||
|
|
<itemizedlist>
|
||
|
|
<listitem><para>#define <link linkend="_mpu6050_8cpp_1ae7d7fd8356f1a04698bf36a2ff087f7b">delay_ms</link>(var)   HAL_Delay(var)</para>
|
||
|
|
</listitem>
|
||
|
|
</itemizedlist>
|
||
|
|
</simplesect>
|
||
|
|
<simplesect>
|
||
|
|
<title>函数 </title>
|
||
|
|
<itemizedlist>
|
||
|
|
<listitem><para>bscpp_IIC_STM32 <link linkend="_mpu6050_8cpp_1a0e5583807e7dcaae30835311a2195583">mpu6050IIC</link> (IIC_SCK_GPIO_Port, IIC_SCK_Pin, IIC_SDA_GPIO_Port, IIC_SDA_Pin)</para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1ab1f8c6111d59b60a2edb4ee3e8aa3113">MPU_Init</link> (void)</para>
|
||
|
|
|
||
|
|
<para>初始化MPU6050 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1aa27cc30326ce4980b289a0e1c3f76b5e">MPU_Set_Gyro_Fsr</link> (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> fsr)</para>
|
||
|
|
|
||
|
|
<para>设置MPU6050陀螺仪传感器满量程范围 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a6c391137bc5880c3b5e15e84c5a3380f">MPU_Set_Accel_Fsr</link> (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> fsr)</para>
|
||
|
|
|
||
|
|
<para>设置MPU6050加速度传感器满量程范围 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a2fb9973c9f5ea5327649d0eef5e96217">MPU_Set_LPF</link> (<link linkend="_varint_8h_1ace9d960e74685e2cd84b36132dbbf8aa">u16</link> lpf)</para>
|
||
|
|
|
||
|
|
<para>设置MPU6050的数字低通滤波器 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a04e58232ce838e94d54aa2b53287cb41">MPU_Set_Rate</link> (<link linkend="_varint_8h_1ace9d960e74685e2cd84b36132dbbf8aa">u16</link> rate)</para>
|
||
|
|
|
||
|
|
<para>设置MPU6050的采样率(假定Fs=1KHz) </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para>short <link linkend="_mpu6050_8cpp_1a41eaf87c26b1281d9d5fc6a06abcf2a8">MPU_Get_Temperature</link> (void)</para>
|
||
|
|
|
||
|
|
<para>得到温度值 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a8f28105f9dcccc709b78d7d0ce497633">MPU_Get_Gyroscope</link> (short *gx, short *gy, short *gz)</para>
|
||
|
|
|
||
|
|
<para>得到陀螺仪值(原始值) </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a2a0a02f6d7c597828a0cc282c76e99e3">MPU_Get_Accelerometer</link> (short *ax, short *ay, short *az)</para>
|
||
|
|
|
||
|
|
<para>得到加速度值(原始值) </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a59b1c26b234be88e97435a1b3c061330">MPU_Write_Len</link> (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> len, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> *buf)</para>
|
||
|
|
|
||
|
|
<para>IIC连续写 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a63161fa966899e4e7c5791e40ebf2b0a">MPU_Read_Len</link> (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> len, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> *buf)</para>
|
||
|
|
|
||
|
|
<para>IIC连续读 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a0be9b422bb8613f8444db4af5234e1a1">MPU_Write_Byte</link> (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> data)</para>
|
||
|
|
|
||
|
|
<para>IIC写一个字节 </para>
|
||
|
|
</listitem>
|
||
|
|
<listitem><para><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> <link linkend="_mpu6050_8cpp_1a17c11d19a2bb21d61610f08cb2cbe2f7">MPU_Read_Byte</link> (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg)</para>
|
||
|
|
|
||
|
|
<para>IIC读一个字节 </para>
|
||
|
|
</listitem>
|
||
|
|
</itemizedlist>
|
||
|
|
</simplesect>
|
||
|
|
<section>
|
||
|
|
<title>宏定义说明</title>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1ae7d7fd8356f1a04698bf36a2ff087f7b"/><section>
|
||
|
|
<title>delay_ms</title>
|
||
|
|
<indexterm><primary>delay_ms</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>delay_ms</secondary></indexterm>
|
||
|
|
<para><computeroutput>#define delay_ms( var)   HAL_Delay(var)</computeroutput></para><para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00016">16</link> 行定义.</para>
|
||
|
|
</section>
|
||
|
|
</section>
|
||
|
|
<section>
|
||
|
|
<title>函数说明</title>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a0e5583807e7dcaae30835311a2195583"/><section>
|
||
|
|
<title>mpu6050IIC()</title>
|
||
|
|
<indexterm><primary>mpu6050IIC</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>mpu6050IIC</secondary></indexterm>
|
||
|
|
<para><computeroutput>bscpp_IIC_STM32 mpu6050IIC (IIC_SCK_GPIO_Port , IIC_SCK_Pin , IIC_SDA_GPIO_Port , IIC_SDA_Pin )</computeroutput></para>这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a0e5583807e7dcaae30835311a2195583_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a2a0a02f6d7c597828a0cc282c76e99e3"/><section>
|
||
|
|
<title>MPU_Get_Accelerometer()</title>
|
||
|
|
<indexterm><primary>MPU_Get_Accelerometer</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Get_Accelerometer</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Get_Accelerometer (short * ax, short * ay, short * az)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>得到加速度值(原始值) </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>ax</entry><entry>
|
||
|
|
<para>陀螺仪a轴的原始读数(带符号) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>ay</entry><entry>
|
||
|
|
<para>陀螺仪a轴的原始读数(带符号) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>ax</entry><entry>
|
||
|
|
<para>陀螺仪a轴的原始读数(带符号) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00137">137</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a2a0a02f6d7c597828a0cc282c76e99e3_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a8f28105f9dcccc709b78d7d0ce497633"/><section>
|
||
|
|
<title>MPU_Get_Gyroscope()</title>
|
||
|
|
<indexterm><primary>MPU_Get_Gyroscope</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Get_Gyroscope</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Get_Gyroscope (short * gx, short * gy, short * gz)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>得到陀螺仪值(原始值) </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>gx</entry><entry>
|
||
|
|
<para>陀螺仪x轴的原始读数(带符号) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>gy</entry><entry>
|
||
|
|
<para>陀螺仪y轴的原始读数(带符号) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>gx</entry><entry>
|
||
|
|
<para>陀螺仪z轴的原始读数(带符号) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00121">121</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a8f28105f9dcccc709b78d7d0ce497633_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a41eaf87c26b1281d9d5fc6a06abcf2a8"/><section>
|
||
|
|
<title>MPU_Get_Temperature()</title>
|
||
|
|
<indexterm><primary>MPU_Get_Temperature</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Get_Temperature</secondary></indexterm>
|
||
|
|
<para><computeroutput>short MPU_Get_Temperature (void )</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>得到温度值 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para><formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>温度值(扩大了100倍) </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00105">105</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a41eaf87c26b1281d9d5fc6a06abcf2a8_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1ab1f8c6111d59b60a2edb4ee3e8aa3113"/><section>
|
||
|
|
<title>MPU_Init()</title>
|
||
|
|
<indexterm><primary>MPU_Init</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Init</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Init (void )</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>初始化MPU6050 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para><formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00025">25</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_ab1f8c6111d59b60a2edb4ee3e8aa3113_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a17c11d19a2bb21d61610f08cb2cbe2f7"/><section>
|
||
|
|
<title>MPU_Read_Byte()</title>
|
||
|
|
<indexterm><primary>MPU_Read_Byte</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Read_Byte</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Read_Byte (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>IIC读一个字节 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>reg</entry><entry>
|
||
|
|
<para>寄存器地址 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00187">187</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a17c11d19a2bb21d61610f08cb2cbe2f7_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a17c11d19a2bb21d61610f08cb2cbe2f7_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a63161fa966899e4e7c5791e40ebf2b0a"/><section>
|
||
|
|
<title>MPU_Read_Len()</title>
|
||
|
|
<indexterm><primary>MPU_Read_Len</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Read_Len</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Read_Len (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> len, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> * buf)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>IIC连续读 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>addr</entry><entry>
|
||
|
|
<para>器件地址 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>reg</entry><entry>
|
||
|
|
<para>寄存器地址 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>len</entry><entry>
|
||
|
|
<para>读取长度 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>*buf</entry><entry>
|
||
|
|
<para>读取数据区 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00168">168</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a63161fa966899e4e7c5791e40ebf2b0a_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a63161fa966899e4e7c5791e40ebf2b0a_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a6c391137bc5880c3b5e15e84c5a3380f"/><section>
|
||
|
|
<title>MPU_Set_Accel_Fsr()</title>
|
||
|
|
<indexterm><primary>MPU_Set_Accel_Fsr</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Set_Accel_Fsr</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Set_Accel_Fsr (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> fsr)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>设置MPU6050加速度传感器满量程范围 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>fsr</entry><entry>
|
||
|
|
<para>0,±2g 1,±4g 2,±8g 3,±16g </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00067">67</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a6c391137bc5880c3b5e15e84c5a3380f_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a6c391137bc5880c3b5e15e84c5a3380f_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1aa27cc30326ce4980b289a0e1c3f76b5e"/><section>
|
||
|
|
<title>MPU_Set_Gyro_Fsr()</title>
|
||
|
|
<indexterm><primary>MPU_Set_Gyro_Fsr</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Set_Gyro_Fsr</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Set_Gyro_Fsr (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> fsr)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>设置MPU6050陀螺仪传感器满量程范围 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>fsr</entry><entry>
|
||
|
|
<para>0,±250dps 1,±500dps 2,±1000dps 3,±2000dps </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00055">55</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_aa27cc30326ce4980b289a0e1c3f76b5e_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_aa27cc30326ce4980b289a0e1c3f76b5e_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a2fb9973c9f5ea5327649d0eef5e96217"/><section>
|
||
|
|
<title>MPU_Set_LPF()</title>
|
||
|
|
<indexterm><primary>MPU_Set_LPF</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Set_LPF</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Set_LPF (<link linkend="_varint_8h_1ace9d960e74685e2cd84b36132dbbf8aa">u16</link> lpf)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>设置MPU6050的数字低通滤波器 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>lpf</entry><entry>
|
||
|
|
<para>数字低通滤波频率(Hz) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00076">76</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a2fb9973c9f5ea5327649d0eef5e96217_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a2fb9973c9f5ea5327649d0eef5e96217_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a04e58232ce838e94d54aa2b53287cb41"/><section>
|
||
|
|
<title>MPU_Set_Rate()</title>
|
||
|
|
<indexterm><primary>MPU_Set_Rate</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Set_Rate</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Set_Rate (<link linkend="_varint_8h_1ace9d960e74685e2cd84b36132dbbf8aa">u16</link> rate)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>设置MPU6050的采样率(假定Fs=1KHz) </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>rate</entry><entry>
|
||
|
|
<para>4~1000(Hz) </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00092">92</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a04e58232ce838e94d54aa2b53287cb41_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a04e58232ce838e94d54aa2b53287cb41_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a0be9b422bb8613f8444db4af5234e1a1"/><section>
|
||
|
|
<title>MPU_Write_Byte()</title>
|
||
|
|
<indexterm><primary>MPU_Write_Byte</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Write_Byte</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Write_Byte (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> data)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>IIC写一个字节 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>reg</entry><entry>
|
||
|
|
<para>寄存器地址 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>data</entry><entry>
|
||
|
|
<para>数据 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00178">178</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a0be9b422bb8613f8444db4af5234e1a1_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
这是这个函数的调用关系图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a0be9b422bb8613f8444db4af5234e1a1_icgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
<anchor xml:id="_mpu6050_8cpp_1a59b1c26b234be88e97435a1b3c061330"/><section>
|
||
|
|
<title>MPU_Write_Len()</title>
|
||
|
|
<indexterm><primary>MPU_Write_Len</primary><secondary>mpu6050.cpp</secondary></indexterm>
|
||
|
|
<indexterm><primary>mpu6050.cpp</primary><secondary>MPU_Write_Len</secondary></indexterm>
|
||
|
|
<para><computeroutput><link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> MPU_Write_Len (<link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> addr, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> reg, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> len, <link linkend="_varint_8h_1a92c50087ca0e64fa93fc59402c55f8ca">u8</link> * buf)</computeroutput></para><para>
|
||
|
|
|
||
|
|
<para>IIC连续写 </para>
|
||
|
|
</para>
|
||
|
|
|
||
|
|
<para>
|
||
|
|
<formalpara>
|
||
|
|
<title>
|
||
|
|
参数</title>
|
||
|
|
<para>
|
||
|
|
<table frame="all">
|
||
|
|
<tgroup cols="2" align="left" colsep="1" rowsep="1">
|
||
|
|
<colspec colwidth="1*"/>
|
||
|
|
<colspec colwidth="4*"/>
|
||
|
|
<tbody>
|
||
|
|
<row>
|
||
|
|
<entry>addr</entry><entry>
|
||
|
|
<para>器件地址 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>reg</entry><entry>
|
||
|
|
<para>寄存器地址 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>len</entry><entry>
|
||
|
|
<para>写入长度 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
<row>
|
||
|
|
<entry>*buf</entry><entry>
|
||
|
|
<para>数据区 </para>
|
||
|
|
</entry>
|
||
|
|
</row>
|
||
|
|
</tbody>
|
||
|
|
</tgroup>
|
||
|
|
</table>
|
||
|
|
</para>
|
||
|
|
</formalpara>
|
||
|
|
<formalpara><title>返回</title>
|
||
|
|
|
||
|
|
<para>0,设置成功 </para>
|
||
|
|
</formalpara>
|
||
|
|
</para>
|
||
|
|
<para>
|
||
|
|
在文件 <link linkend="_mpu6050_8cpp_source">mpu6050.cpp</link> 第 <link linkend="_mpu6050_8cpp_source_1l00156">156</link> 行定义.</para>
|
||
|
|
函数调用图:<para>
|
||
|
|
<informalfigure>
|
||
|
|
<mediaobject>
|
||
|
|
<imageobject>
|
||
|
|
<imagedata width="50%" align="center" valign="middle" scalefit="0" fileref="mpu6050_8cpp_a59b1c26b234be88e97435a1b3c061330_cgraph.png"></imagedata>
|
||
|
|
</imageobject>
|
||
|
|
</mediaobject>
|
||
|
|
</informalfigure>
|
||
|
|
</para>
|
||
|
|
</section>
|
||
|
|
</section>
|
||
|
|
</section>
|