LibDriver MPU6050  1.0.0
MPU6050 full-featured driver
mpu6050 basic driver function

mpu6050 basic driver modules More...

Data Structures

struct  mpu6050_handle_s
 mpu6050 handle structure definition More...
 
struct  mpu6050_info_s
 mpu6050 information structure definition More...
 

Typedefs

typedef struct mpu6050_handle_s mpu6050_handle_t
 mpu6050 handle structure definition
 
typedef struct mpu6050_info_s mpu6050_info_t
 mpu6050 information structure definition
 

Enumerations

enum  mpu6050_address_t { MPU6050_ADDRESS_AD0_LOW = 0xD0 , MPU6050_ADDRESS_AD0_HIGH = 0xD2 }
 mpu6050 address enumeration definition More...
 
enum  mpu6050_wake_up_frequency_t { MPU6050_WAKE_UP_FREQUENCY_1P25_HZ = 0x00 , MPU6050_WAKE_UP_FREQUENCY_5_HZ = 0x01 , MPU6050_WAKE_UP_FREQUENCY_20_HZ = 0x02 , MPU6050_WAKE_UP_FREQUENCY_40_HZ = 0x03 }
 mpu6050 wake up frequency enumeration definition More...
 
enum  mpu6050_bool_t { MPU6050_BOOL_FALSE = 0x00 , MPU6050_BOOL_TRUE = 0x01 }
 mpu6050 bool enumeration definition More...
 
enum  mpu6050_source_t {
  MPU6050_SOURCE_ACC_X = 0x05 , MPU6050_SOURCE_ACC_Y = 0x04 , MPU6050_SOURCE_ACC_Z = 0x03 , MPU6050_SOURCE_GYRO_X = 0x02 ,
  MPU6050_SOURCE_GYRO_Y = 0x01 , MPU6050_SOURCE_GYRO_Z = 0x00
}
 mpu6050 source enumeration definition More...
 
enum  mpu6050_clock_source_t {
  MPU6050_CLOCK_SOURCE_INTERNAL_8MHZ = 0x00 , MPU6050_CLOCK_SOURCE_PLL_X_GYRO = 0x01 , MPU6050_CLOCK_SOURCE_PLL_Y_GYRO = 0x02 , MPU6050_CLOCK_SOURCE_PLL_Z_GYRO = 0x03 ,
  MPU6050_CLOCK_SOURCE_PLL_EXT_32P768_KHZ = 0x04 , MPU6050_CLOCK_SOURCE_PLL_EXT_19P2_MHZ = 0x05 , MPU6050_CLOCK_SOURCE_STOP_CLOCK = 0x07
}
 mpu6050 clock source enumeration definition More...
 
enum  mpu6050_signal_path_reset_t { MPU6050_SIGNAL_PATH_RESET_TEMP = 0x00 , MPU6050_SIGNAL_PATH_RESET_ACCEL = 0x01 , MPU6050_SIGNAL_PATH_RESET_GYRO = 0x02 }
 mpu6050 signal path reset enumeration definition More...
 
enum  mpu6050_extern_sync_t {
  MPU6050_EXTERN_SYNC_INPUT_DISABLED = 0x00 , MPU6050_EXTERN_SYNC_TEMP_OUT_L = 0x01 , MPU6050_EXTERN_SYNC_GYRO_XOUT_L = 0x02 , MPU6050_EXTERN_SYNC_GYRO_YOUT_L = 0x03 ,
  MPU6050_EXTERN_SYNC_GYRO_ZOUT_L = 0x04 , MPU6050_EXTERN_SYNC_ACCEL_XOUT_L = 0x05 , MPU6050_EXTERN_SYNC_ACCEL_YOUT_L = 0x06 , MPU6050_EXTERN_SYNC_ACCEL_ZOUT_L = 0x07
}
 mpu6050 extern sync enumeration definition More...
 
enum  mpu6050_low_pass_filter_t {
  MPU6050_LOW_PASS_FILTER_0 = 0x00 , MPU6050_LOW_PASS_FILTER_1 = 0x01 , MPU6050_LOW_PASS_FILTER_2 = 0x02 , MPU6050_LOW_PASS_FILTER_3 = 0x03 ,
  MPU6050_LOW_PASS_FILTER_4 = 0x04 , MPU6050_LOW_PASS_FILTER_5 = 0x05 , MPU6050_LOW_PASS_FILTER_6 = 0x06
}
 mpu6050 low pass filter enumeration definition More...
 
enum  mpu6050_axis_t { MPU6050_AXIS_Z = 0x05 , MPU6050_AXIS_Y = 0x06 , MPU6050_AXIS_X = 0x07 }
 mpu6050 axis enumeration definition More...
 
enum  mpu6050_gyroscope_range_t { MPU6050_GYROSCOPE_RANGE_250DPS = 0x00 , MPU6050_GYROSCOPE_RANGE_500DPS = 0x01 , MPU6050_GYROSCOPE_RANGE_1000DPS = 0x02 , MPU6050_GYROSCOPE_RANGE_2000DPS = 0x03 }
 mpu6050 gyroscope range enumeration definition More...
 
enum  mpu6050_accelerometer_range_t { MPU6050_ACCELEROMETER_RANGE_2G = 0x00 , MPU6050_ACCELEROMETER_RANGE_4G = 0x01 , MPU6050_ACCELEROMETER_RANGE_8G = 0x02 , MPU6050_ACCELEROMETER_RANGE_16G = 0x03 }
 mpu6050 accelerometer range enumeration definition More...
 
enum  mpu6050_fifo_t {
  MPU6050_FIFO_TEMP = 0x07 , MPU6050_FIFO_XG = 0x06 , MPU6050_FIFO_YG = 0x05 , MPU6050_FIFO_ZG = 0x04 ,
  MPU6050_FIFO_ACCEL = 0x03
}
 mpu6050 fifo enumeration definition More...
 
enum  mpu6050_pin_level_t { MPU6050_PIN_LEVEL_HIGH = 0x00 , MPU6050_PIN_LEVEL_LOW = 0x01 }
 mpu6050 pin level enumeration definition More...
 
enum  mpu6050_pin_type_t { MPU6050_PIN_TYPE_PUSH_PULL = 0x00 , MPU6050_PIN_TYPE_OPEN_DRAIN = 0x01 }
 mpu6050 pin type enumeration definition More...
 
enum  mpu6050_interrupt_t {
  MPU6050_INTERRUPT_MOTION = 6 , MPU6050_INTERRUPT_FIFO_OVERFLOW = 4 , MPU6050_INTERRUPT_I2C_MAST = 3 , MPU6050_INTERRUPT_DMP = 1 ,
  MPU6050_INTERRUPT_DATA_READY = 0
}
 mpu6050 interrupt enumeration definition More...
 
enum  mpu6050_iic_slave_t {
  MPU6050_IIC_SLAVE_0 = 0x00 , MPU6050_IIC_SLAVE_1 = 0x01 , MPU6050_IIC_SLAVE_2 = 0x02 , MPU6050_IIC_SLAVE_3 = 0x03 ,
  MPU6050_IIC_SLAVE_4 = 0x04
}
 mpu6050 iic slave enumeration definition More...
 
enum  mpu6050_iic_clock_t {
  MPU6050_IIC_CLOCK_348_KHZ = 0x00 , MPU6050_IIC_CLOCK_333_KHZ = 0x01 , MPU6050_IIC_CLOCK_320_KHZ = 0x02 , MPU6050_IIC_CLOCK_308_KHZ = 0x03 ,
  MPU6050_IIC_CLOCK_296_KHZ = 0x04 , MPU6050_IIC_CLOCK_286_KHZ = 0x05 , MPU6050_IIC_CLOCK_276_KHZ = 0x06 , MPU6050_IIC_CLOCK_267_KHZ = 0x07 ,
  MPU6050_IIC_CLOCK_258_KHZ = 0x08 , MPU6050_IIC_CLOCK_500_KHZ = 0x09 , MPU6050_IIC_CLOCK_471_KHZ = 0x0A , MPU6050_IIC_CLOCK_444_KHZ = 0x0B ,
  MPU6050_IIC_CLOCK_421_KHZ = 0x0C , MPU6050_IIC_CLOCK_400_KHZ = 0x0D , MPU6050_IIC_CLOCK_381_KHZ = 0x0E , MPU6050_IIC_CLOCK_364_KHZ = 0x0F
}
 mpu6050 iic clock enumeration definition More...
 
enum  mpu6050_iic_read_mode_t { MPU6050_IIC_READ_MODE_RESTART = 0x00 , MPU6050_IIC_READ_MODE_STOP_AND_START = 0x01 }
 mpu6050 iic read mode enumeration definition More...
 
