首页 星云 工具 资源 星选 资讯 热门工具
:

PDF转图片 完全免费 小红书视频下载 无水印 抖音视频下载 无水印 数字星空

Motion_Driver_6.12

硬件开发 279.15KB 17 需要积分: 1
立即下载

资源介绍:

MPU6050自带了数字运动处理器, 即 DMP, 并 且, InvenSense 提供了一个 MPU6050 的嵌入式运动驱动库,移植教程可参考本人博客:https://blog.csdn.net/WalterBrien/article/details/123303182?spm=1001.2014.3001.5502
/* $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 EMPL_TARGET_STM32F4 #include "i2c.h" #include "main.h" #include "log.h" #include "board-st_discovery.h" #define i2c_write Sensors_I2C_WriteRegister #define i2c_read Sensors_I2C_ReadRegister #define delay_ms mdelay #define get_ms get_tick_count #define log_i MPL_LOGI #define log_e MPL_LOGE #define min(a,b) ((acb, 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(a,b) ((acb, 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(a,b) ((apin, int_param->cb, int_param->arg); return 0; } #define log_i MPL_LOGI #define log_e MPL_LOGE /* UC3 is a 32-bit processor, so abs and labs are equivalent. */ #define labs abs #define fabs(x) (((x)>0)?(x):-(x)) #else #error Gyro driver is missing the system layer implementations. #endif #if !defined MPU6050 && !defined MPU9150 && !defined MPU6500 && !defined MPU9250 #error Which gyro are you using? Define MPUxxxx in your compiler options. #endif /* Time for some messy macro work. =] * #define MPU9150 * is equivalent to.. * #define MPU6050 * #define AK8975_SECONDARY * * #define MPU9250 * is equivalent to.. * #define MPU6500 * #define AK8963_SECONDARY */ #if defined MPU9150 #ifndef MPU6050 #define MPU6050 #endif /* #ifndef MPU6050 */ #if defined AK8963_SECONDARY #error "MPU9150 and AK8963_SECONDARY cannot both be defined." #elif !defined AK8975_SECONDARY /* #if defined AK8963_SECONDARY */ #define AK8975_SECONDARY #endif /* #if defined AK8963_SECONDARY */ #elif defined MPU9250 /* #if defined MPU9150 */ #ifndef MPU6500 #define MPU6500 #endif /* #ifndef MPU6500 */ #if defined AK8975_SECONDARY #error "MPU9250 and AK8975_SECONDARY cannot both be defined." #elif !defined AK8963_SECONDARY /* #if defined AK8975_SECONDARY */ #define AK8963_SECONDARY #endif /* #if defined AK8975_SECONDARY */ #endif /* #if defined MPU9150 */ #if defined AK8975_SECONDARY || defined AK8963_SECONDARY #define AK89xx_SECONDARY #else /* #warning "No compass = less profit for Invensense. Lame." */ #endif static int set_int_enable(unsigned char enable); /* Hardware registers needed by driver. */ struct gyro_reg_s { unsigned char who_am_i; unsigned char rate_div; unsigned char lpf; unsigned char prod_id; unsigned char user_ctrl; unsigned char fifo_en; unsigned char gyro_cfg; unsigned char accel_cfg; unsigned char accel_cfg2; unsigned char lp_accel_odr; unsigned char motion_thr; unsigned char motion_dur; unsigned char fifo_count_h; unsigned char fifo_r_w; unsigned char raw_gyro; unsigned char raw_accel; unsigned char temp; unsigned char int_enable; unsigned char dmp_int_status; unsigned char int_status; unsigned char accel_intel; unsigned char pwr_mgmt_1; unsigned char pwr_mgmt_2; unsigned char int_pin_cfg; unsigned char mem_r_w; unsigned char accel_offs; unsigned char i2c_mst; unsigned char bank_sel; unsigned char mem_start_addr; unsigned char prgm_start_h; #if defined AK89xx_SECONDARY unsigned char s0_addr; unsigned char s0_reg; unsigned char s0_ctrl; unsigned char s1_addr; unsigned char s1_reg; unsigned char s1_ctrl; unsigned char s4_ctrl; unsigned char s0_do; unsigned char s1_do; unsigned char i2c_delay_ctrl; unsigned char raw_compass; /* The I2C_MST_VDDIO bit is in this register. */ unsigned char yg_offs_tc; #endif }; /* Information specific to a particular device. */ struct hw_s { unsigned char addr; unsigned short max_fifo; unsigned char num_reg; unsigned short temp_sens; short temp_offset; unsigned short bank_size; #if defined AK89xx_SECONDARY unsigned short compass_fsr; #endif }; /* When entering motion interrupt mode, the driver keeps track of the * previous state so that it can be restored at a later time. * TODO: This is tacky. Fix it. */ struct motion_int_cache_s { unsigned short gyro_fsr; unsigned char accel_fsr; unsigned short lpf; unsigned short sample_rate; unsigned char sensors_on; unsigned char fifo_sensors; unsigned char dmp_on; }; /* Cached chip configuration data. * TODO: A lot of these can be handled with a bitmask. */ struct chip_cfg_s { /* Matches gyro_cfg >> 3 & 0x03 */ unsigned char gyro_fsr; /* Matches accel_cfg >> 3 & 0x03 */ unsigned char accel_fsr; /* Enabled sensors. Uses same masks as fifo_en, NOT pwr_mgmt_2. */ unsigned

资源文件列表:

