資源簡介
陀螺儀官方DMP庫輸出四元函數

代碼片段和文件信息
/*
?$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“
/*?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)
?*/
#if?defined?MOTION_DRIVER_TARGET_MSP430
#include?“msp430.h“
#include?“msp430_i2c.h“
#include?“msp430_clock.h“
#include?“msp430_interrupt.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(...)?????do?{}?while?(0)
#define?log_e(...)?????do?{}?while?(0)
/*?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?standard?TWI?driver?from?the?ASF?library?we‘re?using
?*?a?TWI?driver?that?follows?the?slave?address?+?register?address?convention.
?*/
#include?“twi.h“
#include?“delay.h“
#include?“sysclk.h“
#include?“log.h“
#inc
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????521??2012-12-14?11:14??em
?????文件??????15703??2012-12-14?11:14??em
?????文件???????2582??2012-12-14?11:14??em
?????文件?????????93??2012-12-14?11:14??em
?????文件???????1351??2012-12-14?11:14??em
?????文件????????154??2012-12-14?11:14??em
?????文件??????19342??2012-12-14?11:16??em
?????文件???????6765??2012-12-14?11:16??em
?????文件??????82774??2012-12-14?11:16??em
?????文件???????4469??2012-12-14?11:16??em
?????文件??????58237??2012-12-14?11:16??em
?????文件???????3538??2012-12-14?11:16??em
?????文件???????4841??2012-12-14?11:16??em
?????文件???????5039??2012-12-14?11:16??em
?????文件???????2235??2012-12-14?11:16??em
?????文件???????3131??2012-12-14?11:16??em
?????文件???????2740??2012-12-14?11:16??em
?????文件???????9835??2012-12-14?11:16??em
?????文件???????6200??2012-12-14?11:16??em
?????文件???????6371??2012-12-14?11:16??em
?????文件??????11100??2012-12-14?11:16??em
?????文件???????9847??2012-12-14?11:16??em
?????文件???????7886??2012-12-14?11:16??em
?????文件???????1301??2012-12-14?11:16??em
?????文件???????6305??2012-12-14?11:16??em
?????文件???????3497??2012-12-14?11:16??em
?????文件???????9723??2012-12-14?11:16??em
?????文件???????2343??2012-12-14?11:16??em
?????文件???????7389??2012-12-14?11:16??em
?????文件???????2709??2012-12-14?11:16??em
............此處省略58個文件信息
- 上一篇:ANSI/VITA 65-2017
- 下一篇:MPU9250&DMP
評論
共有 條評論