enum  mpu6050_iic_mode_t { MPU6050_IIC_MODE_WRITE = 0x00 , MPU6050_IIC_MODE_READ = 0x01 }
 mpu6050 iic mode enumeration definition More...
 
enum  mpu6050_iic_transaction_mode_t { MPU6050_IIC_TRANSACTION_MODE_DATA = 0x00 , MPU6050_IIC_TRANSACTION_MODE_REG_DATA = 0x01 }
 mpu6050 iic transaction mode enumeration definition More...
 
enum  mpu6050_iic4_transaction_mode_t { MPU6050_IIC4_TRANSACTION_MODE_DATA = 0x00 , MPU6050_IIC4_TRANSACTION_MODE_REG = 0x01 }
 mpu6050 iic4 transaction mode enumeration definition More...
 
enum  mpu6050_iic_group_order_t { MPU6050_IIC_GROUP_ORDER_EVEN = 0x00 , MPU6050_IIC_GROUP_ORDER_ODD = 0x01 }
 mpu6050 iic group order enumeration definition More...
 
enum  mpu6050_iic_status_t {
  MPU6050_IIC_STATUS_PASS_THROUGH = 0x80 , MPU6050_IIC_STATUS_IIC_SLV4_DONE = 0x40 , MPU6050_IIC_STATUS_IIC_LOST_ARB = 0x20 , MPU6050_IIC_STATUS_IIC_SLV4_NACK = 0x10 ,
  MPU6050_IIC_STATUS_IIC_SLV3_NACK = 0x08 , MPU6050_IIC_STATUS_IIC_SLV2_NACK = 0x04 , MPU6050_IIC_STATUS_IIC_SLV1_NACK = 0x02 , MPU6050_IIC_STATUS_IIC_SLV0_NACK = 0x01
}
 mpu6050 iic status enumeration definition More...
 
enum  mpu6050_iic_delay_t {
  MPU6050_IIC_DELAY_ES_SHADOW = 7 , MPU6050_IIC_DELAY_SLAVE_4 = 4 , MPU6050_IIC_DELAY_SLAVE_3 = 3 , MPU6050_IIC_DELAY_SLAVE_2 = 2 ,
  MPU6050_IIC_DELAY_SLAVE_1 = 1 , MPU6050_IIC_DELAY_SLAVE_0 = 0
}
 mpu6050 iic delay enumeration definition More...
 

Functions

uint8_t mpu6050_info (mpu6050_info_t *info)
 get the chip's information More...
 
uint8_t mpu6050_set_addr_pin (mpu6050_handle_t *handle, mpu6050_address_t addr_pin)
 set the chip address pin More...
 
uint8_t mpu6050_get_addr_pin (mpu6050_handle_t *handle, mpu6050_address_t *addr_pin)
 get the chip address pin More...
 
uint8_t mpu6050_irq_handler (mpu6050_handle_t *handle)
 irq handler More...
 
uint8_t mpu6050_init (mpu6050_handle_t *handle)
 initialize the chip More...
 
uint8_t mpu6050_deinit (mpu6050_handle_t *handle)
 close the chip More...
 
uint8_t mpu6050_read (mpu6050_handle_t *handle, int16_t(*accel_raw)[3], float(*accel_g)[3], int16_t(*gyro_raw)[3], float(*gyro_dps)[3], uint16_t *len)
 read the data More...
 
uint8_t mpu6050_read_temperature (mpu6050_handle_t *handle, int16_t(*raw), float *degrees)
 read the temperature More...
 
