资源简介
STM32的MPU6050官方库,移植成功,I2C模拟通讯,欧拉角串口输出
代码片段和文件信息
/*
$License:
Copyright (C) 2011-2012 InvenSense Corporation All Rights Reserved.
See included License.txt for License information.
$
*/
/**
* @addtogroup DRIVERS Sensor Driver layer
* @brief Hardware drivers to communicate with sensors via I2C.
*
* @{
* @file inv_mpu.c
* @brief An I2C-based driver for Invensense gyroscopes.
* @details This driver currently works for the following devices:
* MPU6050
* MPU6500
* MPU9150 (or MPU6050 w/ AK8975 on the auxiliary bus)
* MPU9250 (or MPU6500 w/ AK8963 on the auxiliary bus)
*/
#include
#include
#include
#include
#include
#include “inv_mpu.h“
#include “stm32f10x.h“
#include “STM32_I2C.h“
#include “delay.h“
#include “Time.h“
#include “usart.h“
/* The following functions must be defined for this platform:
* i2c_write(unsigned char slave_addr unsigned char reg_addr
* unsigned char length unsigned char const *data)
* i2c_read(unsigned char slave_addr unsigned char reg_addr
* unsigned char length unsigned char *data)
* delay_ms(unsigned long num_ms)
* get_ms(unsigned long *count)
* reg_int_cb(void (*cb)(void) unsigned char port unsigned char pin)
* labs(long x)
* fabsf(float x)
* min(int a int b)
*/
#define MPU6050
#define MOTION_DRIVER_TARGET_MSP430
#if defined MOTION_DRIVER_TARGET_MSP430
/*#include “msp430.h“
#include “msp430_i2c.h“
#include “msp430_clock.h“
#include “msp430_interrupt.h“ */
#define i2c_write i2cwrite
#define i2c_read i2cread
#define delay_ms delay_ms
#define get_ms get_ms
//static int reg_int_cb(struct int_param_s *int_param)
//{
// /*return msp430_reg_int_cb(int_param->cb int_param->pin int_param->lp_exit
// int_param->active_low);*/
// return 0;
//}
//#define log_i(...) do {} while (0)
//#define log_e(...) do {} while (0)
#define log_e PrintChar
#define log_i PrintChar
/* labs is already defined by TI‘s toolchain. */
/* fabs is for doubles. fabsf is for floats. */
#define fabs fabsf
#define min(ab) ((a
#elif defined EMPL_TARGET_MSP430
#include “msp430.h“
#include “msp430_i2c.h“
#include “msp430_clock.h“
#include “msp430_interrupt.h“
#include “log.h“
#define i2c_write msp430_i2c_write
#define i2c_read msp430_i2c_read
#define delay_ms msp430_delay_ms
#define get_ms msp430_get_clock_ms
static inline int reg_int_cb(struct int_param_s *int_param)
{
return msp430_reg_int_cb(int_param->cb int_param->pin int_param->lp_exit
int_param->active_low);
}
#define log_i MPL_LOGI
#define log_e MPL_LOGE
/* labs is already defined by TI‘s toolchain. */
/* fabs is for doubles. fabsf is for floats. */
#define fabs fabsf
#define min(ab) ((a#elif defined EMPL_TARGET_UC3L0
/* Instead of using the
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 19342 2012-12-14 11:16 DMp\eMPL\dmpKey.h
文件 6765 2012-12-14 11:16 DMp\eMPL\dmpmap.h
文件 84559 2013-07-25 14:17 DMp\eMPL\inv_mpu.c
文件 4452 2013-06-13 17:19 DMp\eMPL\inv_mpu.h
文件 58392 2013-06-13 21:03 DMp\eMPL\inv_mpu_dmp_motion_driver.c
文件 3538 2013-06-13 16:52 DMp\eMPL\inv_mpu_dmp_motion_driver.h
文件 17273 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\CoreSupport\core_cm3.c
文件 85714 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\CoreSupport\core_cm3.h
文件 25107 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\Release_Notes_for_STM32F10x_CMSIS.html
文件 15763 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_cl.s
文件 15500 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd.s
文件 15767 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_hd_vl.s
文件 12373 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_ld.s
文件 13653 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_ld_vl.s
文件 12762 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_md.s
文件 14070 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_md_vl.s
文件 15952 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\arm\startup_stm32f10x_xl.s
文件 12955 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_cl.s
文件 13042 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_hd.s
文件 12451 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_hd_vl.s
文件 9698 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_ld.s
文件 10445 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_ld_vl.s
文件 10154 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_md.s
文件 10941 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_md_vl.s
文件 13143 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\gcc_ride7\startup_stm32f10x_xl.s
文件 16629 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_cl.s
文件 16231 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_hd.s
文件 15791 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_hd_vl.s
文件 12653 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_ld.s
文件 12952 2010-10-18 20:09 DMp\Libraries\CMSIS\CM3\DeviceSupport\ST\STM32F10x\startup\iar\startup_stm32f10x_ld_vl.s
............此处省略189个文件信息
- 上一篇:易宝支付接口参数文档
- 下一篇:h3c secpath acg1000 典型配置
相关资源
- stm32库函数中文使用手册
- STM32--IIC通信两个JY-901模块
- 基于stm32的几种频率计的实现方法
- Stm32_PWM控制LED由暗变亮占空比可调
- 基于stm32与esp8266智能家居应用
- STM32F103内部温度传感器源码
- 板球系统2017电赛B题
- stm32f103-VK3224
- STM32F103C8T6的双路ADC采样
- 基于STM32F103C8T6的迷宫小车
- STM32f103电压采样并用LCD1602显示
- STM32F407ZET/ZGT STEMWIN ILI9341 SPI LCD液晶屏
- stm32F103与PCM5102A与Helix软解播放MP3
- 用KEIL编写的MODBUS_RTU从站程序STM32
- STM32连接CC1101模块的发射程序!
- STM32F030C8T6库函数模版
- STM32函数库使用手册
- 基于stm32f103C8-ADC带ucos操作系统
- STM32F103C8T6核心板使用说明,原理图,
- MLX90614非接触式红外测温测试代码
- 中景园电子0.96OLED显示屏_STM32_F103C8系
- 基于stm32搬运物块小车
- 基于stm32和FPGA测频测相程序
- PCB练习 STM32最小系统模块制作 适合新
- stm32f407对ds18b20温度传感器数据的采集
- VL53L1X驱动例程
- stm3213年电赛旋转倒立摆
- STM32官方最全的定时器培训资料
- STM32F407_OLED显示
- STM32输出12路pwm程序
评论
共有 条评论