#include "mpu6050.h" #include "twi_master.h" #include "nrf_delay.h" //#include "twi_master.h" //#include "mltypes.h" //#include "inv_mpu_dmp_motion_driver.h" //#include "log.h" //#include "invensense.h" //#include "invensense_adv.h" //#include "eMPL_outputs.h" //#include "mpu.h" //#include "inv_mpu.h" //#include "log.h" //#include "data_builder.h" //unsigned char *mpl_key = (unsigned char*)"eMPL 5.1"; //volatile uint32_t hal_timestamp = 0; //#define ACCEL_ON (0x01) //#define GYRO_ON (0x02) //#define COMPASS_ON (0x04) //#define MOTION (0) //#define NO_MOTION (1) ///* Starting sampling rate. */ //#define DEFAULT_MPU_HZ (100) //#define FLASH_SIZE (512) //#define FLASH_MEM_START ((void*)0x1800) //#define PEDO_READ_MS (1000) //#define TEMP_READ_MS (500) //#define COMPASS_READ_MS (100) ////struct rx_s { //// unsigned char header[3]; //// unsigned char cmd; ////}; ////struct hal_s { //// unsigned char lp_accel_mode; //// unsigned char sensors; //// unsigned char dmp_on; //// unsigned char wait_for_tap; //// volatile unsigned char new_gyro; //// unsigned char motion_int_mode; //// unsigned long no_dmp_hz; //// unsigned long next_pedo_ms; //// unsigned long next_temp_ms; //// unsigned long next_compass_ms; //// unsigned int report; //// unsigned short dmp_features; //// struct rx_s rx; ////}; ////static struct hal_s hal = {0}; ///* Platform-specific information. Kinda like a boardfile. */ //struct platform_data_s { // signed char orientation[9]; //}; //static struct platform_data_s gyro_pdata = { // .orientation = { 1, 0, 0, // 0, 1, 0, // 0, 0, 1} //}; int mpu6050_register_write_len(uint8_t addr,uint8_t register_address, uint8_t len,uint8_t *buf) { uint8_t w2_data[50],i; // printf("\r\n"); // printf("write addr=0x%2X,",addr); // printf("register_address=0x%2X,",register_address); w2_data[0] = register_address; for(i=0;i