uint8_t mpu6050_set_fifo (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable fifo More...
 
uint8_t mpu6050_get_fifo (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the fifo status More...
 
uint8_t mpu6050_force_fifo_reset (mpu6050_handle_t *handle)
 force reset the fifo More...
 
uint8_t mpu6050_set_iic_master (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the iic master mode More...
 
uint8_t mpu6050_get_iic_master (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the iic master status More...
 
uint8_t mpu6050_fifo_reset (mpu6050_handle_t *handle)
 reset the fifo More...
 
uint8_t mpu6050_get_fifo_reset (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the fifo reset status More...
 
uint8_t mpu6050_iic_master_reset (mpu6050_handle_t *handle)
 reset the iic master controller More...
 
uint8_t mpu6050_get_iic_master_reset (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the iic master reset status More...
 
uint8_t mpu6050_sensor_reset (mpu6050_handle_t *handle)
 reset all sensors More...
 
uint8_t mpu6050_get_sensor_reset (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the sensor reset status More...
 
uint8_t mpu6050_device_reset (mpu6050_handle_t *handle)
 reset the chip More...
 
uint8_t mpu6050_get_device_reset (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the device reset status More...
 
uint8_t mpu6050_set_clock_source (mpu6050_handle_t *handle, mpu6050_clock_source_t clock_source)
 set the chip clock source More...
 
uint8_t mpu6050_get_clock_source (mpu6050_handle_t *handle, mpu6050_clock_source_t *clock_source)
 get the chip clock source More...
 
uint8_t mpu6050_set_temperature_sensor (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the temperature sensor More...
 
uint8_t mpu6050_get_temperature_sensor (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the temperature sensor status More...
 
uint8_t mpu6050_set_cycle_wake_up (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the cycle wake up mode More...
 
uint8_t mpu6050_get_cycle_wake_up (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the cycle wake up mode status More...
 
uint8_t mpu6050_set_sleep (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the sleep mode More...
 
uint8_t mpu6050_get_sleep (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the sleep status More...
 
uint8_t mpu6050_set_standby_mode (mpu6050_handle_t *handle, mpu6050_source_t source, mpu6050_bool_t enable)
 set source into standby mode More...
 
uint8_t mpu6050_get_standby_mode (mpu6050_handle_t *handle, mpu6050_source_t source, mpu6050_bool_t *enable)
 get the source mode More...
 
uint8_t mpu6050_set_wake_up_frequency (mpu6050_handle_t *handle, mpu6050_wake_up_frequency_t frequency)
 set the wake up frequency More...
 
uint8_t mpu6050_get_wake_up_frequency (mpu6050_handle_t *handle, mpu6050_wake_up_frequency_t *frequency)
 get the wake up frequency More...
 
uint8_t mpu6050_get_fifo_count (mpu6050_handle_t *handle, uint16_t *count)
 get the fifo counter value More...
 
uint8_t mpu6050_fifo_get (mpu6050_handle_t *handle, uint8_t *buf, uint16_t len)
 fifo read bytes More...
 
uint8_t mpu6050_fifo_set (mpu6050_handle_t *handle, uint8_t *buf, uint16_t len)
 fifo write bytes More...
 
uint8_t mpu6050_set_signal_path_reset (mpu6050_handle_t *handle, mpu6050_signal_path_reset_t path)
 set the signal path reset More...
 
uint8_t mpu6050_set_sample_rate_divider (mpu6050_handle_t *handle, uint8_t d)
 set the sample rate divider More...
 
uint8_t mpu6050_get_sample_rate_divider (mpu6050_handle_t *handle, uint8_t *d)
 get the sample rate divider More...
 
uint8_t mpu6050_set_extern_sync (mpu6050_handle_t *handle, mpu6050_extern_sync_t sync)
 set the extern sync type More...
 
uint8_t mpu6050_get_extern_sync (mpu6050_handle_t *handle, mpu6050_extern_sync_t *sync)
 get the extern sync type More...
 
uint8_t mpu6050_set_low_pass_filter (mpu6050_handle_t *handle, mpu6050_low_pass_filter_t filter)
 set the low pass filter More...
 
uint8_t mpu6050_get_low_pass_filter (mpu6050_handle_t *handle, mpu6050_low_pass_filter_t *filter)
 get the low pass filter More...
 
uint8_t mpu6050_set_gyroscope_test (mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t enable)
 set the gyroscope test More...
 
uint8_t mpu6050_get_gyroscope_test (mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t *enable)
 get the gyroscope test More...
 
uint8_t mpu6050_set_gyroscope_range (mpu6050_handle_t *handle, mpu6050_gyroscope_range_t range)
 set the gyroscope range More...
 
uint8_t mpu6050_get_gyroscope_range (mpu6050_handle_t *handle, mpu6050_gyroscope_range_t *range)
 get the gyroscope range More...
 
uint8_t mpu6050_set_accelerometer_test (mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t enable)
 set the accelerometer test More...
 
uint8_t mpu6050_get_accelerometer_test (mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t *enable)
 get the accelerometer test More...
 
uint8_t mpu6050_set_accelerometer_range (mpu6050_handle_t *handle, mpu6050_accelerometer_range_t range)
 set the accelerometer range More...
 
uint8_t mpu6050_get_accelerometer_range (mpu6050_handle_t *handle, mpu6050_accelerometer_range_t *range)
 get the accelerometer range More...
 
uint8_t mpu6050_set_fifo_enable (mpu6050_handle_t *handle, mpu6050_fifo_t fifo, mpu6050_bool_t enable)
 enable or disable the fifo function More...
 
uint8_t mpu6050_get_fifo_enable (mpu6050_handle_t *handle, mpu6050_fifo_t fifo, mpu6050_bool_t *enable)
 get the fifo function status More...
 
uint8_t mpu6050_set_interrupt_level (mpu6050_handle_t *handle, mpu6050_pin_level_t level)
 set the interrupt level More...
 
uint8_t mpu6050_get_interrupt_level (mpu6050_handle_t *handle, mpu6050_pin_level_t *level)
 get the interrupt level More...
 
uint8_t mpu6050_set_interrupt_pin_type (mpu6050_handle_t *handle, mpu6050_pin_type_t type)
 set the interrupt pin type More...
 
uint8_t mpu6050_get_interrupt_pin_type (mpu6050_handle_t *handle, mpu6050_pin_type_t *type)
 get the interrupt pin type More...
 
uint8_t mpu6050_set_interrupt_latch (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the interrupt latch More...
 
uint8_t mpu6050_get_interrupt_latch (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the interrupt latch status More...
 
uint8_t mpu6050_set_interrupt_read_clear (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the interrupt reading clear More...
 
uint8_t mpu6050_get_interrupt_read_clear (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the interrupt reading clear status More...
 
uint8_t mpu6050_set_fsync_interrupt_level (mpu6050_handle_t *handle, mpu6050_pin_level_t level)
 set the fsync interrupt level More...
 
uint8_t mpu6050_get_fsync_interrupt_level (mpu6050_handle_t *handle, mpu6050_pin_level_t *level)
 get the fsync interrupt level More...
 
uint8_t mpu6050_set_fsync_interrupt (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the fsync interrupt More...
 
uint8_t mpu6050_get_fsync_interrupt (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the fsync interrupt status More...
 
uint8_t mpu6050_set_iic_bypass (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the iic bypass More...
 
uint8_t mpu6050_get_iic_bypass (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the iic bypass status More...
 
uint8_t mpu6050_set_interrupt (mpu6050_handle_t *handle, mpu6050_interrupt_t type, mpu6050_bool_t enable)
 enable or disable the interrupt More...
 
uint8_t mpu6050_get_interrupt (mpu6050_handle_t *handle, mpu6050_interrupt_t type, mpu6050_bool_t *enable)
 get the interrupt status More...
 
uint8_t mpu6050_get_interrupt_status (mpu6050_handle_t *handle, uint8_t *status)
 get the interrupt status More...
 
uint8_t mpu6050_set_gyroscope_x_test (mpu6050_handle_t *handle, uint8_t data)
 set the gyroscope x test More...
 
uint8_t mpu6050_get_gyroscope_x_test (mpu6050_handle_t *handle, uint8_t *data)
 get the gyroscope x test More...
 
uint8_t mpu6050_set_gyroscope_y_test (mpu6050_handle_t *handle, uint8_t data)
 set the gyroscope y test More...
 
uint8_t mpu6050_get_gyroscope_y_test (mpu6050_handle_t *handle, uint8_t *data)
 get the gyroscope y test More...
 
uint8_t mpu6050_set_gyroscope_z_test (mpu6050_handle_t *handle, uint8_t data)
 set the gyroscope z test More...
 
uint8_t mpu6050_get_gyroscope_z_test (mpu6050_handle_t *handle, uint8_t *data)
 get the gyroscope z test More...
 
uint8_t mpu6050_set_accelerometer_x_test (mpu6050_handle_t *handle, uint8_t data)
 set the accelerometer x test More...
 
uint8_t mpu6050_get_accelerometer_x_test (mpu6050_handle_t *handle, uint8_t *data)
 get the accelerometer x test More...
 
uint8_t mpu6050_set_accelerometer_y_test (mpu6050_handle_t *handle, uint8_t data)
 set the accelerometer y test More...
 
uint8_t mpu6050_get_accelerometer_y_test (mpu6050_handle_t *handle, uint8_t *data)
 get the accelerometer y test More...
 
uint8_t mpu6050_set_accelerometer_z_test (mpu6050_handle_t *handle, uint8_t data)
 set the accelerometer z test More...
 
uint8_t mpu6050_get_accelerometer_z_test (mpu6050_handle_t *handle, uint8_t *data)
 get the accelerometer z test More...
 
uint8_t mpu6050_set_motion_threshold (mpu6050_handle_t *handle, uint8_t threshold)
 set the motion_threshold More...
 
uint8_t mpu6050_get_motion_threshold (mpu6050_handle_t *handle, uint8_t *threshold)
 get the motion_threshold More...
 
uint8_t mpu6050_motion_threshold_convert_to_register (mpu6050_handle_t *handle, float mg, uint8_t *reg)
 convert the motion threshold to the register raw data More...
 
uint8_t mpu6050_motion_threshold_convert_to_data (mpu6050_handle_t *handle, uint8_t reg, float *mg)
 convert the register raw data to the motion threshold More...
 
uint8_t mpu6050_set_motion_duration (mpu6050_handle_t *handle, uint8_t duration)
 set the motion duration More...
 
uint8_t mpu6050_get_motion_duration (mpu6050_handle_t *handle, uint8_t *duration)
 get the motion duration More...
 
uint8_t mpu6050_motion_duration_convert_to_register (mpu6050_handle_t *handle, uint8_t ms, uint8_t *reg)
 convert the motion duration to the register raw data More...
 
uint8_t mpu6050_motion_duration_convert_to_data (mpu6050_handle_t *handle, uint8_t reg, uint8_t *ms)
 convert the register raw data to the motion duration More...
 
uint8_t mpu6050_set_force_accel_sample (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable force accel sample More...
 
uint8_t mpu6050_self_test (mpu6050_handle_t *handle, int32_t gyro_offset_raw[3], int32_t accel_offset_raw[3])
 run the self test More...
 
uint8_t mpu6050_set_iic_clock (mpu6050_handle_t *handle, mpu6050_iic_clock_t clk)
 set the iic clock More...
 
uint8_t mpu6050_get_iic_clock (mpu6050_handle_t *handle, mpu6050_iic_clock_t *clk)
 get the iic clock More...
 
uint8_t mpu6050_set_iic_multi_master (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable iic multi master More...
 
uint8_t mpu6050_get_iic_multi_master (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the iic multi master status More...
 
uint8_t mpu6050_set_iic_wait_for_external_sensor (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable iic wait for external sensor More...
 
uint8_t mpu6050_get_iic_wait_for_external_sensor (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the iic wait for external sensor status More...
 
uint8_t mpu6050_set_iic_read_mode (mpu6050_handle_t *handle, mpu6050_iic_read_mode_t mode)
 set the iic read mode More...
 
uint8_t mpu6050_get_iic_read_mode (mpu6050_handle_t *handle, mpu6050_iic_read_mode_t *mode)
 get the iic read mode More...
 
uint8_t mpu6050_set_iic_fifo_enable (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_bool_t enable)
 enable or disable the iic fifo More...
 
uint8_t mpu6050_get_iic_fifo_enable (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_bool_t *enable)
 get the iic fifo status More...
 
uint8_t mpu6050_set_iic_mode (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_iic_mode_t mode)
 set the iic mode More...
 
uint8_t mpu6050_get_iic_mode (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_iic_mode_t *mode)
 get the iic mode More...
 
uint8_t mpu6050_set_iic_address (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t addr_7bit)
 set the iic address More...
 
uint8_t mpu6050_get_iic_address (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t *addr_7bit)
 get the iic address More...
 
uint8_t mpu6050_set_iic_register (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t reg)
 set the iic register More...
 
uint8_t mpu6050_get_iic_register (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t *reg)
 get the iic register More...
 
uint8_t mpu6050_set_iic_data_out (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t data)
 set the iic data out More...
 
uint8_t mpu6050_get_iic_data_out (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t *data)
 get the iic data out More...
 
uint8_t mpu6050_set_iic_enable (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_bool_t enable)
 enable or disable the iic More...
 
uint8_t mpu6050_get_iic_enable (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_bool_t *enable)
 get the iic status More...
 
uint8_t mpu6050_set_iic_byte_swap (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_bool_t enable)
 enable or disable the iic byte swap More...
 
uint8_t mpu6050_get_iic_byte_swap (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_bool_t *enable)
 get the iic byte swap status More...
 
uint8_t mpu6050_set_iic_transaction_mode (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_iic_transaction_mode_t mode)
 set the iic transaction mode More...
 
uint8_t mpu6050_get_iic_transaction_mode (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_iic_transaction_mode_t *mode)
 get the iic transaction mode More...
 
uint8_t mpu6050_set_iic_group_order (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_iic_group_order_t order)
 set the iic group order More...
 
uint8_t mpu6050_get_iic_group_order (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, mpu6050_iic_group_order_t *order)
 get the iic group order More...
 
uint8_t mpu6050_set_iic_transferred_len (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t len)
 set the iic transferred length More...
 
uint8_t mpu6050_get_iic_transferred_len (mpu6050_handle_t *handle, mpu6050_iic_slave_t slave, uint8_t *len)
 get the iic transferred length More...
 
uint8_t mpu6050_get_iic_status (mpu6050_handle_t *handle, uint8_t *status)
 get the iic status More...
 
uint8_t mpu6050_set_iic_delay_enable (mpu6050_handle_t *handle, mpu6050_iic_delay_t delay, mpu6050_bool_t enable)
 enable or disable the iic delay More...
 
uint8_t mpu6050_get_iic_delay_enable (mpu6050_handle_t *handle, mpu6050_iic_delay_t delay, mpu6050_bool_t *enable)
 get the iic delay status More...
 
uint8_t mpu6050_set_iic4_enable (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the iic4 More...
 
uint8_t mpu6050_get_iic4_enable (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the iic4 status More...
 
uint8_t mpu6050_set_iic4_interrupt (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the iic4 interrupt More...
 
uint8_t mpu6050_get_iic4_interrupt (mpu6050_handle_t *handle, mpu6050_bool_t *enable)
 get the iic4 interrupt status More...
 
uint8_t mpu6050_set_iic4_transaction_mode (mpu6050_handle_t *handle, mpu6050_iic4_transaction_mode_t mode)
 set the iic4 transaction mode More...
 
uint8_t mpu6050_get_iic4_transaction_mode (mpu6050_handle_t *handle, mpu6050_iic4_transaction_mode_t *mode)
 get the iic4 transaction mode More...
 
uint8_t mpu6050_set_iic_delay (mpu6050_handle_t *handle, uint8_t delay)
 set the iic delay More...
 
uint8_t mpu6050_get_iic_delay (mpu6050_handle_t *handle, uint8_t *delay)
 get the iic delay More...
 
uint8_t mpu6050_set_iic4_data_out (mpu6050_handle_t *handle, uint8_t data)
 set the iic4 data out More...
 
uint8_t mpu6050_get_iic4_data_out (mpu6050_handle_t *handle, uint8_t *data)
 get the iic4 data out More...
 
uint8_t mpu6050_set_iic4_data_in (mpu6050_handle_t *handle, uint8_t data)
 set the iic4 data in More...
 
uint8_t mpu6050_get_iic4_data_in (mpu6050_handle_t *handle, uint8_t *data)
 get the iic4 data in More...
 
uint8_t mpu6050_read_extern_sensor_data (mpu6050_handle_t *handle, uint8_t *data, uint8_t len)
 read the extern sensor data More...
 

Detailed Description

mpu6050 basic driver modules

Enumeration Type Documentation

◆ mpu6050_accelerometer_range_t

mpu6050 accelerometer range enumeration definition

Enumerator
MPU6050_ACCELEROMETER_RANGE_2G 

±2 g

MPU6050_ACCELEROMETER_RANGE_4G 

±4 g

MPU6050_ACCELEROMETER_RANGE_8G 

±8 g

MPU6050_ACCELEROMETER_RANGE_16G 

±16 g

◆ mpu6050_address_t

mpu6050 address enumeration definition

Enumerator
MPU6050_ADDRESS_AD0_LOW 

AD0 pin set LOW

MPU6050_ADDRESS_AD0_HIGH 

AD0 pin set HIGH

◆ mpu6050_axis_t

mpu6050 axis enumeration definition

Enumerator
MPU6050_AXIS_Z 

z

MPU6050_AXIS_Y 

y

MPU6050_AXIS_X 

x

◆ mpu6050_bool_t

mpu6050 bool enumeration definition

Enumerator
MPU6050_BOOL_FALSE 

disable function

MPU6050_BOOL_TRUE 

enable function

◆ mpu6050_clock_source_t

mpu6050 clock source enumeration definition

Enumerator
MPU6050_CLOCK_SOURCE_INTERNAL_8MHZ 

internal 8MHz

MPU6050_CLOCK_SOURCE_PLL_X_GYRO 

pll with x axis gyroscope reference

MPU6050_CLOCK_SOURCE_PLL_Y_GYRO 

pll with y axis gyroscope reference

MPU6050_CLOCK_SOURCE_PLL_Z_GYRO 

pll with z axis gyroscope reference

MPU6050_CLOCK_SOURCE_PLL_EXT_32P768_KHZ 

pll extern 32.768 KHz

MPU6050_CLOCK_SOURCE_PLL_EXT_19P2_MHZ 

pll extern 19.2 MHz

MPU6050_CLOCK_SOURCE_STOP_CLOCK 

stop the clock

◆ mpu6050_extern_sync_t

mpu6050 extern sync enumeration definition

Enumerator
MPU6050_EXTERN_SYNC_INPUT_DISABLED 

input disabled

MPU6050_EXTERN_SYNC_TEMP_OUT_L 

temp out low

MPU6050_EXTERN_SYNC_GYRO_XOUT_L 

gyro xout low

MPU6050_EXTERN_SYNC_GYRO_YOUT_L 

gyro yout low

MPU6050_EXTERN_SYNC_GYRO_ZOUT_L 

gyro zout low

MPU6050_EXTERN_SYNC_ACCEL_XOUT_L 

accel xout low

MPU6050_EXTERN_SYNC_ACCEL_YOUT_L 

accel yout low

MPU6050_EXTERN_SYNC_ACCEL_ZOUT_L 

accel zout low

◆ mpu6050_fifo_t

mpu6050 fifo enumeration definition

Enumerator
MPU6050_FIFO_TEMP 

temperature

MPU6050_FIFO_XG 

gyroscope x

MPU6050_FIFO_YG 

gyroscope y

MPU6050_FIFO_ZG 

gyroscope z

MPU6050_FIFO_ACCEL 

accelerometer

◆ mpu6050_gyroscope_range_t

mpu6050 gyroscope range enumeration definition

Enumerator
MPU6050_GYROSCOPE_RANGE_250DPS 

±250 dps

MPU6050_GYROSCOPE_RANGE_500DPS 

±500 dps

MPU6050_GYROSCOPE_RANGE_1000DPS 

±1000 dps

MPU6050_GYROSCOPE_RANGE_2000DPS 

±2000 dps

◆ mpu6050_iic4_transaction_mode_t

mpu6050 iic4 transaction mode enumeration definition

Enumerator
MPU6050_IIC4_TRANSACTION_MODE_DATA 

data only

MPU6050_IIC4_TRANSACTION_MODE_REG 

register only

◆ mpu6050_iic_clock_t

mpu6050 iic clock enumeration definition

Enumerator
MPU6050_IIC_CLOCK_348_KHZ 

348 kHz

MPU6050_IIC_CLOCK_333_KHZ 

333 kHz

MPU6050_IIC_CLOCK_320_KHZ 

320 kHz

MPU6050_IIC_CLOCK_308_KHZ 

308 kHz

MPU6050_IIC_CLOCK_296_KHZ 

296 kHz

MPU6050_IIC_CLOCK_286_KHZ 

286 kHz

MPU6050_IIC_CLOCK_276_KHZ 

276 kHz

MPU6050_IIC_CLOCK_267_KHZ 

267 kHz

MPU6050_IIC_CLOCK_258_KHZ 

258 kHz

MPU6050_IIC_CLOCK_500_KHZ 

500 kHz

MPU6050_IIC_CLOCK_471_KHZ 

471 kHz

MPU6050_IIC_CLOCK_444_KHZ 

444 kHz

MPU6050_IIC_CLOCK_421_KHZ 

421 kHz

MPU6050_IIC_CLOCK_400_KHZ 

400 kHz

MPU6050_IIC_CLOCK_381_KHZ 

381 kHz

MPU6050_IIC_CLOCK_364_KHZ 

364 kHz

◆ mpu6050_iic_delay_t

mpu6050 iic delay enumeration definition

Enumerator
MPU6050_IIC_DELAY_ES_SHADOW 

delays shadowing of external sensor data until all data has been received

MPU6050_IIC_DELAY_SLAVE_4 

slave 4

MPU6050_IIC_DELAY_SLAVE_3 

slave 3

MPU6050_IIC_DELAY_SLAVE_2 

slave 2

MPU6050_IIC_DELAY_SLAVE_1 

slave 1

MPU6050_IIC_DELAY_SLAVE_0 

slave 0

◆ mpu6050_iic_group_order_t

mpu6050 iic group order enumeration definition

Enumerator
MPU6050_IIC_GROUP_ORDER_EVEN 

when cleared to 0, bytes from register addresses 0 and 1, 2 and 3, etc (even, then odd register addresses) are paired to form a word.

MPU6050_IIC_GROUP_ORDER_ODD 

when set to 1, bytes from register addresses are paired 1 and 2, 3 and 4, etc. (odd, then even register addresses) are paired to form a word.

◆ mpu6050_iic_mode_t

mpu6050 iic mode enumeration definition

Enumerator
MPU6050_IIC_MODE_WRITE 

write

MPU6050_IIC_MODE_READ 

read

◆ mpu6050_iic_read_mode_t

mpu6050 iic read mode enumeration definition

Enumerator
MPU6050_IIC_READ_MODE_RESTART 

restart

MPU6050_IIC_READ_MODE_STOP_AND_START 

stop and start

◆ mpu6050_iic_slave_t

mpu6050 iic slave enumeration definition

Enumerator
MPU6050_IIC_SLAVE_0 

slave0

MPU6050_IIC_SLAVE_1 

slave1

MPU6050_IIC_SLAVE_2 

slave2

MPU6050_IIC_SLAVE_3 

slave3

MPU6050_IIC_SLAVE_4 

slave4

◆ mpu6050_iic_status_t

mpu6050 iic status enumeration definition

Enumerator
MPU6050_IIC_STATUS_PASS_THROUGH 

pass through

MPU6050_IIC_STATUS_IIC_SLV4_DONE 

slave4 done

MPU6050_IIC_STATUS_IIC_LOST_ARB 

lost arbitration

MPU6050_IIC_STATUS_IIC_SLV4_NACK 

slave4 nack

MPU6050_IIC_STATUS_IIC_SLV3_NACK 

slave3 nack

MPU6050_IIC_STATUS_IIC_SLV2_NACK 

slave2 nack

MPU6050_IIC_STATUS_IIC_SLV1_NACK 

slave1 nack

MPU6050_IIC_STATUS_IIC_SLV0_NACK 

slave0 nack

◆ mpu6050_iic_transaction_mode_t

mpu6050 iic transaction mode enumeration definition

Enumerator
MPU6050_IIC_TRANSACTION_MODE_DATA 

data only

MPU6050_IIC_TRANSACTION_MODE_REG_DATA 

write a register address prior to reading or writing data

◆ mpu6050_interrupt_t

mpu6050 interrupt enumeration definition

Enumerator
MPU6050_INTERRUPT_MOTION 

motion

MPU6050_INTERRUPT_FIFO_OVERFLOW 

fifo overflow

MPU6050_INTERRUPT_I2C_MAST 

i2c master

MPU6050_INTERRUPT_DMP 

dmp

MPU6050_INTERRUPT_DATA_READY 

data ready

◆ mpu6050_low_pass_filter_t

mpu6050 low pass filter enumeration definition

Enumerator
MPU6050_LOW_PASS_FILTER_0 

bandwidth(Hz) fs(KHz) delay(ms) bandwidth(Hz) fs(KHz) delay(ms) 260 1 0 256 8 0.98

MPU6050_LOW_PASS_FILTER_1 

184 1 2.0 188 1 1.9

MPU6050_LOW_PASS_FILTER_2 

94 1 3.0 98 1 2.8

MPU6050_LOW_PASS_FILTER_3 

44 1 4.9 42 1 4.8

MPU6050_LOW_PASS_FILTER_4 

21 1 8.5 20 1 8.3

MPU6050_LOW_PASS_FILTER_5 

10 1 13.8 10 1 13.4

MPU6050_LOW_PASS_FILTER_6 

5 1 19.0 5 1 18.6

◆ mpu6050_pin_level_t

mpu6050 pin level enumeration definition

Enumerator
MPU6050_PIN_LEVEL_HIGH 

active low

MPU6050_PIN_LEVEL_LOW 

active high

◆ mpu6050_pin_type_t

mpu6050 pin type enumeration definition

Enumerator
MPU6050_PIN_TYPE_PUSH_PULL 

push pull

MPU6050_PIN_TYPE_OPEN_DRAIN 

open drain

◆ mpu6050_signal_path_reset_t

mpu6050 signal path reset enumeration definition

Enumerator
MPU6050_SIGNAL_PATH_RESET_TEMP 

temperature sensor analog and digital signal paths

MPU6050_SIGNAL_PATH_RESET_ACCEL 

accelerometer analog and digital signal paths

MPU6050_SIGNAL_PATH_RESET_GYRO 

gyroscope analog and digital signal paths

◆ mpu6050_source_t

mpu6050 source enumeration definition

Enumerator
MPU6050_SOURCE_ACC_X 

accelerometer x

MPU6050_SOURCE_ACC_Y 

accelerometer y

MPU6050_SOURCE_ACC_Z 

accelerometer z

MPU6050_SOURCE_GYRO_X 

gyroscope x

MPU6050_SOURCE_GYRO_Y 

gyroscope y

MPU6050_SOURCE_GYRO_Z 

gyroscope z

◆ mpu6050_wake_up_frequency_t

mpu6050 wake up frequency enumeration definition

Enumerator
MPU6050_WAKE_UP_FREQUENCY_1P25_HZ 

1.25Hz

MPU6050_WAKE_UP_FREQUENCY_5_HZ 

5Hz

MPU6050_WAKE_UP_FREQUENCY_20_HZ 

20Hz

MPU6050_WAKE_UP_FREQUENCY_40_HZ 

40Hz

Function Documentation

◆ mpu6050_deinit()

uint8_t mpu6050_deinit ( mpu6050_handle_t handle)

close the chip

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 iic deinit failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 enter sleep mode failed
Note
none

◆ mpu6050_device_reset()

uint8_t mpu6050_device_reset ( mpu6050_handle_t handle)

reset the chip

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 device reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_fifo_get()

uint8_t mpu6050_fifo_get ( mpu6050_handle_t handle,
uint8_t *  buf,
uint16_t  len 
)

fifo read bytes

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*bufpointer to a data buffer
[in]lenbuffer length
Returns
status code
  • 0 success
  • 1 fifo read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_fifo_reset()

uint8_t mpu6050_fifo_reset ( mpu6050_handle_t handle)

reset the fifo

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 fifo reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_fifo_set()

uint8_t mpu6050_fifo_set ( mpu6050_handle_t handle,
uint8_t *  buf,
uint16_t  len 
)

fifo write bytes

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]*bufpointer to a data buffer
[in]lenbuffer length
Returns
status code
  • 0 success
  • 1 fifo write failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_force_fifo_reset()

uint8_t mpu6050_force_fifo_reset ( mpu6050_handle_t handle)

force reset the fifo

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 force fifo reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_accelerometer_range()

uint8_t mpu6050_get_accelerometer_range ( mpu6050_handle_t handle,
mpu6050_accelerometer_range_t range 
)

get the accelerometer range

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*rangepointer to an accelerometer range buffer
Returns
status code
  • 0 success
  • 1 get accelerometer range failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_accelerometer_test()

uint8_t mpu6050_get_accelerometer_test ( mpu6050_handle_t handle,
mpu6050_axis_t  axis,
mpu6050_bool_t enable 
)

get the accelerometer test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]axistested axis
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get accelerometer test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_accelerometer_x_test()

uint8_t mpu6050_get_accelerometer_x_test ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the accelerometer x test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get accelerometer x test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_accelerometer_y_test()

uint8_t mpu6050_get_accelerometer_y_test ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the accelerometer y test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get accelerometer y test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_accelerometer_z_test()

uint8_t mpu6050_get_accelerometer_z_test ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the accelerometer z test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get accelerometer z test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_addr_pin()

uint8_t mpu6050_get_addr_pin ( mpu6050_handle_t handle,
mpu6050_address_t addr_pin 
)

get the chip address pin

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*addr_pinpointer to a chip address pin buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

◆ mpu6050_get_clock_source()

uint8_t mpu6050_get_clock_source ( mpu6050_handle_t handle,
mpu6050_clock_source_t clock_source 
)

get the chip clock source

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*clock_sourcepointer to a clock source buffer
Returns
status code
  • 0 success
  • 1 get clock source failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_cycle_wake_up()

uint8_t mpu6050_get_cycle_wake_up ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the cycle wake up mode status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get cycle wake up failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_device_reset()

uint8_t mpu6050_get_device_reset ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the device reset status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get device reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_extern_sync()

uint8_t mpu6050_get_extern_sync ( mpu6050_handle_t handle,
mpu6050_extern_sync_t sync 
)

get the extern sync type

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*syncpointer to an extern sync type buffer
Returns
status code
  • 0 success
  • 1 get extern sync failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_fifo()

uint8_t mpu6050_get_fifo ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the fifo status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get fifo failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_fifo_count()

uint8_t mpu6050_get_fifo_count ( mpu6050_handle_t handle,
uint16_t *  count 
)

get the fifo counter value

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*countpointer to a fifo count buffer
Returns
status code
  • 0 success
  • 1 get fifo count failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_fifo_enable()

uint8_t mpu6050_get_fifo_enable ( mpu6050_handle_t handle,
mpu6050_fifo_t  fifo,
mpu6050_bool_t enable 
)

get the fifo function status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]fifofifo type
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get fifo enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_fifo_reset()

uint8_t mpu6050_get_fifo_reset ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the fifo reset status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get fifo reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_fsync_interrupt()

uint8_t mpu6050_get_fsync_interrupt ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the fsync interrupt status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get fsync interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_fsync_interrupt_level()

uint8_t mpu6050_get_fsync_interrupt_level ( mpu6050_handle_t handle,
mpu6050_pin_level_t level 
)

get the fsync interrupt level

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*levelpointer to a set level buffer
Returns
status code
  • 0 success
  • 1 get fsync interrupt level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_gyroscope_range()

uint8_t mpu6050_get_gyroscope_range ( mpu6050_handle_t handle,
mpu6050_gyroscope_range_t range 
)

get the gyroscope range

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*rangepointer to a gyroscope range buffer
Returns
status code
  • 0 success
  • 1 get gyroscope range failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_gyroscope_test()

uint8_t mpu6050_get_gyroscope_test ( mpu6050_handle_t handle,
mpu6050_axis_t  axis,
mpu6050_bool_t enable 
)

get the gyroscope test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]axistested axis
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get gyroscope test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_gyroscope_x_test()

uint8_t mpu6050_get_gyroscope_x_test ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the gyroscope x test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get gyroscope x test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_gyroscope_y_test()

uint8_t mpu6050_get_gyroscope_y_test ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the gyroscope y test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get gyroscope y test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_gyroscope_z_test()

uint8_t mpu6050_get_gyroscope_z_test ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the gyroscope z test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get gyroscope z test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic4_data_in()

uint8_t mpu6050_get_iic4_data_in ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the iic4 data in

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get iic4 data in failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic4_data_out()

uint8_t mpu6050_get_iic4_data_out ( mpu6050_handle_t handle,
uint8_t *  data 
)

get the iic4 data out

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get iic4 data out failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic4_enable()

uint8_t mpu6050_get_iic4_enable ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the iic4 status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic4 enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic4_interrupt()

uint8_t mpu6050_get_iic4_interrupt ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the iic4 interrupt status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic4 interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic4_transaction_mode()

uint8_t mpu6050_get_iic4_transaction_mode ( mpu6050_handle_t handle,
mpu6050_iic4_transaction_mode_t mode 
)

get the iic4 transaction mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*modepointer to a transaction mode buffer
Returns
status code
  • 0 success
  • 1 get iic4 transaction mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_address()

uint8_t mpu6050_get_iic_address ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t *  addr_7bit 
)

get the iic address

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*addr_7bitpointer to an iic address buffer
Returns
status code
  • 0 success
  • 1 get iic address failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_bypass()

uint8_t mpu6050_get_iic_bypass ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the iic bypass status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic bypass failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_byte_swap()

uint8_t mpu6050_get_iic_byte_swap ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_bool_t enable 
)

get the iic byte swap status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic byte swap failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_clock()

uint8_t mpu6050_get_iic_clock ( mpu6050_handle_t handle,
mpu6050_iic_clock_t clk 
)

get the iic clock

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*clkpointer to an iic clock buffer
Returns
status code
  • 0 success
  • 1 get iic clock failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_data_out()

uint8_t mpu6050_get_iic_data_out ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t *  data 
)

get the iic data out

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*datapointer to a set data buffer
Returns
status code
  • 0 success
  • 1 get iic data out failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_delay()

uint8_t mpu6050_get_iic_delay ( mpu6050_handle_t handle,
uint8_t *  delay 
)

get the iic delay

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*delaypointer to an iic delay buffer
Returns
status code
  • 0 success
  • 1 get iic delay failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_delay_enable()

uint8_t mpu6050_get_iic_delay_enable ( mpu6050_handle_t handle,
mpu6050_iic_delay_t  delay,
mpu6050_bool_t enable 
)

get the iic delay status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]delayiic delay
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic delay enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_enable()

uint8_t mpu6050_get_iic_enable ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_bool_t enable 
)

get the iic status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_fifo_enable()

uint8_t mpu6050_get_iic_fifo_enable ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_bool_t enable 
)

get the iic fifo status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic fifo enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_group_order()

uint8_t mpu6050_get_iic_group_order ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_iic_group_order_t order 
)

get the iic group order

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*orderpointer to a group order buffer
Returns
status code
  • 0 success
  • 1 get iic group order failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_master()

uint8_t mpu6050_get_iic_master ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the iic master status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic master failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_master_reset()

uint8_t mpu6050_get_iic_master_reset ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the iic master reset status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic master reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_mode()

uint8_t mpu6050_get_iic_mode ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_iic_mode_t mode 
)

get the iic mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*modepointer to an iic mode buffer
Returns
status code
  • 0 success
  • 1 get iic mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_multi_master()

uint8_t mpu6050_get_iic_multi_master ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the iic multi master status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic multi master failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_read_mode()

uint8_t mpu6050_get_iic_read_mode ( mpu6050_handle_t handle,
mpu6050_iic_read_mode_t mode 
)

get the iic read mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*modepointer to a read mode buffer
Returns
status code
  • 0 success
  • 1 get iic read mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_register()

uint8_t mpu6050_get_iic_register ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t *  reg 
)

get the iic register

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*regpointer to an iic register buffer
Returns
status code
  • 0 success
  • 1 get iic register failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_status()

uint8_t mpu6050_get_iic_status ( mpu6050_handle_t handle,
uint8_t *  status 
)

get the iic status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get iic status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_iic_transaction_mode()

uint8_t mpu6050_get_iic_transaction_mode ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_iic_transaction_mode_t mode 
)

get the iic transaction mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*modepointer to an iic transaction mode buffer
Returns
status code
  • 0 success
  • 1 get iic transaction mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_transferred_len()

uint8_t mpu6050_get_iic_transferred_len ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t *  len 
)

get the iic transferred length

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[out]*lenpointer to an iic transferred length buffer
Returns
status code
  • 0 success
  • 1 get iic transferred len failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_get_iic_wait_for_external_sensor()

uint8_t mpu6050_get_iic_wait_for_external_sensor ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the iic wait for external sensor status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get iic wait for external sensor failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_interrupt()

uint8_t mpu6050_get_interrupt ( mpu6050_handle_t handle,
mpu6050_interrupt_t  type,
mpu6050_bool_t enable 
)

get the interrupt status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]typeset interrupt type
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_interrupt_latch()

uint8_t mpu6050_get_interrupt_latch ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the interrupt latch status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt latch failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_interrupt_level()

uint8_t mpu6050_get_interrupt_level ( mpu6050_handle_t handle,
mpu6050_pin_level_t level 
)

get the interrupt level

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*levelpointer to an interrupt level buffer
Returns
status code
  • 0 success
  • 1 get interrupt level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_interrupt_pin_type()

uint8_t mpu6050_get_interrupt_pin_type ( mpu6050_handle_t handle,
mpu6050_pin_type_t type 
)

get the interrupt pin type

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*typepointer to a pin type buffer
Returns
status code
  • 0 success
  • 1 get interrupt pin type failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_interrupt_read_clear()

uint8_t mpu6050_get_interrupt_read_clear ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the interrupt reading clear status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get interrupt read clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_interrupt_status()

uint8_t mpu6050_get_interrupt_status ( mpu6050_handle_t handle,
uint8_t *  status 
)

get the interrupt status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*statuspointer to a status buffer
Returns
status code
  • 0 success
  • 1 get interrupt status failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_low_pass_filter()

uint8_t mpu6050_get_low_pass_filter ( mpu6050_handle_t handle,
mpu6050_low_pass_filter_t filter 
)

get the low pass filter

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*filterpointer to a low pass filter buffer
Returns
status code
  • 0 success
  • 1 get low pass filter failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_motion_duration()

uint8_t mpu6050_get_motion_duration ( mpu6050_handle_t handle,
uint8_t *  duration 
)

get the motion duration

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*durationpointer to a duration buffer
Returns
status code
  • 0 success
  • 1 get motion duration failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_motion_threshold()

uint8_t mpu6050_get_motion_threshold ( mpu6050_handle_t handle,
uint8_t *  threshold 
)

get the motion_threshold

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*thresholdpointer to a threshold buffer
Returns
status code
  • 0 success
  • 1 get motion threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_sample_rate_divider()

uint8_t mpu6050_get_sample_rate_divider ( mpu6050_handle_t handle,
uint8_t *  d 
)

get the sample rate divider

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*dpointer to a sample rate divider buffer
Returns
status code
  • 0 success
  • 1 get sample rate divider failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_sensor_reset()

uint8_t mpu6050_get_sensor_reset ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the sensor reset status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get sensor reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_sleep()

uint8_t mpu6050_get_sleep ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the sleep status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_standby_mode()

uint8_t mpu6050_get_standby_mode ( mpu6050_handle_t handle,
mpu6050_source_t  source,
mpu6050_bool_t enable 
)

get the source mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]sourceinput source
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get standby mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_temperature_sensor()

uint8_t mpu6050_get_temperature_sensor ( mpu6050_handle_t handle,
mpu6050_bool_t enable 
)

get the temperature sensor status

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*enablepointer to a bool value buffer
Returns
status code
  • 0 success
  • 1 get temperature sensor failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_get_wake_up_frequency()

uint8_t mpu6050_get_wake_up_frequency ( mpu6050_handle_t handle,
mpu6050_wake_up_frequency_t frequency 
)

get the wake up frequency

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*frequencypointer to a wake up frequency buffer
Returns
status code
  • 0 success
  • 1 get wake up frequency failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_iic_master_reset()

uint8_t mpu6050_iic_master_reset ( mpu6050_handle_t handle)

reset the iic master controller

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 iic master reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_info()

uint8_t mpu6050_info ( mpu6050_info_t info)

get the chip's information

Parameters
[out]*infopointer to an mpu6050 info structure
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

◆ mpu6050_init()

uint8_t mpu6050_init ( mpu6050_handle_t handle)

initialize the chip

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 iic initialization failed
  • 2 handle is NULL
  • 3 linked functions is NULL
  • 4 reset failed
  • 5 id is invalid
Note
none

◆ mpu6050_irq_handler()

uint8_t mpu6050_irq_handler ( mpu6050_handle_t handle)

irq handler

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 run failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_motion_duration_convert_to_data()

uint8_t mpu6050_motion_duration_convert_to_data ( mpu6050_handle_t handle,
uint8_t  reg,
uint8_t *  ms 
)

convert the register raw data to the motion duration

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]regregister raw data
[out]*mspointer to a motion duration buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_motion_duration_convert_to_register()

uint8_t mpu6050_motion_duration_convert_to_register ( mpu6050_handle_t handle,
uint8_t  ms,
uint8_t *  reg 
)

convert the motion duration to the register raw data

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]msmotion duration
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_motion_threshold_convert_to_data()

uint8_t mpu6050_motion_threshold_convert_to_data ( mpu6050_handle_t handle,
uint8_t  reg,
float *  mg 
)

convert the register raw data to the motion threshold

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]regregister raw data
[out]*mgpointer to a motion threshold buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_motion_threshold_convert_to_register()

uint8_t mpu6050_motion_threshold_convert_to_register ( mpu6050_handle_t handle,
float  mg,
uint8_t *  reg 
)

convert the motion threshold to the register raw data

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]mgmotion threshold
[out]*regpointer to a register raw buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_read()

uint8_t mpu6050_read ( mpu6050_handle_t handle,
int16_t(*)  accel_raw[3],
float(*)  accel_g[3],
int16_t(*)  gyro_raw[3],
float(*)  gyro_dps[3],
uint16_t *  len 
)

read the data

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]**accel_rawpointer to an accel raw data buffer
[out]**accel_gpointer to a converted accel data buffer
[out]**gyro_rawpointer to a gyro raw data buffer
[out]**gyro_dpspointer to a converted gyro data buffer
[in,out]*lenpointer to a length buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 length is zero
  • 5 dmp is running
  • 6 fifo conf is error
Note
none

◆ mpu6050_read_extern_sensor_data()

uint8_t mpu6050_read_extern_sensor_data ( mpu6050_handle_t handle,
uint8_t *  data,
uint8_t  len 
)

read the extern sensor data

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*datapointer to a data buffer
[in]lendata length
Returns
status code
  • 0 success
  • 1 read extern sensor data failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 len > 24
Note
none

◆ mpu6050_read_temperature()

uint8_t mpu6050_read_temperature ( mpu6050_handle_t handle,
int16_t *  raw,
float *  degrees 
)

read the temperature

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*rawpointer to raw data buffer
[out]*degreespointer to a converted degrees data buffer
Returns
status code
  • 0 success
  • 1 read failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_self_test()

uint8_t mpu6050_self_test ( mpu6050_handle_t handle,
int32_t  gyro_offset_raw[3],
int32_t  accel_offset_raw[3] 
)

run the self test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*gyro_offset_rawpointer to a gyro offset raw buffer
[out]*accel_offset_rawpointer to an accel offset raw buffer
Returns
status code
  • 0 success
  • 1 self test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_sensor_reset()

uint8_t mpu6050_sensor_reset ( mpu6050_handle_t handle)

reset all sensors

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 sensor reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_accelerometer_range()

uint8_t mpu6050_set_accelerometer_range ( mpu6050_handle_t handle,
mpu6050_accelerometer_range_t  range 
)

set the accelerometer range

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]rangeaccelerometer range
Returns
status code
  • 0 success
  • 1 set accelerometer range failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_accelerometer_test()

uint8_t mpu6050_set_accelerometer_test ( mpu6050_handle_t handle,
mpu6050_axis_t  axis,
mpu6050_bool_t  enable 
)

set the accelerometer test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]axistested axis
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set accelerometer test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_accelerometer_x_test()

uint8_t mpu6050_set_accelerometer_x_test ( mpu6050_handle_t handle,
uint8_t  data 
)

set the accelerometer x test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set accelerometer x test failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 data is over 0x1F
Note
none

◆ mpu6050_set_accelerometer_y_test()

uint8_t mpu6050_set_accelerometer_y_test ( mpu6050_handle_t handle,
uint8_t  data 
)

set the accelerometer y test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set accelerometer y test failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 data is over 0x1F
Note
none

◆ mpu6050_set_accelerometer_z_test()

uint8_t mpu6050_set_accelerometer_z_test ( mpu6050_handle_t handle,
uint8_t  data 
)

set the accelerometer z test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set accelerometer z test failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 data is over 0x1F
Note
none

◆ mpu6050_set_addr_pin()

uint8_t mpu6050_set_addr_pin ( mpu6050_handle_t handle,
mpu6050_address_t  addr_pin 
)

set the chip address pin

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]addr_pinchip address pin
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

◆ mpu6050_set_clock_source()

uint8_t mpu6050_set_clock_source ( mpu6050_handle_t handle,
mpu6050_clock_source_t  clock_source 
)

set the chip clock source

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]clock_sourcechip main clock source
Returns
status code
  • 0 success
  • 1 set clock source failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_cycle_wake_up()

uint8_t mpu6050_set_cycle_wake_up ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the cycle wake up mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set cycle wake up failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_extern_sync()

uint8_t mpu6050_set_extern_sync ( mpu6050_handle_t handle,
mpu6050_extern_sync_t  sync 
)

set the extern sync type

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]syncextern sync type
Returns
status code
  • 0 success
  • 1 set extern sync failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_fifo()

uint8_t mpu6050_set_fifo ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable fifo

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set fifo failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_fifo_enable()

uint8_t mpu6050_set_fifo_enable ( mpu6050_handle_t handle,
mpu6050_fifo_t  fifo,
mpu6050_bool_t  enable 
)

enable or disable the fifo function

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]fifofifo type
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set fifo enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_force_accel_sample()

uint8_t mpu6050_set_force_accel_sample ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable force accel sample

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set force accel sample failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_fsync_interrupt()

uint8_t mpu6050_set_fsync_interrupt ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the fsync interrupt

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set fsync interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_fsync_interrupt_level()

uint8_t mpu6050_set_fsync_interrupt_level ( mpu6050_handle_t handle,
mpu6050_pin_level_t  level 
)

set the fsync interrupt level

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]levelset level
Returns
status code
  • 0 success
  • 1 set fsync interrupt level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_gyroscope_range()

uint8_t mpu6050_set_gyroscope_range ( mpu6050_handle_t handle,
mpu6050_gyroscope_range_t  range 
)

set the gyroscope range

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]rangegyroscope range
Returns
status code
  • 0 success
  • 1 set gyroscope range failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_gyroscope_test()