Motion_Driver_6.12.zip 大约有56个文件
  1. Motion_Driver_6.12/
  2. Motion_Driver_6.12/driver/
  3. Motion_Driver_6.12/driver/eMPL/
  4. Motion_Driver_6.12/driver/eMPL/dmpKey.h 18.89KB
  5. Motion_Driver_6.12/driver/eMPL/dmpmap.h 6.61KB
  6. Motion_Driver_6.12/driver/eMPL/inv_mpu.c 96.6KB
  7. Motion_Driver_6.12/driver/eMPL/inv_mpu.h 4.7KB
  8. Motion_Driver_6.12/driver/eMPL/inv_mpu_dmp_motion_driver.c 57.11KB
  9. Motion_Driver_6.12/driver/eMPL/inv_mpu_dmp_motion_driver.h 3.46KB
  10. Motion_Driver_6.12/driver/include/
  11. Motion_Driver_6.12/driver/include/log.h 10.21KB
  12. Motion_Driver_6.12/driver/include/mlinclude.h 1014B
  13. Motion_Driver_6.12/driver/include/mlmath.h 2.21KB
  14. Motion_Driver_6.12/driver/include/mlos.h 2.08KB
  15. Motion_Driver_6.12/driver/include/mltypes.h 9.29KB
  16. Motion_Driver_6.12/driver/include/mpu.h 11.48KB
  17. Motion_Driver_6.12/driver/include/stdint_invensense.h 834B
  18. Motion_Driver_6.12/driver/stm32L/
  19. Motion_Driver_6.12/driver/stm32L/log_stm32.c 5.91KB
  20. Motion_Driver_6.12/driver/stm32L/packet.h 1.51KB
  21. Motion_Driver_6.12/eMPL-hal/
  22. Motion_Driver_6.12/eMPL-hal/eMPL_outputs.c 10.94KB
  23. Motion_Driver_6.12/eMPL-hal/eMPL_outputs.h 1.28KB
  24. Motion_Driver_6.12/mllite/
  25. Motion_Driver_6.12/mllite/data_builder.c 44.81KB
  26. Motion_Driver_6.12/mllite/data_builder.h 9.28KB
  27. Motion_Driver_6.12/mllite/hal_outputs.c 17.9KB
  28. Motion_Driver_6.12/mllite/hal_outputs.h 1.66KB
  29. Motion_Driver_6.12/mllite/invensense.h 656B
  30. Motion_Driver_6.12/mllite/message_layer.c 1.55KB
  31. Motion_Driver_6.12/mllite/message_layer.h 934B
  32. Motion_Driver_6.12/mllite/ml_math_func.c 24.76KB
  33. Motion_Driver_6.12/mllite/ml_math_func.h 4.77KB
  34. Motion_Driver_6.12/mllite/mlmath.c 1KB
  35. Motion_Driver_6.12/mllite/mpl.c 1.75KB
  36. Motion_Driver_6.12/mllite/mpl.h 435B
  37. Motion_Driver_6.12/mllite/results_holder.c 15.85KB
  38. Motion_Driver_6.12/mllite/results_holder.h 2.78KB
  39. Motion_Driver_6.12/mllite/start_manager.c 2.97KB
  40. Motion_Driver_6.12/mllite/start_manager.h 697B
  41. Motion_Driver_6.12/mllite/storage_manager.c 6.63KB
  42. Motion_Driver_6.12/mllite/storage_manager.h 848B
  43. Motion_Driver_6.12/mpl/
  44. Motion_Driver_6.12/mpl/accel_auto_cal.h 1.01KB
  45. Motion_Driver_6.12/mpl/compass_vec_cal.h 839B
  46. Motion_Driver_6.12/mpl/fast_no_motion.h 1.3KB
  47. Motion_Driver_6.12/mpl/fusion_9axis.h 1020B
  48. Motion_Driver_6.12/mpl/gyro_tc.h 925B
  49. Motion_Driver_6.12/mpl/heading_from_gyro.h 793B
  50. Motion_Driver_6.12/mpl/inv_math.h 182B
  51. Motion_Driver_6.12/mpl/invensense_adv.h 662B
  52. Motion_Driver_6.12/mpl/libmpllib.lib 557.29KB
  53. Motion_Driver_6.12/mpl/mag_disturb.h 974B
  54. Motion_Driver_6.12/mpl/motion_no_motion.h 650B
  55. Motion_Driver_6.12/mpl/no_gyro_fusion.h 787B
  56. Motion_Driver_6.12/mpl/quaternion_supervisor.h 582B
0评论
提交 加载更多评论
其他资源 Android投屏demo
两台设备间的投屏demo
Android基于环信的即时通讯demo
基于环信的即时通讯demo,例子比较简单,只包括注册,登录,单聊,加好友,好友列表,会话列表等简单功能。 注:有一个摇一摇功能(吐司提示)和聊天无关,只是一个类而已,在MainActivity初始化了一下。 提供几个账号:shaoen1,shaoen2,test1,test2.密码:123456
Vue-DevTools插件下载
免费下载
viewerjs.zip
viewerjs Demo实例
~~~~~~~~~~~~~~~数据库E-R图
e-r 图~~~~~~~~~~~~~~~~~~~~~~
commons-logging-1.1
当你需要时,你就会知道他的有处了!
OneKey2MIUI.zip
此工具是小米平板2线刷工具,详情教程地址:https://blog.csdn.net/baofengzhe/article/details/105913405
利用粤嵌6818开发板实现电子相册,2048小游戏,刮刮乐
这个资源比较适合C语言的初学者