uint8_t mpu6050_set_gyroscope_test ( mpu6050_handle_t handle,
mpu6050_axis_t  axis,
mpu6050_bool_t  enable 
)

set the gyroscope test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]axistested axis
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set gyroscope test failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_gyroscope_x_test()

uint8_t mpu6050_set_gyroscope_x_test ( mpu6050_handle_t handle,
uint8_t  data 
)

set the gyroscope x test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set gyroscope x test failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 data is over 0x1F
Note
none

◆ mpu6050_set_gyroscope_y_test()

uint8_t mpu6050_set_gyroscope_y_test ( mpu6050_handle_t handle,
uint8_t  data 
)

set the gyroscope y test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set gyroscope y test failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 data is over 0x1F
Note
none

◆ mpu6050_set_gyroscope_z_test()

uint8_t mpu6050_set_gyroscope_z_test ( mpu6050_handle_t handle,
uint8_t  data 
)

set the gyroscope z test

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set gyroscope z test failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 data is over 0x1F
Note
none

◆ mpu6050_set_iic4_data_in()

uint8_t mpu6050_set_iic4_data_in ( mpu6050_handle_t handle,
uint8_t  data 
)

set the iic4 data in

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set iic4 data in failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic4_data_out()

uint8_t mpu6050_set_iic4_data_out ( mpu6050_handle_t handle,
uint8_t  data 
)

set the iic4 data out

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dataset data
Returns
status code
  • 0 success
  • 1 set iic4 data out failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic4_enable()

uint8_t mpu6050_set_iic4_enable ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the iic4

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic4 enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic4_interrupt()

uint8_t mpu6050_set_iic4_interrupt ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the iic4 interrupt

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic4 interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic4_transaction_mode()

uint8_t mpu6050_set_iic4_transaction_mode ( mpu6050_handle_t handle,
mpu6050_iic4_transaction_mode_t  mode 
)

set the iic4 transaction mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]modetransaction mode
Returns
status code
  • 0 success
  • 1 set iic4 transaction mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic_address()

uint8_t mpu6050_set_iic_address ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t  addr_7bit 
)

set the iic address

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]addr_7bitiic address
Returns
status code
  • 0 success
  • 1 set iic address failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_bypass()

uint8_t mpu6050_set_iic_bypass ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the iic bypass

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic bypass failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic_byte_swap()

uint8_t mpu6050_set_iic_byte_swap ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_bool_t  enable 
)

enable or disable the iic byte swap

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic byte swap failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_clock()

uint8_t mpu6050_set_iic_clock ( mpu6050_handle_t handle,
mpu6050_iic_clock_t  clk 
)

set the iic clock

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]clkiic clock
Returns
status code
  • 0 success
  • 1 set iic clock failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic_data_out()

uint8_t mpu6050_set_iic_data_out ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t  data 
)

set the iic data out

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]dataset data
Returns
status code
  • 0 success
  • 1 set iic data out failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_delay()

uint8_t mpu6050_set_iic_delay ( mpu6050_handle_t handle,
uint8_t  delay 
)

set the iic delay

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]delayiic delay
Returns
status code
  • 0 success
  • 1 set iic delay failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 delay > 0x1F
Note
none

◆ mpu6050_set_iic_delay_enable()

uint8_t mpu6050_set_iic_delay_enable ( mpu6050_handle_t handle,
mpu6050_iic_delay_t  delay,
mpu6050_bool_t  enable 
)

enable or disable the iic delay

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]delayiic delay
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic delay enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic_enable()

uint8_t mpu6050_set_iic_enable ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_bool_t  enable 
)

enable or disable the iic

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_fifo_enable()

uint8_t mpu6050_set_iic_fifo_enable ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_bool_t  enable 
)

enable or disable the iic fifo

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic fifo enable failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_group_order()

uint8_t mpu6050_set_iic_group_order ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_iic_group_order_t  order 
)

set the iic group order

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]ordergroup order
Returns
status code
  • 0 success
  • 1 set iic group order failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_master()

uint8_t mpu6050_set_iic_master ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the iic master mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic master failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic_mode()

uint8_t mpu6050_set_iic_mode ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_iic_mode_t  mode 
)

set the iic mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]modeiic mode
Returns
status code
  • 0 success
  • 1 set iic mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_multi_master()

uint8_t mpu6050_set_iic_multi_master ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable iic multi master

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic multi master failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic_read_mode()

uint8_t mpu6050_set_iic_read_mode ( mpu6050_handle_t handle,
mpu6050_iic_read_mode_t  mode 
)

set the iic read mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]moderead mode
Returns
status code
  • 0 success
  • 1 set iic read mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_iic_register()

uint8_t mpu6050_set_iic_register ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t  reg 
)

set the iic register

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]regiic register
Returns
status code
  • 0 success
  • 1 set iic register failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_transaction_mode()

uint8_t mpu6050_set_iic_transaction_mode ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
mpu6050_iic_transaction_mode_t  mode 
)

set the iic transaction mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]modeiic transaction mode
Returns
status code
  • 0 success
  • 1 set iic transaction mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
Note
none

◆ mpu6050_set_iic_transferred_len()

uint8_t mpu6050_set_iic_transferred_len ( mpu6050_handle_t handle,
mpu6050_iic_slave_t  slave,
uint8_t  len 
)

set the iic transferred length

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]slaveiic slave number
[in]leniic transferred length
Returns
status code
  • 0 success
  • 1 set iic transferred len failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 invalid slave
  • 5 len > 0xF
Note
none

◆ mpu6050_set_iic_wait_for_external_sensor()

uint8_t mpu6050_set_iic_wait_for_external_sensor ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable iic wait for external sensor

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set iic wait for external sensor failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_interrupt()

uint8_t mpu6050_set_interrupt ( mpu6050_handle_t handle,
mpu6050_interrupt_t  type,
mpu6050_bool_t  enable 
)

enable or disable the interrupt

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]typeset interrupt type
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_interrupt_latch()

uint8_t mpu6050_set_interrupt_latch ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the interrupt latch

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt latch failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_interrupt_level()

uint8_t mpu6050_set_interrupt_level ( mpu6050_handle_t handle,
mpu6050_pin_level_t  level 
)

set the interrupt level

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]levelinterrupt level
Returns
status code
  • 0 success
  • 1 set interrupt level failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_interrupt_pin_type()

uint8_t mpu6050_set_interrupt_pin_type ( mpu6050_handle_t handle,
mpu6050_pin_type_t  type 
)

set the interrupt pin type

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]typeinterrupt pin type
Returns
status code
  • 0 success
  • 1 set interrupt pin type failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_interrupt_read_clear()

uint8_t mpu6050_set_interrupt_read_clear ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the interrupt reading clear

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set interrupt read clear failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_low_pass_filter()

uint8_t mpu6050_set_low_pass_filter ( mpu6050_handle_t handle,
mpu6050_low_pass_filter_t  filter 
)

set the low pass filter

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]filterlow pass filter
Returns
status code
  • 0 success
  • 1 set low pass filter failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_motion_duration()

uint8_t mpu6050_set_motion_duration ( mpu6050_handle_t handle,
uint8_t  duration 
)

set the motion duration

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]durationset duration
Returns
status code
  • 0 success
  • 1 set motion duration failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_motion_threshold()

uint8_t mpu6050_set_motion_threshold ( mpu6050_handle_t handle,
uint8_t  threshold 
)

set the motion_threshold

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]thresholdset threshold
Returns
status code
  • 0 success
  • 1 set motion threshold failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_sample_rate_divider()

uint8_t mpu6050_set_sample_rate_divider ( mpu6050_handle_t handle,
uint8_t  d 
)

set the sample rate divider

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dsample rate divider
Returns
status code
  • 0 success
  • 1 set sample rate divider failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_signal_path_reset()

uint8_t mpu6050_set_signal_path_reset ( mpu6050_handle_t handle,
mpu6050_signal_path_reset_t  path 
)

set the signal path reset

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]pathsignal path
Returns
status code
  • 0 success
  • 1 set signal path reset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_sleep()

uint8_t mpu6050_set_sleep ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the sleep mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set sleep failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_standby_mode()

uint8_t mpu6050_set_standby_mode ( mpu6050_handle_t handle,
mpu6050_source_t  source,
mpu6050_bool_t  enable 
)

set source into standby mode

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]sourceinput source
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set standby mode failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_temperature_sensor()

uint8_t mpu6050_set_temperature_sensor ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the temperature sensor

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]enablebool value
Returns
status code
  • 0 success
  • 1 set temperature sensor failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

◆ mpu6050_set_wake_up_frequency()

uint8_t mpu6050_set_wake_up_frequency ( mpu6050_handle_t handle,
mpu6050_wake_up_frequency_t  frequency 
)

set the wake up frequency

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]frequencywake up frequency
Returns
status code
  • 0 success
  • 1 set wake up frequency failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none