LibDriver MPU9250
Loading...
Searching...
No Matches
mpu9250 basic driver function

mpu9250 basic driver modules More...

Collaboration diagram for mpu9250 basic driver function:

Data Structures

struct  mpu9250_handle_s
 mpu9250 handle structure definition More...
struct  mpu9250_info_s
 mpu9250 information structure definition More...

Typedefs

typedef struct mpu9250_handle_s mpu9250_handle_t
 mpu9250 handle structure definition
typedef struct mpu9250_info_s mpu9250_info_t
 mpu9250 information structure definition

Enumerations

enum  mpu9250_interface_t { MPU9250_INTERFACE_IIC = 0x00 , MPU9250_INTERFACE_SPI = 0x01 }
 mpu9250 interface enumeration definition More...
enum  mpu9250_address_t { MPU9250_ADDRESS_AD0_LOW = 0xD0 , MPU9250_ADDRESS_AD0_HIGH = 0xD2 }
 mpu9250 address enumeration definition More...
enum  mpu9250_bool_t { MPU9250_BOOL_FALSE = 0x00 , MPU9250_BOOL_TRUE = 0x01 }
 mpu9250 bool enumeration definition More...
enum  mpu9250_source_t {
  MPU9250_SOURCE_ACC_X = 0x05 , MPU9250_SOURCE_ACC_Y = 0x04 , MPU9250_SOURCE_ACC_Z = 0x03 , MPU9250_SOURCE_GYRO_X = 0x02 ,
  MPU9250_SOURCE_GYRO_Y = 0x01 , MPU9250_SOURCE_GYRO_Z = 0x00
}
 mpu9250 source enumeration definition More...
enum  mpu9250_clock_source_t { MPU9250_CLOCK_SOURCE_INTERNAL_20MHZ = 0x00 , MPU9250_CLOCK_SOURCE_PLL = 0x01 , MPU9250_CLOCK_SOURCE_STOP_CLOCK = 0x07 }
 mpu9250 clock source enumeration definition More...
enum  mpu9250_signal_path_reset_t { MPU9250_SIGNAL_PATH_RESET_TEMP = 0x00 , MPU9250_SIGNAL_PATH_RESET_ACCEL = 0x01 , MPU9250_SIGNAL_PATH_RESET_GYRO = 0x02 }
 mpu9250 signal path reset enumeration definition More...
enum  mpu9250_extern_sync_t {
  MPU9250_EXTERN_SYNC_INPUT_DISABLED = 0x00 , MPU9250_EXTERN_SYNC_TEMP_OUT_L = 0x01 , MPU9250_EXTERN_SYNC_GYRO_XOUT_L = 0x02 , MPU9250_EXTERN_SYNC_GYRO_YOUT_L = 0x03 ,
  MPU9250_EXTERN_SYNC_GYRO_ZOUT_L = 0x04 , MPU9250_EXTERN_SYNC_ACCEL_XOUT_L = 0x05 , MPU9250_EXTERN_SYNC_ACCEL_YOUT_L = 0x06 , MPU9250_EXTERN_SYNC_ACCEL_ZOUT_L = 0x07
}
 mpu9250 extern sync enumeration definition More...
enum  mpu9250_low_pass_filter_t {
  MPU9250_LOW_PASS_FILTER_0 = 0x00 , MPU9250_LOW_PASS_FILTER_1 = 0x01 , MPU9250_LOW_PASS_FILTER_2 = 0x02 , MPU9250_LOW_PASS_FILTER_3 = 0x03 ,
  MPU9250_LOW_PASS_FILTER_4 = 0x04 , MPU9250_LOW_PASS_FILTER_5 = 0x05 , MPU9250_LOW_PASS_FILTER_6 = 0x06 , MPU9250_LOW_PASS_FILTER_7 = 0x07
}
 mpu9250 low pass filter enumeration definition More...
enum  mpu9250_accelerometer_low_pass_filter_t {
  MPU9250_ACCELEROMETER_LOW_PASS_FILTER_0 = 0x00 , MPU9250_ACCELEROMETER_LOW_PASS_FILTER_1 = 0x01 , MPU9250_ACCELEROMETER_LOW_PASS_FILTER_2 = 0x02 , MPU9250_ACCELEROMETER_LOW_PASS_FILTER_3 = 0x03 ,
  MPU9250_ACCELEROMETER_LOW_PASS_FILTER_4 = 0x04 , MPU9250_ACCELEROMETER_LOW_PASS_FILTER_5 = 0x05 , MPU9250_ACCELEROMETER_LOW_PASS_FILTER_6 = 0x06 , MPU9250_ACCELEROMETER_LOW_PASS_FILTER_7 = 0x07
}
 mpu9250 accelerometer low pass filter enumeration definition More...
enum  mpu9250_low_power_accel_output_rate_t {
  MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_0P24 = 0x00 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_0P49 = 0x01 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_0P98 = 0x02 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_1P95 = 0x03 ,
  MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_3P91 = 0x04 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_7P81 = 0x05 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_15P63 = 0x06 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_31P25 = 0x07 ,
  MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_62P50 = 0x08 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_125 = 0x09 , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_250 = 0x0A , MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_500 = 0x0B
}
 mpu9250 low power accel output rate enumeration definition More...
enum  mpu9250_axis_t { MPU9250_AXIS_Z = 0x05 , MPU9250_AXIS_Y = 0x06 , MPU9250_AXIS_X = 0x07 }
 mpu9250 axis enumeration definition More...
enum  mpu9250_gyroscope_range_t { MPU9250_GYROSCOPE_RANGE_250DPS = 0x00 , MPU9250_GYROSCOPE_RANGE_500DPS = 0x01 , MPU9250_GYROSCOPE_RANGE_1000DPS = 0x02 , MPU9250_GYROSCOPE_RANGE_2000DPS = 0x03 }
 mpu9250 gyroscope range enumeration definition More...
enum  mpu9250_accelerometer_range_t { MPU9250_ACCELEROMETER_RANGE_2G = 0x00 , MPU9250_ACCELEROMETER_RANGE_4G = 0x01 , MPU9250_ACCELEROMETER_RANGE_8G = 0x02 , MPU9250_ACCELEROMETER_RANGE_16G = 0x03 }
 mpu9250 accelerometer range enumeration definition More...
enum  mpu9250_fifo_t {
  MPU9250_FIFO_TEMP = 0x07 , MPU9250_FIFO_XG = 0x06 , MPU9250_FIFO_YG = 0x05 , MPU9250_FIFO_ZG = 0x04 ,
  MPU9250_FIFO_ACCEL = 0x03
}
 mpu9250 fifo enumeration definition More...
enum  mpu9250_fifo_mode { MPU9250_FIFO_MODE_STREAM = 0x00 , MPU9250_FIFO_MODE_NORMAL = 0x01 }
 mpu9250 fifo mode enumeration definition More...
enum  mpu9250_pin_level_t { MPU9250_PIN_LEVEL_HIGH = 0x00 , MPU9250_PIN_LEVEL_LOW = 0x01 }
 mpu9250 pin level enumeration definition More...
enum  mpu9250_pin_type_t { MPU9250_PIN_TYPE_PUSH_PULL = 0x00 , MPU9250_PIN_TYPE_OPEN_DRAIN = 0x01 }
 mpu9250 pin type enumeration definition More...
enum  mpu9250_interrupt_t {
  MPU9250_INTERRUPT_MOTION = 6 , MPU9250_INTERRUPT_FIFO_OVERFLOW = 4 , MPU9250_INTERRUPT_FSYNC_INT = 3 , MPU9250_INTERRUPT_DMP = 1 ,
  MPU9250_INTERRUPT_DATA_READY = 0
}
 mpu9250 interrupt enumeration definition More...
enum  mpu9250_iic_slave_t {
  MPU9250_IIC_SLAVE_0 = 0x00 , MPU9250_IIC_SLAVE_1 = 0x01 , MPU9250_IIC_SLAVE_2 = 0x02 , MPU9250_IIC_SLAVE_3 = 0x03 ,
  MPU9250_IIC_SLAVE_4 = 0x04
}
 mpu9250 iic slave enumeration definition More...
enum  mpu9250_iic_clock_t {
  MPU9250_IIC_CLOCK_348_KHZ = 0x00 , MPU9250_IIC_CLOCK_333_KHZ = 0x01 , MPU9250_IIC_CLOCK_320_KHZ = 0x02 , MPU9250_IIC_CLOCK_308_KHZ = 0x03 ,
  MPU9250_IIC_CLOCK_296_KHZ = 0x04 , MPU9250_IIC_CLOCK_286_KHZ = 0x05 , MPU9250_IIC_CLOCK_276_KHZ = 0x06 , MPU9250_IIC_CLOCK_267_KHZ = 0x07 ,
  MPU9250_IIC_CLOCK_258_KHZ = 0x08 , MPU9250_IIC_CLOCK_500_KHZ = 0x09 , MPU9250_IIC_CLOCK_471_KHZ = 0x0A , MPU9250_IIC_CLOCK_444_KHZ = 0x0B ,
  MPU9250_IIC_CLOCK_421_KHZ = 0x0C , MPU9250_IIC_CLOCK_400_KHZ = 0x0D , MPU9250_IIC_CLOCK_381_KHZ = 0x0E , MPU9250_IIC_CLOCK_364_KHZ = 0x0F
}
 mpu9250 iic clock enumeration definition More...
enum  mpu9250_iic_read_mode_t { MPU9250_IIC_READ_MODE_RESTART = 0x00 , MPU9250_IIC_READ_MODE_STOP_AND_START = 0x01 }
 mpu9250 iic read mode enumeration definition More...
enum  mpu9250_iic_mode_t { MPU9250_IIC_MODE_WRITE = 0x00 , MPU9250_IIC_MODE_READ = 0x01 }
 mpu9250 iic mode enumeration definition More...
enum  mpu9250_iic_transaction_mode_t { MPU9250_IIC_TRANSACTION_MODE_DATA = 0x00 , MPU9250_IIC_TRANSACTION_MODE_REG_DATA = 0x01 }
 mpu9250 iic transaction mode enumeration definition More...
enum  mpu9250_iic4_transaction_mode_t { MPU9250_IIC4_TRANSACTION_MODE_DATA = 0x00 , MPU9250_IIC4_TRANSACTION_MODE_REG = 0x01 }
 mpu9250 iic4 transaction mode enumeration definition More...
enum  mpu9250_iic_group_order_t { MPU9250_IIC_GROUP_ORDER_EVEN = 0x00 , MPU9250_IIC_GROUP_ORDER_ODD = 0x01 }
 mpu9250 iic group order enumeration definition More...
enum  mpu9250_iic_status_t {
  MPU9250_IIC_STATUS_PASS_THROUGH = 0x80 , MPU9250_IIC_STATUS_IIC_SLV4_DONE = 0x40 , MPU9250_IIC_STATUS_IIC_LOST_ARB = 0x20 , MPU9250_IIC_STATUS_IIC_SLV4_NACK = 0x10 ,
  MPU9250_IIC_STATUS_IIC_SLV3_NACK = 0x08 , MPU9250_IIC_STATUS_IIC_SLV2_NACK = 0x04 , MPU9250_IIC_STATUS_IIC_SLV1_NACK = 0x02 , MPU9250_IIC_STATUS_IIC_SLV0_NACK = 0x01
}
 mpu9250 iic status enumeration definition More...
enum  mpu9250_iic_delay_t {
  MPU9250_IIC_DELAY_ES_SHADOW = 7 , MPU9250_IIC_DELAY_SLAVE_4 = 4 , MPU9250_IIC_DELAY_SLAVE_3 = 3 , MPU9250_IIC_DELAY_SLAVE_2 = 2 ,
  MPU9250_IIC_DELAY_SLAVE_1 = 1 , MPU9250_IIC_DELAY_SLAVE_0 = 0
}
 mpu9250 iic delay enumeration definition More...

Functions

uint8_t mpu9250_info (mpu9250_info_t *info)
 get the chip's information
uint8_t mpu9250_set_interface (mpu9250_handle_t *handle, mpu9250_interface_t interface)
 set the chip interface
uint8_t mpu9250_get_interface (mpu9250_handle_t *handle, mpu9250_interface_t *interface)
 get the chip interface
uint8_t mpu9250_set_addr_pin (mpu9250_handle_t *handle, mpu9250_address_t addr_pin)
 set the chip address pin
uint8_t mpu9250_get_addr_pin (mpu9250_handle_t *handle, mpu9250_address_t *addr_pin)
 get the chip address pin
uint8_t mpu9250_irq_handler (mpu9250_handle_t *handle)
 irq handler
uint8_t mpu9250_init (mpu9250_handle_t *handle)
 initialize the chip
uint8_t mpu9250_deinit (mpu9250_handle_t *handle)
 close the chip
uint8_t mpu9250_read (mpu9250_handle_t *handle, int16_t(*accel_raw)[3], float(*accel_g)[3], int16_t(*gyro_raw)[3], float(*gyro_dps)[3], int16_t(*mag_raw)[3], float(*mag_ut)[3], uint16_t *len)
 read the data
uint8_t mpu9250_read_temperature (mpu9250_handle_t *handle, int16_t(*raw), float *degrees)
 read the temperature
uint8_t mpu9250_set_fifo (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable fifo
uint8_t mpu9250_get_fifo (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the fifo status
uint8_t mpu9250_force_fifo_reset (mpu9250_handle_t *handle)
 force reset the fifo
uint8_t mpu9250_set_iic_master (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the iic master mode
uint8_t mpu9250_get_iic_master (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic master status
uint8_t mpu9250_set_disable_iic_slave (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the iic slave mode
uint8_t mpu9250_get_disable_iic_slave (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic slave status
uint8_t mpu9250_fifo_reset (mpu9250_handle_t *handle)
 reset the fifo
uint8_t mpu9250_get_fifo_reset (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the fifo reset status
uint8_t mpu9250_iic_master_reset (mpu9250_handle_t *handle)
 reset the iic master controller
uint8_t mpu9250_get_iic_master_reset (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic master reset status
uint8_t mpu9250_sensor_reset (mpu9250_handle_t *handle)
 reset all sensors
uint8_t mpu9250_get_sensor_reset (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the sensor reset status
uint8_t mpu9250_device_reset (mpu9250_handle_t *handle)
 reset the chip
uint8_t mpu9250_get_device_reset (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the device reset status
uint8_t mpu9250_set_clock_source (mpu9250_handle_t *handle, mpu9250_clock_source_t clock_source)
 set the chip clock source
uint8_t mpu9250_get_clock_source (mpu9250_handle_t *handle, mpu9250_clock_source_t *clock_source)
 get the chip clock source
uint8_t mpu9250_set_ptat (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the temperature sensor
uint8_t mpu9250_get_ptat (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the temperature sensor status
uint8_t mpu9250_set_cycle_wake_up (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the cycle wake up mode
uint8_t mpu9250_get_cycle_wake_up (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the cycle wake up mode status
uint8_t mpu9250_set_sleep (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the sleep mode
uint8_t mpu9250_get_sleep (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the sleep status
uint8_t mpu9250_set_gyro_standby (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the gyro standby
uint8_t mpu9250_get_gyro_standby (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the gyro standby status
uint8_t mpu9250_set_standby_mode (mpu9250_handle_t *handle, mpu9250_source_t source, mpu9250_bool_t enable)
 set source into standby mode
uint8_t mpu9250_get_standby_mode (mpu9250_handle_t *handle, mpu9250_source_t source, mpu9250_bool_t *enable)
 get the source mode
uint8_t mpu9250_get_fifo_count (mpu9250_handle_t *handle, uint16_t *count)
 get the fifo counter value
uint8_t mpu9250_fifo_get (mpu9250_handle_t *handle, uint8_t *buf, uint16_t len)
 fifo read bytes
uint8_t mpu9250_fifo_set (mpu9250_handle_t *handle, uint8_t *buf, uint16_t len)
 fifo write bytes
uint8_t mpu9250_set_signal_path_reset (mpu9250_handle_t *handle, mpu9250_signal_path_reset_t path)
 set the signal path reset
uint8_t mpu9250_set_sample_rate_divider (mpu9250_handle_t *handle, uint8_t d)
 set the sample rate divider
uint8_t mpu9250_get_sample_rate_divider (mpu9250_handle_t *handle, uint8_t *d)
 get the sample rate divider
uint8_t mpu9250_set_extern_sync (mpu9250_handle_t *handle, mpu9250_extern_sync_t sync)
 set the extern sync type
uint8_t mpu9250_get_extern_sync (mpu9250_handle_t *handle, mpu9250_extern_sync_t *sync)
 get the extern sync type
uint8_t mpu9250_set_low_pass_filter (mpu9250_handle_t *handle, mpu9250_low_pass_filter_t filter)
 set the low pass filter
uint8_t mpu9250_get_low_pass_filter (mpu9250_handle_t *handle, mpu9250_low_pass_filter_t *filter)
 get the low pass filter
uint8_t mpu9250_set_fifo_mode (mpu9250_handle_t *handle, mpu9250_fifo_mode mode)
 set the fifo mode
uint8_t mpu9250_get_fifo_mode (mpu9250_handle_t *handle, mpu9250_fifo_mode *mode)
 get the fifo mode
uint8_t mpu9250_set_gyroscope_test (mpu9250_handle_t *handle, mpu9250_axis_t axis, mpu9250_bool_t enable)
 set the gyroscope test
uint8_t mpu9250_get_gyroscope_test (mpu9250_handle_t *handle, mpu9250_axis_t axis, mpu9250_bool_t *enable)
 get the gyroscope test
uint8_t mpu9250_set_gyroscope_range (mpu9250_handle_t *handle, mpu9250_gyroscope_range_t range)
 set the gyroscope range
uint8_t mpu9250_get_gyroscope_range (mpu9250_handle_t *handle, mpu9250_gyroscope_range_t *range)
 get the gyroscope range
uint8_t mpu9250_set_gyroscope_choice (mpu9250_handle_t *handle, uint8_t choice)
 set the gyroscope choice
uint8_t mpu9250_get_gyroscope_choice (mpu9250_handle_t *handle, uint8_t *choice)
 get the gyroscope choice
uint8_t mpu9250_set_accelerometer_test (mpu9250_handle_t *handle, mpu9250_axis_t axis, mpu9250_bool_t enable)
 set the accelerometer test
uint8_t mpu9250_get_accelerometer_test (mpu9250_handle_t *handle, mpu9250_axis_t axis, mpu9250_bool_t *enable)
 get the accelerometer test
uint8_t mpu9250_set_accelerometer_range (mpu9250_handle_t *handle, mpu9250_accelerometer_range_t range)
 set the accelerometer range
uint8_t mpu9250_get_accelerometer_range (mpu9250_handle_t *handle, mpu9250_accelerometer_range_t *range)
 get the accelerometer range
uint8_t mpu9250_set_fifo_1024kb (mpu9250_handle_t *handle)
 set fifo 1024kb
uint8_t mpu9250_set_accelerometer_choice (mpu9250_handle_t *handle, uint8_t choice)
 set the accelerometer choice
uint8_t mpu9250_get_accelerometer_choice (mpu9250_handle_t *handle, uint8_t *choice)
 get the accelerometer choice
uint8_t mpu9250_set_accelerometer_low_pass_filter (mpu9250_handle_t *handle, mpu9250_accelerometer_low_pass_filter_t filter)
 set the accelerometer low pass filter
uint8_t mpu9250_get_accelerometer_low_pass_filter (mpu9250_handle_t *handle, mpu9250_accelerometer_low_pass_filter_t *filter)
 get the accelerometer low pass filter
uint8_t mpu9250_set_low_power_accel_output_rate (mpu9250_handle_t *handle, mpu9250_low_power_accel_output_rate_t rate)
 set the low power accel output rate
uint8_t mpu9250_get_low_power_accel_output_rate (mpu9250_handle_t *handle, mpu9250_low_power_accel_output_rate_t *rate)
 get the low power accel output rate
uint8_t mpu9250_set_wake_on_motion (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable wake on motion
uint8_t mpu9250_get_wake_on_motion (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the wake on motion status
uint8_t mpu9250_set_accel_compare_with_previous_sample (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable accel compare with previous sample
uint8_t mpu9250_get_accel_compare_with_previous_sample (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the accel compare with previous sample status
uint8_t mpu9250_set_accelerometer_x_offset (mpu9250_handle_t *handle, int16_t offset)
 set the accelerometer x offset
uint8_t mpu9250_get_accelerometer_x_offset (mpu9250_handle_t *handle, int16_t *offset)
 get the accelerometer x offset
uint8_t mpu9250_set_accelerometer_y_offset (mpu9250_handle_t *handle, int16_t offset)
 set the accelerometer y offset
uint8_t mpu9250_get_accelerometer_y_offset (mpu9250_handle_t *handle, int16_t *offset)
 get the accelerometer y offset
uint8_t mpu9250_set_accelerometer_z_offset (mpu9250_handle_t *handle, int16_t offset)
 set the accelerometer z offset
uint8_t mpu9250_get_accelerometer_z_offset (mpu9250_handle_t *handle, int16_t *offset)
 get the accelerometer z offset
uint8_t mpu9250_accelerometer_offset_convert_to_register (mpu9250_handle_t *handle, float mg, int16_t *reg)
 convert the accelerometer offset to the register raw data
uint8_t mpu9250_accelerometer_offset_convert_to_data (mpu9250_handle_t *handle, int16_t reg, float *mg)
 convert the register raw data to the accelerometer offset
uint8_t mpu9250_set_gyro_x_offset (mpu9250_handle_t *handle, int16_t offset)
 set the gyro x offset
uint8_t mpu9250_get_gyro_x_offset (mpu9250_handle_t *handle, int16_t *offset)
 get the gyro x offset
uint8_t mpu9250_set_gyro_y_offset (mpu9250_handle_t *handle, int16_t offset)
 set the gyro y offset
uint8_t mpu9250_get_gyro_y_offset (mpu9250_handle_t *handle, int16_t *offset)
 get the gyro y offset
uint8_t mpu9250_set_gyro_z_offset (mpu9250_handle_t *handle, int16_t offset)
 set the gyro z offset
uint8_t mpu9250_get_gyro_z_offset (mpu9250_handle_t *handle, int16_t *offset)
 get the gyro z offset
uint8_t mpu9250_gyro_offset_convert_to_register (mpu9250_handle_t *handle, float dps, int16_t *reg)
 convert the gyro offset to the register raw data
uint8_t mpu9250_gyro_offset_convert_to_data (mpu9250_handle_t *handle, int16_t reg, float *dps)
 convert the register raw data to the gyro offset
uint8_t mpu9250_set_fifo_enable (mpu9250_handle_t *handle, mpu9250_fifo_t fifo, mpu9250_bool_t enable)
 enable or disable the fifo function
uint8_t mpu9250_get_fifo_enable (mpu9250_handle_t *handle, mpu9250_fifo_t fifo, mpu9250_bool_t *enable)
 get the fifo function status
uint8_t mpu9250_set_interrupt_level (mpu9250_handle_t *handle, mpu9250_pin_level_t level)
 set the interrupt level
uint8_t mpu9250_get_interrupt_level (mpu9250_handle_t *handle, mpu9250_pin_level_t *level)
 get the interrupt level
uint8_t mpu9250_set_interrupt_pin_type (mpu9250_handle_t *handle, mpu9250_pin_type_t type)
 set the interrupt pin type
uint8_t mpu9250_get_interrupt_pin_type (mpu9250_handle_t *handle, mpu9250_pin_type_t *type)
 get the interrupt pin type
uint8_t mpu9250_set_interrupt_latch (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the interrupt latch
uint8_t mpu9250_get_interrupt_latch (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the interrupt latch status
uint8_t mpu9250_set_interrupt_read_clear (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the interrupt reading clear
uint8_t mpu9250_get_interrupt_read_clear (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the interrupt reading clear status
uint8_t mpu9250_set_fsync_interrupt_level (mpu9250_handle_t *handle, mpu9250_pin_level_t level)
 set the fsync interrupt level
uint8_t mpu9250_get_fsync_interrupt_level (mpu9250_handle_t *handle, mpu9250_pin_level_t *level)
 get the fsync interrupt level
uint8_t mpu9250_set_fsync_interrupt (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the fsync interrupt
uint8_t mpu9250_get_fsync_interrupt (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the fsync interrupt status
uint8_t mpu9250_set_iic_bypass (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the iic bypass
uint8_t mpu9250_get_iic_bypass (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic bypass status
uint8_t mpu9250_set_interrupt (mpu9250_handle_t *handle, mpu9250_interrupt_t type, mpu9250_bool_t enable)
 enable or disable the interrupt
uint8_t mpu9250_get_interrupt (mpu9250_handle_t *handle, mpu9250_interrupt_t type, mpu9250_bool_t *enable)
 get the interrupt status
uint8_t mpu9250_get_interrupt_status (mpu9250_handle_t *handle, uint8_t *status)
 get the interrupt status
uint8_t mpu9250_set_gyroscope_x_test (mpu9250_handle_t *handle, uint8_t data)
 set the gyroscope x test
uint8_t mpu9250_get_gyroscope_x_test (mpu9250_handle_t *handle, uint8_t *data)
 get the gyroscope x test
uint8_t mpu9250_set_gyroscope_y_test (mpu9250_handle_t *handle, uint8_t data)
 set the gyroscope y test
uint8_t mpu9250_get_gyroscope_y_test (mpu9250_handle_t *handle, uint8_t *data)
 get the gyroscope y test
uint8_t mpu9250_set_gyroscope_z_test (mpu9250_handle_t *handle, uint8_t data)
 set the gyroscope z test
uint8_t mpu9250_get_gyroscope_z_test (mpu9250_handle_t *handle, uint8_t *data)
 get the gyroscope z test
uint8_t mpu9250_set_accelerometer_x_test (mpu9250_handle_t *handle, uint8_t data)
 set the accelerometer x test
uint8_t mpu9250_get_accelerometer_x_test (mpu9250_handle_t *handle, uint8_t *data)
 get the accelerometer x test
uint8_t mpu9250_set_accelerometer_y_test (mpu9250_handle_t *handle, uint8_t data)
 set the accelerometer y test
uint8_t mpu9250_get_accelerometer_y_test (mpu9250_handle_t *handle, uint8_t *data)
 get the accelerometer y test
uint8_t mpu9250_set_accelerometer_z_test (mpu9250_handle_t *handle, uint8_t data)
 set the accelerometer z test
uint8_t mpu9250_get_accelerometer_z_test (mpu9250_handle_t *handle, uint8_t *data)
 get the accelerometer z test
uint8_t mpu9250_set_motion_threshold (mpu9250_handle_t *handle, uint8_t threshold)
 set the motion_threshold
uint8_t mpu9250_get_motion_threshold (mpu9250_handle_t *handle, uint8_t *threshold)
 get the motion_threshold
uint8_t mpu9250_motion_threshold_convert_to_register (mpu9250_handle_t *handle, float mg, uint8_t *reg)
 convert the motion threshold to the register raw data
uint8_t mpu9250_motion_threshold_convert_to_data (mpu9250_handle_t *handle, uint8_t reg, float *mg)
 convert the register raw data to the motion threshold
uint8_t mpu9250_self_test (mpu9250_handle_t *handle, int32_t gyro_offset_raw[3], int32_t accel_offset_raw[3])
 run the self test
uint8_t mpu9250_set_iic_clock (mpu9250_handle_t *handle, mpu9250_iic_clock_t clk)
 set the iic clock
uint8_t mpu9250_get_iic_clock (mpu9250_handle_t *handle, mpu9250_iic_clock_t *clk)
 get the iic clock
uint8_t mpu9250_set_iic_multi_master (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable iic multi master
uint8_t mpu9250_get_iic_multi_master (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic multi master status
uint8_t mpu9250_set_iic_wait_for_external_sensor (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable iic wait for external sensor
uint8_t mpu9250_get_iic_wait_for_external_sensor (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic wait for external sensor status
uint8_t mpu9250_set_iic_read_mode (mpu9250_handle_t *handle, mpu9250_iic_read_mode_t mode)
 set the iic read mode
uint8_t mpu9250_get_iic_read_mode (mpu9250_handle_t *handle, mpu9250_iic_read_mode_t *mode)
 get the iic read mode
uint8_t mpu9250_set_iic_fifo_enable (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_bool_t enable)
 enable or disable the iic fifo
uint8_t mpu9250_get_iic_fifo_enable (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_bool_t *enable)
 get the iic fifo status
uint8_t mpu9250_set_iic_mode (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_iic_mode_t mode)
 set the iic mode
uint8_t mpu9250_get_iic_mode (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_iic_mode_t *mode)
 get the iic mode
uint8_t mpu9250_set_iic_address (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t addr_7bit)
 set the iic address
uint8_t mpu9250_get_iic_address (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t *addr_7bit)
 get the iic address
uint8_t mpu9250_set_iic_register (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t reg)
 set the iic register
uint8_t mpu9250_get_iic_register (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t *reg)
 get the iic register
uint8_t mpu9250_set_iic_data_out (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t data)
 set the iic data out
uint8_t mpu9250_get_iic_data_out (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t *data)
 get the iic data out
uint8_t mpu9250_set_iic_enable (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_bool_t enable)
 enable or disable the iic
uint8_t mpu9250_get_iic_enable (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_bool_t *enable)
 get the iic status
uint8_t mpu9250_set_iic_byte_swap (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_bool_t enable)
 enable or disable the iic byte swap
uint8_t mpu9250_get_iic_byte_swap (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_bool_t *enable)
 get the iic byte swap status
uint8_t mpu9250_set_iic_transaction_mode (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_iic_transaction_mode_t mode)
 set the iic transaction mode
uint8_t mpu9250_get_iic_transaction_mode (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_iic_transaction_mode_t *mode)
 get the iic transaction mode
uint8_t mpu9250_set_iic_group_order (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_iic_group_order_t order)
 set the iic group order
uint8_t mpu9250_get_iic_group_order (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, mpu9250_iic_group_order_t *order)
 get the iic group order
uint8_t mpu9250_set_iic_transferred_len (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t len)
 set the iic transferred length
uint8_t mpu9250_get_iic_transferred_len (mpu9250_handle_t *handle, mpu9250_iic_slave_t slave, uint8_t *len)
 get the iic transferred length
uint8_t mpu9250_get_iic_status (mpu9250_handle_t *handle, uint8_t *status)
 get the iic status
uint8_t mpu9250_set_iic_delay_enable (mpu9250_handle_t *handle, mpu9250_iic_delay_t delay, mpu9250_bool_t enable)
 enable or disable the iic delay
uint8_t mpu9250_get_iic_delay_enable (mpu9250_handle_t *handle, mpu9250_iic_delay_t delay, mpu9250_bool_t *enable)
 get the iic delay status
uint8_t mpu9250_set_iic4_enable (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the iic4
uint8_t mpu9250_get_iic4_enable (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic4 status
uint8_t mpu9250_set_iic4_interrupt (mpu9250_handle_t *handle, mpu9250_bool_t enable)
 enable or disable the iic4 interrupt
uint8_t mpu9250_get_iic4_interrupt (mpu9250_handle_t *handle, mpu9250_bool_t *enable)
 get the iic4 interrupt status
uint8_t mpu9250_set_iic4_transaction_mode (mpu9250_handle_t *handle, mpu9250_iic4_transaction_mode_t mode)
 set the iic4 transaction mode
uint8_t mpu9250_get_iic4_transaction_mode (mpu9250_handle_t *handle, mpu9250_iic4_transaction_mode_t *mode)
 get the iic4 transaction mode
uint8_t mpu9250_set_iic_delay (mpu9250_handle_t *handle, uint8_t delay)
 set the iic delay
uint8_t mpu9250_get_iic_delay (mpu9250_handle_t *handle, uint8_t *delay)
 get the iic delay
uint8_t mpu9250_set_iic4_data_out (mpu9250_handle_t *handle, uint8_t data)
 set the iic4 data out
uint8_t mpu9250_get_iic4_data_out (mpu9250_handle_t *handle, uint8_t *data)
 get the iic4 data out
uint8_t mpu9250_set_iic4_data_in (mpu9250_handle_t *handle, uint8_t data)
 set the iic4 data in
uint8_t mpu9250_get_iic4_data_in (mpu9250_handle_t *handle, uint8_t *data)
 get the iic4 data in
uint8_t mpu9250_read_extern_sensor_data (mpu9250_handle_t *handle, uint8_t *data, uint8_t len)
 read the extern sensor data

Detailed Description

mpu9250 basic driver modules

Typedef Documentation

◆ mpu9250_handle_t

mpu9250 handle structure definition

◆ mpu9250_info_t

mpu9250 information structure definition

Enumeration Type Documentation

◆ mpu9250_accelerometer_low_pass_filter_t

mpu9250 accelerometer low pass filter enumeration definition

Enumerator
MPU9250_ACCELEROMETER_LOW_PASS_FILTER_0 

3db BW(Hz) rate(KHz) delay(ms) 1 1046 4 0.503 0 218.1 1 1.88

MPU9250_ACCELEROMETER_LOW_PASS_FILTER_1 

0 218.1 1 1.88

MPU9250_ACCELEROMETER_LOW_PASS_FILTER_2 

0 99 1 2.88

MPU9250_ACCELEROMETER_LOW_PASS_FILTER_3 

0 44.8 1 4.88

MPU9250_ACCELEROMETER_LOW_PASS_FILTER_4 

0 21.2 1 8.87

MPU9250_ACCELEROMETER_LOW_PASS_FILTER_5 

0 10.2 1 16.83

MPU9250_ACCELEROMETER_LOW_PASS_FILTER_6 

0 5.05 1 32.48

MPU9250_ACCELEROMETER_LOW_PASS_FILTER_7 

0 420 1 1.38

Definition at line 154 of file driver_mpu9250.h.

◆ mpu9250_accelerometer_range_t

mpu9250 accelerometer range enumeration definition

Enumerator
MPU9250_ACCELEROMETER_RANGE_2G 

±2 g

MPU9250_ACCELEROMETER_RANGE_4G 

±4 g

MPU9250_ACCELEROMETER_RANGE_8G 

±8 g

MPU9250_ACCELEROMETER_RANGE_16G 

±16 g

Definition at line 210 of file driver_mpu9250.h.

◆ mpu9250_address_t

mpu9250 address enumeration definition

Enumerator
MPU9250_ADDRESS_AD0_LOW 

AD0 pin set LOW

MPU9250_ADDRESS_AD0_HIGH 

AD0 pin set HIGH

Definition at line 71 of file driver_mpu9250.h.

◆ mpu9250_axis_t

mpu9250 axis enumeration definition

Enumerator
MPU9250_AXIS_Z 

z

MPU9250_AXIS_Y 

y

MPU9250_AXIS_X 

x

Definition at line 189 of file driver_mpu9250.h.

◆ mpu9250_bool_t

mpu9250 bool enumeration definition

Enumerator
MPU9250_BOOL_FALSE 

disable function

MPU9250_BOOL_TRUE 

enable function

Definition at line 80 of file driver_mpu9250.h.

◆ mpu9250_clock_source_t

mpu9250 clock source enumeration definition

Enumerator
MPU9250_CLOCK_SOURCE_INTERNAL_20MHZ 

internal 20MHz

MPU9250_CLOCK_SOURCE_PLL 

pll reference

MPU9250_CLOCK_SOURCE_STOP_CLOCK 

stop the clock

Definition at line 102 of file driver_mpu9250.h.

◆ mpu9250_extern_sync_t

mpu9250 extern sync enumeration definition

Enumerator
MPU9250_EXTERN_SYNC_INPUT_DISABLED 

input disabled

MPU9250_EXTERN_SYNC_TEMP_OUT_L 

temp out low

MPU9250_EXTERN_SYNC_GYRO_XOUT_L 

gyro xout low

MPU9250_EXTERN_SYNC_GYRO_YOUT_L 

gyro yout low

MPU9250_EXTERN_SYNC_GYRO_ZOUT_L 

gyro zout low

MPU9250_EXTERN_SYNC_ACCEL_XOUT_L 

accel xout low

MPU9250_EXTERN_SYNC_ACCEL_YOUT_L 

accel yout low

MPU9250_EXTERN_SYNC_ACCEL_ZOUT_L 

accel zout low

Definition at line 122 of file driver_mpu9250.h.

◆ mpu9250_fifo_mode

mpu9250 fifo mode enumeration definition

Enumerator
MPU9250_FIFO_MODE_STREAM 

when the fifo is full, additional writes will be written to the fifo, replacing the oldest data

MPU9250_FIFO_MODE_NORMAL 

when the fifo is full, additional writes will not be written to fifo

Definition at line 233 of file driver_mpu9250.h.

◆ mpu9250_fifo_t

mpu9250 fifo enumeration definition

Enumerator
MPU9250_FIFO_TEMP 

temperature

MPU9250_FIFO_XG 

gyroscope x

MPU9250_FIFO_YG 

gyroscope y

MPU9250_FIFO_ZG 

gyroscope z

MPU9250_FIFO_ACCEL 

accelerometer

Definition at line 221 of file driver_mpu9250.h.

◆ mpu9250_gyroscope_range_t

mpu9250 gyroscope range enumeration definition

Enumerator
MPU9250_GYROSCOPE_RANGE_250DPS 

±250 dps

MPU9250_GYROSCOPE_RANGE_500DPS 

±500 dps

MPU9250_GYROSCOPE_RANGE_1000DPS 

±1000 dps

MPU9250_GYROSCOPE_RANGE_2000DPS 

±2000 dps

Definition at line 199 of file driver_mpu9250.h.

◆ mpu9250_iic4_transaction_mode_t

mpu9250 iic4 transaction mode enumeration definition

Enumerator
MPU9250_IIC4_TRANSACTION_MODE_DATA 

data only

MPU9250_IIC4_TRANSACTION_MODE_REG 

register only

Definition at line 335 of file driver_mpu9250.h.

◆ mpu9250_iic_clock_t

mpu9250 iic clock enumeration definition

Enumerator
MPU9250_IIC_CLOCK_348_KHZ 

348 kHz

MPU9250_IIC_CLOCK_333_KHZ 

333 kHz

MPU9250_IIC_CLOCK_320_KHZ 

320 kHz

MPU9250_IIC_CLOCK_308_KHZ 

308 kHz

MPU9250_IIC_CLOCK_296_KHZ 

296 kHz

MPU9250_IIC_CLOCK_286_KHZ 

286 kHz

MPU9250_IIC_CLOCK_276_KHZ 

276 kHz

MPU9250_IIC_CLOCK_267_KHZ 

267 kHz

MPU9250_IIC_CLOCK_258_KHZ 

258 kHz

MPU9250_IIC_CLOCK_500_KHZ 

500 kHz

MPU9250_IIC_CLOCK_471_KHZ 

471 kHz

MPU9250_IIC_CLOCK_444_KHZ 

444 kHz

MPU9250_IIC_CLOCK_421_KHZ 

421 kHz

MPU9250_IIC_CLOCK_400_KHZ 

400 kHz

MPU9250_IIC_CLOCK_381_KHZ 

381 kHz

MPU9250_IIC_CLOCK_364_KHZ 

364 kHz

Definition at line 285 of file driver_mpu9250.h.

◆ mpu9250_iic_delay_t

mpu9250 iic delay enumeration definition

Enumerator
MPU9250_IIC_DELAY_ES_SHADOW 

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

MPU9250_IIC_DELAY_SLAVE_4 

slave 4

MPU9250_IIC_DELAY_SLAVE_3 

slave 3

MPU9250_IIC_DELAY_SLAVE_2 

slave 2

MPU9250_IIC_DELAY_SLAVE_1 

slave 1

MPU9250_IIC_DELAY_SLAVE_0 

slave 0

Definition at line 370 of file driver_mpu9250.h.

◆ mpu9250_iic_group_order_t

mpu9250 iic group order enumeration definition

Enumerator
MPU9250_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

MPU9250_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

Definition at line 344 of file driver_mpu9250.h.

◆ mpu9250_iic_mode_t

mpu9250 iic mode enumeration definition

Enumerator
MPU9250_IIC_MODE_WRITE 

write

MPU9250_IIC_MODE_READ 

read

Definition at line 317 of file driver_mpu9250.h.

◆ mpu9250_iic_read_mode_t

mpu9250 iic read mode enumeration definition

Enumerator
MPU9250_IIC_READ_MODE_RESTART 

restart

MPU9250_IIC_READ_MODE_STOP_AND_START 

stop and start

Definition at line 308 of file driver_mpu9250.h.

◆ mpu9250_iic_slave_t

mpu9250 iic slave enumeration definition

Enumerator
MPU9250_IIC_SLAVE_0 

slave0

MPU9250_IIC_SLAVE_1 

slave1

MPU9250_IIC_SLAVE_2 

slave2

MPU9250_IIC_SLAVE_3 

slave3

MPU9250_IIC_SLAVE_4 

slave4

Definition at line 273 of file driver_mpu9250.h.

◆ mpu9250_iic_status_t

mpu9250 iic status enumeration definition

Enumerator
MPU9250_IIC_STATUS_PASS_THROUGH 

pass through

MPU9250_IIC_STATUS_IIC_SLV4_DONE 

slave4 done

MPU9250_IIC_STATUS_IIC_LOST_ARB 

lost arbitration

MPU9250_IIC_STATUS_IIC_SLV4_NACK 

slave4 nack

MPU9250_IIC_STATUS_IIC_SLV3_NACK 

slave3 nack

MPU9250_IIC_STATUS_IIC_SLV2_NACK 

slave2 nack

MPU9250_IIC_STATUS_IIC_SLV1_NACK 

slave1 nack

MPU9250_IIC_STATUS_IIC_SLV0_NACK 

slave0 nack

Definition at line 355 of file driver_mpu9250.h.

◆ mpu9250_iic_transaction_mode_t

mpu9250 iic transaction mode enumeration definition

Enumerator
MPU9250_IIC_TRANSACTION_MODE_DATA 

data only

MPU9250_IIC_TRANSACTION_MODE_REG_DATA 

write a register address prior to reading or writing data

Definition at line 326 of file driver_mpu9250.h.

◆ mpu9250_interface_t

mpu9250 interface enumeration definition

Enumerator
MPU9250_INTERFACE_IIC 

iic interface function

MPU9250_INTERFACE_SPI 

spi interface function

Definition at line 62 of file driver_mpu9250.h.

◆ mpu9250_interrupt_t

mpu9250 interrupt enumeration definition

Enumerator
MPU9250_INTERRUPT_MOTION 

motion

MPU9250_INTERRUPT_FIFO_OVERFLOW 

fifo overflow

MPU9250_INTERRUPT_FSYNC_INT 

fsync int

MPU9250_INTERRUPT_DMP 

dmp

MPU9250_INTERRUPT_DATA_READY 

data ready

Definition at line 261 of file driver_mpu9250.h.

◆ mpu9250_low_pass_filter_t

mpu9250 low pass filter enumeration definition

Enumerator
MPU9250_LOW_PASS_FILTER_0 

bandwidth(Hz) fs(KHz) delay(ms) bandwidth(Hz) delay(ms) 11/01 8800 32 0.064 4000 0.04 10 3600 32 0.11 4000 0.04 00 250 8 0.97 4000 0.04

MPU9250_LOW_PASS_FILTER_1 

00 184 1 2.9 188 1.9

MPU9250_LOW_PASS_FILTER_2 

00 92 1 3.9 98 2.8

MPU9250_LOW_PASS_FILTER_3 

00 41 1 5.9 42 4.8

MPU9250_LOW_PASS_FILTER_4 

00 20 1 9.9 20 8.3

MPU9250_LOW_PASS_FILTER_5 

00 10 1 17.85 10 13.4

MPU9250_LOW_PASS_FILTER_6 

00 5 1 33.48 5 18.6

MPU9250_LOW_PASS_FILTER_7 

00 3600 8 0.17 4000 0.04

Definition at line 137 of file driver_mpu9250.h.

◆ mpu9250_low_power_accel_output_rate_t

mpu9250 low power accel output rate enumeration definition

Enumerator
MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_0P24 

0.24Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_0P49 

0.49Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_0P98 

0.98Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_1P95 

1.95Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_3P91 

3.91Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_7P81 

7.81Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_15P63 

15.63Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_31P25 

31.25Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_62P50 

62.50Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_125 

125Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_250 

250Hz

MPU9250_LOW_POWER_ACCEL_OUTPUT_RATE_500 

500Hz

Definition at line 170 of file driver_mpu9250.h.

◆ mpu9250_pin_level_t

mpu9250 pin level enumeration definition

Enumerator
MPU9250_PIN_LEVEL_HIGH 

active low

MPU9250_PIN_LEVEL_LOW 

active high

Definition at line 243 of file driver_mpu9250.h.

◆ mpu9250_pin_type_t

mpu9250 pin type enumeration definition

Enumerator
MPU9250_PIN_TYPE_PUSH_PULL 

push pull

MPU9250_PIN_TYPE_OPEN_DRAIN 

open drain

Definition at line 252 of file driver_mpu9250.h.

◆ mpu9250_signal_path_reset_t

mpu9250 signal path reset enumeration definition

Enumerator
MPU9250_SIGNAL_PATH_RESET_TEMP 

temperature sensor analog and digital signal paths

MPU9250_SIGNAL_PATH_RESET_ACCEL 

accelerometer analog and digital signal paths

MPU9250_SIGNAL_PATH_RESET_GYRO 

gyroscope analog and digital signal paths

Definition at line 112 of file driver_mpu9250.h.

◆ mpu9250_source_t

mpu9250 source enumeration definition

Enumerator
MPU9250_SOURCE_ACC_X 

accelerometer x

MPU9250_SOURCE_ACC_Y 

accelerometer y

MPU9250_SOURCE_ACC_Z 

accelerometer z

MPU9250_SOURCE_GYRO_X 

gyroscope x

MPU9250_SOURCE_GYRO_Y 

gyroscope y

MPU9250_SOURCE_GYRO_Z 

gyroscope z

Definition at line 89 of file driver_mpu9250.h.

Function Documentation

◆ mpu9250_accelerometer_offset_convert_to_data()

uint8_t mpu9250_accelerometer_offset_convert_to_data ( mpu9250_handle_t * handle,
int16_t reg,
float * mg )

convert the register raw data to the accelerometer offset

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

Definition at line 9662 of file driver_mpu9250.c.

◆ mpu9250_accelerometer_offset_convert_to_register()

uint8_t mpu9250_accelerometer_offset_convert_to_register ( mpu9250_handle_t * handle,
float mg,
int16_t * reg )

convert the accelerometer offset to the register raw data

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

Definition at line 9635 of file driver_mpu9250.c.

◆ mpu9250_deinit()

uint8_t mpu9250_deinit ( mpu9250_handle_t * handle)

close the chip

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

Definition at line 4167 of file driver_mpu9250.c.

◆ mpu9250_device_reset()

uint8_t mpu9250_device_reset ( mpu9250_handle_t * handle)

reset the chip

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

Definition at line 6284 of file driver_mpu9250.c.

◆ mpu9250_fifo_get()

uint8_t mpu9250_fifo_get ( mpu9250_handle_t * handle,
uint8_t * buf,
uint16_t len )

fifo read bytes

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6898 of file driver_mpu9250.c.

◆ mpu9250_fifo_reset()

uint8_t mpu9250_fifo_reset ( mpu9250_handle_t * handle)

reset the fifo

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

Definition at line 6041 of file driver_mpu9250.c.

◆ mpu9250_fifo_set()

uint8_t mpu9250_fifo_set ( mpu9250_handle_t * handle,
uint8_t * buf,
uint16_t len )

fifo write bytes

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6934 of file driver_mpu9250.c.

◆ mpu9250_force_fifo_reset()

uint8_t mpu9250_force_fifo_reset ( mpu9250_handle_t * handle)

force reset the fifo

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

Definition at line 5843 of file driver_mpu9250.c.

◆ mpu9250_get_accel_compare_with_previous_sample()

uint8_t mpu9250_get_accel_compare_with_previous_sample ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the accel compare with previous sample status

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

Definition at line 8176 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_choice()

uint8_t mpu9250_get_accelerometer_choice ( mpu9250_handle_t * handle,
uint8_t * choice )

get the accelerometer choice

Parameters
[in]*handlepointer to an mpu9250 handle structure
[out]*choicepointer to an accelerometer choice buffer
Returns
status code
  • 0 success
  • 1 get accelerometer choice failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 choice > 3
Note
none

Definition at line 7848 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_low_pass_filter()

uint8_t mpu9250_get_accelerometer_low_pass_filter ( mpu9250_handle_t * handle,
mpu9250_accelerometer_low_pass_filter_t * filter )

get the accelerometer low pass filter

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

Definition at line 7930 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_range()

uint8_t mpu9250_get_accelerometer_range ( mpu9250_handle_t * handle,
mpu9250_accelerometer_range_t * range )

get the accelerometer range

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7714 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_test()

uint8_t mpu9250_get_accelerometer_test ( mpu9250_handle_t * handle,
mpu9250_axis_t axis,
mpu9250_bool_t * enable )

get the accelerometer test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7632 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_x_offset()

uint8_t mpu9250_get_accelerometer_x_offset ( mpu9250_handle_t * handle,
int16_t * offset )

get the accelerometer x offset

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

Definition at line 9448 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_x_test()

uint8_t mpu9250_get_accelerometer_x_test ( mpu9250_handle_t * handle,
uint8_t * data )

get the accelerometer x test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 9235 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_y_offset()

uint8_t mpu9250_get_accelerometer_y_offset ( mpu9250_handle_t * handle,
int16_t * offset )

get the accelerometer y offset

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

Definition at line 9523 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_y_test()

uint8_t mpu9250_get_accelerometer_y_test ( mpu9250_handle_t * handle,
uint8_t * data )

get the accelerometer y test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 9305 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_z_offset()

uint8_t mpu9250_get_accelerometer_z_offset ( mpu9250_handle_t * handle,
int16_t * offset )

get the accelerometer z offset

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

Definition at line 9598 of file driver_mpu9250.c.

◆ mpu9250_get_accelerometer_z_test()

uint8_t mpu9250_get_accelerometer_z_test ( mpu9250_handle_t * handle,
uint8_t * data )

get the accelerometer z test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 9375 of file driver_mpu9250.c.

◆ mpu9250_get_addr_pin()

uint8_t mpu9250_get_addr_pin ( mpu9250_handle_t * handle,
mpu9250_address_t * addr_pin )

get the chip address pin

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

Definition at line 3984 of file driver_mpu9250.c.

◆ mpu9250_get_clock_source()

uint8_t mpu9250_get_clock_source ( mpu9250_handle_t * handle,
mpu9250_clock_source_t * clock_source )

get the chip clock source

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6411 of file driver_mpu9250.c.

◆ mpu9250_get_cycle_wake_up()

uint8_t mpu9250_get_cycle_wake_up ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the cycle wake up mode status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6575 of file driver_mpu9250.c.

◆ mpu9250_get_device_reset()

uint8_t mpu9250_get_device_reset ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the device reset status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6329 of file driver_mpu9250.c.

◆ mpu9250_get_disable_iic_slave()

uint8_t mpu9250_get_disable_iic_slave ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic slave status

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

Definition at line 6005 of file driver_mpu9250.c.

◆ mpu9250_get_extern_sync()

uint8_t mpu9250_get_extern_sync ( mpu9250_handle_t * handle,
mpu9250_extern_sync_t * sync )

get the extern sync type

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7129 of file driver_mpu9250.c.

◆ mpu9250_get_fifo()

uint8_t mpu9250_get_fifo ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the fifo status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 5807 of file driver_mpu9250.c.

◆ mpu9250_get_fifo_count()

uint8_t mpu9250_get_fifo_count ( mpu9250_handle_t * handle,
uint16_t * count )

get the fifo counter value

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6860 of file driver_mpu9250.c.

◆ mpu9250_get_fifo_enable()

uint8_t mpu9250_get_fifo_enable ( mpu9250_handle_t * handle,
mpu9250_fifo_t fifo,
mpu9250_bool_t * enable )

get the fifo function status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8260 of file driver_mpu9250.c.

◆ mpu9250_get_fifo_mode()

uint8_t mpu9250_get_fifo_mode ( mpu9250_handle_t * handle,
mpu9250_fifo_mode * mode )

get the fifo mode

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

Definition at line 7293 of file driver_mpu9250.c.

◆ mpu9250_get_fifo_reset()

uint8_t mpu9250_get_fifo_reset ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the fifo reset status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6086 of file driver_mpu9250.c.

◆ mpu9250_get_fsync_interrupt()

uint8_t mpu9250_get_fsync_interrupt ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the fsync interrupt status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8752 of file driver_mpu9250.c.

◆ mpu9250_get_fsync_interrupt_level()

uint8_t mpu9250_get_fsync_interrupt_level ( mpu9250_handle_t * handle,
mpu9250_pin_level_t * level )

get the fsync interrupt level

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8670 of file driver_mpu9250.c.

◆ mpu9250_get_gyro_standby()

uint8_t mpu9250_get_gyro_standby ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the gyro standby status

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

Definition at line 6739 of file driver_mpu9250.c.

◆ mpu9250_get_gyro_x_offset()

uint8_t mpu9250_get_gyro_x_offset ( mpu9250_handle_t * handle,
int16_t * offset )

get the gyro x offset

Parameters
[in]*handlepointer to an mpu9250 handle structure
[out]*offsetpointer to a gyro x offset buffer
Returns
status code
  • 0 success
  • 1 get gyro x offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 9727 of file driver_mpu9250.c.

◆ mpu9250_get_gyro_y_offset()

uint8_t mpu9250_get_gyro_y_offset ( mpu9250_handle_t * handle,
int16_t * offset )

get the gyro y offset

Parameters
[in]*handlepointer to an mpu9250 handle structure
[out]*offsetpointer to a gyro y offset buffer
Returns
status code
  • 0 success
  • 1 get gyro y offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 9802 of file driver_mpu9250.c.

◆ mpu9250_get_gyro_z_offset()

uint8_t mpu9250_get_gyro_z_offset ( mpu9250_handle_t * handle,
int16_t * offset )

get the gyro z offset

Parameters
[in]*handlepointer to an mpu9250 handle structure
[out]*offsetpointer to a gyro z offset buffer
Returns
status code
  • 0 success
  • 1 get gyro z offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 9877 of file driver_mpu9250.c.

◆ mpu9250_get_gyroscope_choice()

uint8_t mpu9250_get_gyroscope_choice ( mpu9250_handle_t * handle,
uint8_t * choice )

get the gyroscope choice

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

Definition at line 7548 of file driver_mpu9250.c.

◆ mpu9250_get_gyroscope_range()

uint8_t mpu9250_get_gyroscope_range ( mpu9250_handle_t * handle,
mpu9250_gyroscope_range_t * range )

get the gyroscope range

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7459 of file driver_mpu9250.c.

◆ mpu9250_get_gyroscope_test()

uint8_t mpu9250_get_gyroscope_test ( mpu9250_handle_t * handle,
mpu9250_axis_t axis,
mpu9250_bool_t * enable )

get the gyroscope test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7377 of file driver_mpu9250.c.

◆ mpu9250_get_gyroscope_x_test()

uint8_t mpu9250_get_gyroscope_x_test ( mpu9250_handle_t * handle,
uint8_t * data )

get the gyroscope x test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 9025 of file driver_mpu9250.c.

◆ mpu9250_get_gyroscope_y_test()

uint8_t mpu9250_get_gyroscope_y_test ( mpu9250_handle_t * handle,
uint8_t * data )

get the gyroscope y test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 9095 of file driver_mpu9250.c.

◆ mpu9250_get_gyroscope_z_test()

uint8_t mpu9250_get_gyroscope_z_test ( mpu9250_handle_t * handle,
uint8_t * data )

get the gyroscope z test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 9165 of file driver_mpu9250.c.

◆ mpu9250_get_iic4_data_in()

uint8_t mpu9250_get_iic4_data_in ( mpu9250_handle_t * handle,
uint8_t * data )

get the iic4 data in

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12953 of file driver_mpu9250.c.

◆ mpu9250_get_iic4_data_out()

uint8_t mpu9250_get_iic4_data_out ( mpu9250_handle_t * handle,
uint8_t * data )

get the iic4 data out

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12883 of file driver_mpu9250.c.

◆ mpu9250_get_iic4_enable()

uint8_t mpu9250_get_iic4_enable ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic4 status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12558 of file driver_mpu9250.c.

◆ mpu9250_get_iic4_interrupt()

uint8_t mpu9250_get_iic4_interrupt ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic4 interrupt status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12640 of file driver_mpu9250.c.

◆ mpu9250_get_iic4_transaction_mode()

uint8_t mpu9250_get_iic4_transaction_mode ( mpu9250_handle_t * handle,
mpu9250_iic4_transaction_mode_t * mode )

get the iic4 transaction mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12722 of file driver_mpu9250.c.

◆ mpu9250_get_iic_address()

uint8_t mpu9250_get_iic_address ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t * addr_7bit )

get the iic address

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11003 of file driver_mpu9250.c.

◆ mpu9250_get_iic_bypass()

uint8_t mpu9250_get_iic_bypass ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic bypass status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8834 of file driver_mpu9250.c.

◆ mpu9250_get_iic_byte_swap()

uint8_t mpu9250_get_iic_byte_swap ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_bool_t * enable )

get the iic byte swap status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11726 of file driver_mpu9250.c.

◆ mpu9250_get_iic_clock()

uint8_t mpu9250_get_iic_clock ( mpu9250_handle_t * handle,
mpu9250_iic_clock_t * clk )

get the iic clock

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10222 of file driver_mpu9250.c.

◆ mpu9250_get_iic_data_out()

uint8_t mpu9250_get_iic_data_out ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t * data )

get the iic data out

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11343 of file driver_mpu9250.c.

◆ mpu9250_get_iic_delay()

uint8_t mpu9250_get_iic_delay ( mpu9250_handle_t * handle,
uint8_t * delay )

get the iic delay

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12811 of file driver_mpu9250.c.

◆ mpu9250_get_iic_delay_enable()

uint8_t mpu9250_get_iic_delay_enable ( mpu9250_handle_t * handle,
mpu9250_iic_delay_t delay,
mpu9250_bool_t * enable )

get the iic delay status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12476 of file driver_mpu9250.c.

◆ mpu9250_get_iic_enable()

uint8_t mpu9250_get_iic_enable ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_bool_t * enable )

get the iic status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11532 of file driver_mpu9250.c.

◆ mpu9250_get_iic_fifo_enable()

uint8_t mpu9250_get_iic_fifo_enable ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_bool_t * enable )

get the iic fifo status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10585 of file driver_mpu9250.c.

◆ mpu9250_get_iic_group_order()

uint8_t mpu9250_get_iic_group_order ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_iic_group_order_t * order )

get the iic group order

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12114 of file driver_mpu9250.c.

◆ mpu9250_get_iic_master()

uint8_t mpu9250_get_iic_master ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic master status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 5923 of file driver_mpu9250.c.

◆ mpu9250_get_iic_master_reset()

uint8_t mpu9250_get_iic_master_reset ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic master reset status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6167 of file driver_mpu9250.c.

◆ mpu9250_get_iic_mode()

uint8_t mpu9250_get_iic_mode ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_iic_mode_t * mode )

get the iic mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10779 of file driver_mpu9250.c.

◆ mpu9250_get_iic_multi_master()

uint8_t mpu9250_get_iic_multi_master ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic multi master status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10304 of file driver_mpu9250.c.

◆ mpu9250_get_iic_read_mode()

uint8_t mpu9250_get_iic_read_mode ( mpu9250_handle_t * handle,
mpu9250_iic_read_mode_t * mode )

get the iic read mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10468 of file driver_mpu9250.c.

◆ mpu9250_get_iic_register()

uint8_t mpu9250_get_iic_register ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t * reg )

get the iic register

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11181 of file driver_mpu9250.c.

◆ mpu9250_get_iic_status()

uint8_t mpu9250_get_iic_status ( mpu9250_handle_t * handle,
uint8_t * status )

get the iic status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12394 of file driver_mpu9250.c.

◆ mpu9250_get_iic_transaction_mode()

uint8_t mpu9250_get_iic_transaction_mode ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_iic_transaction_mode_t * mode )

get the iic transaction mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11920 of file driver_mpu9250.c.

◆ mpu9250_get_iic_transferred_len()

uint8_t mpu9250_get_iic_transferred_len ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t * len )

get the iic transferred length

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12315 of file driver_mpu9250.c.

◆ mpu9250_get_iic_wait_for_external_sensor()

uint8_t mpu9250_get_iic_wait_for_external_sensor ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the iic wait for external sensor status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10386 of file driver_mpu9250.c.

◆ mpu9250_get_interface()

uint8_t mpu9250_get_interface ( mpu9250_handle_t * handle,
mpu9250_interface_t * interface )

get the chip interface

Parameters
[in]*handlepointer to an mpu9250 handle structure
[out]*interfacepointer to a chip interface buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 3942 of file driver_mpu9250.c.

◆ mpu9250_get_interrupt()

uint8_t mpu9250_get_interrupt ( mpu9250_handle_t * handle,
mpu9250_interrupt_t type,
mpu9250_bool_t * enable )

get the interrupt status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8918 of file driver_mpu9250.c.

◆ mpu9250_get_interrupt_latch()

uint8_t mpu9250_get_interrupt_latch ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the interrupt latch status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8506 of file driver_mpu9250.c.

◆ mpu9250_get_interrupt_level()

uint8_t mpu9250_get_interrupt_level ( mpu9250_handle_t * handle,
mpu9250_pin_level_t * level )

get the interrupt level

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8342 of file driver_mpu9250.c.

◆ mpu9250_get_interrupt_pin_type()

uint8_t mpu9250_get_interrupt_pin_type ( mpu9250_handle_t * handle,
mpu9250_pin_type_t * type )

get the interrupt pin type

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8424 of file driver_mpu9250.c.

◆ mpu9250_get_interrupt_read_clear()

uint8_t mpu9250_get_interrupt_read_clear ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the interrupt reading clear status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8588 of file driver_mpu9250.c.

◆ mpu9250_get_interrupt_status()

uint8_t mpu9250_get_interrupt_status ( mpu9250_handle_t * handle,
uint8_t * status )

get the interrupt status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8955 of file driver_mpu9250.c.

◆ mpu9250_get_low_pass_filter()

uint8_t mpu9250_get_low_pass_filter ( mpu9250_handle_t * handle,
mpu9250_low_pass_filter_t * filter )

get the low pass filter

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7211 of file driver_mpu9250.c.

◆ mpu9250_get_low_power_accel_output_rate()

uint8_t mpu9250_get_low_power_accel_output_rate ( mpu9250_handle_t * handle,
mpu9250_low_power_accel_output_rate_t * rate )

get the low power accel output rate

Parameters
[in]*handlepointer to an mpu9250 handle structure
[out]*ratepointer to a low power accel output rate buffer
Returns
status code
  • 0 success
  • 1 get low power accel output rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 8012 of file driver_mpu9250.c.

◆ mpu9250_get_motion_threshold()

uint8_t mpu9250_get_motion_threshold ( mpu9250_handle_t * handle,
uint8_t * threshold )

get the motion_threshold

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10003 of file driver_mpu9250.c.

◆ mpu9250_get_ptat()

uint8_t mpu9250_get_ptat ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the temperature sensor status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6493 of file driver_mpu9250.c.

◆ mpu9250_get_sample_rate_divider()

uint8_t mpu9250_get_sample_rate_divider ( mpu9250_handle_t * handle,
uint8_t * d )

get the sample rate divider

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7049 of file driver_mpu9250.c.

◆ mpu9250_get_sensor_reset()

uint8_t mpu9250_get_sensor_reset ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the sensor reset status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6248 of file driver_mpu9250.c.

◆ mpu9250_get_sleep()

uint8_t mpu9250_get_sleep ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the sleep status

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6657 of file driver_mpu9250.c.

◆ mpu9250_get_standby_mode()

uint8_t mpu9250_get_standby_mode ( mpu9250_handle_t * handle,
mpu9250_source_t source,
mpu9250_bool_t * enable )

get the source mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6823 of file driver_mpu9250.c.

◆ mpu9250_get_wake_on_motion()

uint8_t mpu9250_get_wake_on_motion ( mpu9250_handle_t * handle,
mpu9250_bool_t * enable )

get the wake on motion status

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

Definition at line 8094 of file driver_mpu9250.c.

◆ mpu9250_gyro_offset_convert_to_data()

uint8_t mpu9250_gyro_offset_convert_to_data ( mpu9250_handle_t * handle,
int16_t reg,
float * dps )

convert the register raw data to the gyro offset

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]regregister raw data
[out]*dpspointer to a gyro offset buffer
Returns
status code
  • 0 success
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 9941 of file driver_mpu9250.c.

◆ mpu9250_gyro_offset_convert_to_register()

uint8_t mpu9250_gyro_offset_convert_to_register ( mpu9250_handle_t * handle,
float dps,
int16_t * reg )

convert the gyro offset to the register raw data

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

Definition at line 9914 of file driver_mpu9250.c.

◆ mpu9250_iic_master_reset()

uint8_t mpu9250_iic_master_reset ( mpu9250_handle_t * handle)

reset the iic master controller

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

Definition at line 6122 of file driver_mpu9250.c.

◆ mpu9250_info()

uint8_t mpu9250_info ( mpu9250_info_t * info)

get the chip's information

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

Definition at line 13082 of file driver_mpu9250.c.

◆ mpu9250_init()

uint8_t mpu9250_init ( mpu9250_handle_t * handle)

initialize the chip

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

Definition at line 4008 of file driver_mpu9250.c.

◆ mpu9250_irq_handler()

uint8_t mpu9250_irq_handler ( mpu9250_handle_t * handle)

irq handler

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

Definition at line 4667 of file driver_mpu9250.c.

◆ mpu9250_motion_threshold_convert_to_data()

uint8_t mpu9250_motion_threshold_convert_to_data ( mpu9250_handle_t * handle,
uint8_t reg,
float * mg )

convert the register raw data to the motion threshold

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10065 of file driver_mpu9250.c.

◆ mpu9250_motion_threshold_convert_to_register()

uint8_t mpu9250_motion_threshold_convert_to_register ( mpu9250_handle_t * handle,
float mg,
uint8_t * reg )

convert the motion threshold to the register raw data

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10038 of file driver_mpu9250.c.

◆ mpu9250_read()

uint8_t mpu9250_read ( mpu9250_handle_t * handle,
int16_t(*) accel_raw[3],
float(*) accel_g[3],
int16_t(*) gyro_raw[3],
float(*) gyro_dps[3],
int16_t(*) mag_raw[3],
float(*) mag_ut[3],
uint16_t * len )

read the data

Parameters
[in]*handlepointer to an mpu9250 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
[out]**mag_rawpointer to a mag raw data buffer
[out]**mag_utpointer to a converted mag 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
spi can't read mag data

Definition at line 4222 of file driver_mpu9250.c.

◆ mpu9250_read_extern_sensor_data()

uint8_t mpu9250_read_extern_sensor_data ( mpu9250_handle_t * handle,
uint8_t * data,
uint8_t len )

read the extern sensor data

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12990 of file driver_mpu9250.c.

◆ mpu9250_read_temperature()

uint8_t mpu9250_read_temperature ( mpu9250_handle_t * handle,
int16_t * raw,
float * degrees )

read the temperature

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 4630 of file driver_mpu9250.c.

◆ mpu9250_self_test()

uint8_t mpu9250_self_test ( mpu9250_handle_t * handle,
int32_t gyro_offset_raw[3],
int32_t accel_offset_raw[3] )

run the self test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10093 of file driver_mpu9250.c.

◆ mpu9250_sensor_reset()

uint8_t mpu9250_sensor_reset ( mpu9250_handle_t * handle)

reset all sensors

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

Definition at line 6203 of file driver_mpu9250.c.

◆ mpu9250_set_accel_compare_with_previous_sample()

uint8_t mpu9250_set_accel_compare_with_previous_sample ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable accel compare with previous sample

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

Definition at line 8131 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_choice()

uint8_t mpu9250_set_accelerometer_choice ( mpu9250_handle_t * handle,
uint8_t choice )

set the accelerometer choice

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]choiceaccelerometer choice
Returns
status code
  • 0 success
  • 1 set accelerometer choice failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 choice > 1
Note
none

Definition at line 7796 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_low_pass_filter()

uint8_t mpu9250_set_accelerometer_low_pass_filter ( mpu9250_handle_t * handle,
mpu9250_accelerometer_low_pass_filter_t filter )

set the accelerometer low pass filter

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

Definition at line 7885 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_range()

uint8_t mpu9250_set_accelerometer_range ( mpu9250_handle_t * handle,
mpu9250_accelerometer_range_t range )

set the accelerometer range

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7669 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_test()

uint8_t mpu9250_set_accelerometer_test ( mpu9250_handle_t * handle,
mpu9250_axis_t axis,
mpu9250_bool_t enable )

set the accelerometer test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7586 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_x_offset()

uint8_t mpu9250_set_accelerometer_x_offset ( mpu9250_handle_t * handle,
int16_t offset )

set the accelerometer x offset

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

Definition at line 9410 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_x_test()

uint8_t mpu9250_set_accelerometer_x_test ( mpu9250_handle_t * handle,
uint8_t data )

set the accelerometer x test

Parameters
[in]*handlepointer to an mpu9250 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
Note
none

Definition at line 9200 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_y_offset()

uint8_t mpu9250_set_accelerometer_y_offset ( mpu9250_handle_t * handle,
int16_t offset )

set the accelerometer y offset

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

Definition at line 9485 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_y_test()

uint8_t mpu9250_set_accelerometer_y_test ( mpu9250_handle_t * handle,
uint8_t data )

set the accelerometer y test

Parameters
[in]*handlepointer to an mpu9250 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
Note
none

Definition at line 9270 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_z_offset()

uint8_t mpu9250_set_accelerometer_z_offset ( mpu9250_handle_t * handle,
int16_t offset )

set the accelerometer z offset

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

Definition at line 9560 of file driver_mpu9250.c.

◆ mpu9250_set_accelerometer_z_test()

uint8_t mpu9250_set_accelerometer_z_test ( mpu9250_handle_t * handle,
uint8_t data )

set the accelerometer z test

Parameters
[in]*handlepointer to an mpu9250 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
Note
none

Definition at line 9340 of file driver_mpu9250.c.

◆ mpu9250_set_addr_pin()

uint8_t mpu9250_set_addr_pin ( mpu9250_handle_t * handle,
mpu9250_address_t addr_pin )

set the chip address pin

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

Definition at line 3963 of file driver_mpu9250.c.

◆ mpu9250_set_clock_source()

uint8_t mpu9250_set_clock_source ( mpu9250_handle_t * handle,
mpu9250_clock_source_t clock_source )

set the chip clock source

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6366 of file driver_mpu9250.c.

◆ mpu9250_set_cycle_wake_up()

uint8_t mpu9250_set_cycle_wake_up ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the cycle wake up mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6530 of file driver_mpu9250.c.

◆ mpu9250_set_disable_iic_slave()

uint8_t mpu9250_set_disable_iic_slave ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the iic slave mode

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

Definition at line 5960 of file driver_mpu9250.c.

◆ mpu9250_set_extern_sync()

uint8_t mpu9250_set_extern_sync ( mpu9250_handle_t * handle,
mpu9250_extern_sync_t sync )

set the extern sync type

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7084 of file driver_mpu9250.c.

◆ mpu9250_set_fifo()

uint8_t mpu9250_set_fifo ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable fifo

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 5762 of file driver_mpu9250.c.

◆ mpu9250_set_fifo_1024kb()

uint8_t mpu9250_set_fifo_1024kb ( mpu9250_handle_t * handle)

set fifo 1024kb

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

Definition at line 7750 of file driver_mpu9250.c.

◆ mpu9250_set_fifo_enable()

uint8_t mpu9250_set_fifo_enable ( mpu9250_handle_t * handle,
mpu9250_fifo_t fifo,
mpu9250_bool_t enable )

enable or disable the fifo function

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8214 of file driver_mpu9250.c.

◆ mpu9250_set_fifo_mode()

uint8_t mpu9250_set_fifo_mode ( mpu9250_handle_t * handle,
mpu9250_fifo_mode mode )

set the fifo mode

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

Definition at line 7248 of file driver_mpu9250.c.

◆ mpu9250_set_fsync_interrupt()

uint8_t mpu9250_set_fsync_interrupt ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the fsync interrupt

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8707 of file driver_mpu9250.c.

◆ mpu9250_set_fsync_interrupt_level()

uint8_t mpu9250_set_fsync_interrupt_level ( mpu9250_handle_t * handle,
mpu9250_pin_level_t level )

set the fsync interrupt level

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8625 of file driver_mpu9250.c.

◆ mpu9250_set_gyro_standby()

uint8_t mpu9250_set_gyro_standby ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the gyro standby

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

Definition at line 6694 of file driver_mpu9250.c.

◆ mpu9250_set_gyro_x_offset()

uint8_t mpu9250_set_gyro_x_offset ( mpu9250_handle_t * handle,
int16_t offset )

set the gyro x offset

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]offsetgyro x offset
Returns
status code
  • 0 success
  • 1 set gyro x offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 9689 of file driver_mpu9250.c.

◆ mpu9250_set_gyro_y_offset()

uint8_t mpu9250_set_gyro_y_offset ( mpu9250_handle_t * handle,
int16_t offset )

set the gyro y offset

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]offsetgyro y offset
Returns
status code
  • 0 success
  • 1 set gyro y offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 9764 of file driver_mpu9250.c.

◆ mpu9250_set_gyro_z_offset()

uint8_t mpu9250_set_gyro_z_offset ( mpu9250_handle_t * handle,
int16_t offset )

set the gyro z offset

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]offsetgyro z offset
Returns
status code
  • 0 success
  • 1 set gyro z offset failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 9839 of file driver_mpu9250.c.

◆ mpu9250_set_gyroscope_choice()

uint8_t mpu9250_set_gyroscope_choice ( mpu9250_handle_t * handle,
uint8_t choice )

set the gyroscope choice

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]choicegyroscope choice
Returns
status code
  • 0 success
  • 1 set gyroscope choice failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 choice > 3
Note
none

Definition at line 7497 of file driver_mpu9250.c.

◆ mpu9250_set_gyroscope_range()

uint8_t mpu9250_set_gyroscope_range ( mpu9250_handle_t * handle,
mpu9250_gyroscope_range_t range )

set the gyroscope range

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7414 of file driver_mpu9250.c.

◆ mpu9250_set_gyroscope_test()

uint8_t mpu9250_set_gyroscope_test ( mpu9250_handle_t * handle,
mpu9250_axis_t axis,
mpu9250_bool_t enable )

set the gyroscope test

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7331 of file driver_mpu9250.c.

◆ mpu9250_set_gyroscope_x_test()

uint8_t mpu9250_set_gyroscope_x_test ( mpu9250_handle_t * handle,
uint8_t data )

set the gyroscope x test

Parameters
[in]*handlepointer to an mpu9250 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
Note
none

Definition at line 8990 of file driver_mpu9250.c.

◆ mpu9250_set_gyroscope_y_test()

uint8_t mpu9250_set_gyroscope_y_test ( mpu9250_handle_t * handle,
uint8_t data )

set the gyroscope y test

Parameters
[in]*handlepointer to an mpu9250 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
Note
none

Definition at line 9060 of file driver_mpu9250.c.

◆ mpu9250_set_gyroscope_z_test()

uint8_t mpu9250_set_gyroscope_z_test ( mpu9250_handle_t * handle,
uint8_t data )

set the gyroscope z test

Parameters
[in]*handlepointer to an mpu9250 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
Note
none

Definition at line 9130 of file driver_mpu9250.c.

◆ mpu9250_set_iic4_data_in()

uint8_t mpu9250_set_iic4_data_in ( mpu9250_handle_t * handle,
uint8_t data )

set the iic4 data in

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12918 of file driver_mpu9250.c.

◆ mpu9250_set_iic4_data_out()

uint8_t mpu9250_set_iic4_data_out ( mpu9250_handle_t * handle,
uint8_t data )

set the iic4 data out

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12848 of file driver_mpu9250.c.

◆ mpu9250_set_iic4_enable()

uint8_t mpu9250_set_iic4_enable ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the iic4

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12513 of file driver_mpu9250.c.

◆ mpu9250_set_iic4_interrupt()

uint8_t mpu9250_set_iic4_interrupt ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the iic4 interrupt

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12595 of file driver_mpu9250.c.

◆ mpu9250_set_iic4_transaction_mode()

uint8_t mpu9250_set_iic4_transaction_mode ( mpu9250_handle_t * handle,
mpu9250_iic4_transaction_mode_t mode )

set the iic4 transaction mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12677 of file driver_mpu9250.c.

◆ mpu9250_set_iic_address()

uint8_t mpu9250_set_iic_address ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t addr_7bit )

set the iic address

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10871 of file driver_mpu9250.c.

◆ mpu9250_set_iic_bypass()

uint8_t mpu9250_set_iic_bypass ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the iic bypass

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8789 of file driver_mpu9250.c.

◆ mpu9250_set_iic_byte_swap()

uint8_t mpu9250_set_iic_byte_swap ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_bool_t enable )

enable or disable the iic byte swap

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11613 of file driver_mpu9250.c.

◆ mpu9250_set_iic_clock()

uint8_t mpu9250_set_iic_clock ( mpu9250_handle_t * handle,
mpu9250_iic_clock_t clk )

set the iic clock

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10177 of file driver_mpu9250.c.

◆ mpu9250_set_iic_data_out()

uint8_t mpu9250_set_iic_data_out ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t data )

set the iic data out

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11267 of file driver_mpu9250.c.

◆ mpu9250_set_iic_delay()

uint8_t mpu9250_set_iic_delay ( mpu9250_handle_t * handle,
uint8_t delay )

set the iic delay

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12760 of file driver_mpu9250.c.

◆ mpu9250_set_iic_delay_enable()

uint8_t mpu9250_set_iic_delay_enable ( mpu9250_handle_t * handle,
mpu9250_iic_delay_t delay,
mpu9250_bool_t enable )

enable or disable the iic delay

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12430 of file driver_mpu9250.c.

◆ mpu9250_set_iic_enable()

uint8_t mpu9250_set_iic_enable ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_bool_t enable )

enable or disable the iic

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11419 of file driver_mpu9250.c.

◆ mpu9250_set_iic_fifo_enable()

uint8_t mpu9250_set_iic_fifo_enable ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_bool_t enable )

enable or disable the iic fifo

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10507 of file driver_mpu9250.c.

◆ mpu9250_set_iic_group_order()

uint8_t mpu9250_set_iic_group_order ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_iic_group_order_t order )

set the iic group order

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12001 of file driver_mpu9250.c.

◆ mpu9250_set_iic_master()

uint8_t mpu9250_set_iic_master ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the iic master mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 5878 of file driver_mpu9250.c.

◆ mpu9250_set_iic_mode()

uint8_t mpu9250_set_iic_mode ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_iic_mode_t mode )

set the iic mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10647 of file driver_mpu9250.c.

◆ mpu9250_set_iic_multi_master()

uint8_t mpu9250_set_iic_multi_master ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable iic multi master

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10259 of file driver_mpu9250.c.

◆ mpu9250_set_iic_read_mode()

uint8_t mpu9250_set_iic_read_mode ( mpu9250_handle_t * handle,
mpu9250_iic_read_mode_t mode )

set the iic read mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10423 of file driver_mpu9250.c.

◆ mpu9250_set_iic_register()

uint8_t mpu9250_set_iic_register ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t reg )

set the iic register

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11095 of file driver_mpu9250.c.

◆ mpu9250_set_iic_transaction_mode()

uint8_t mpu9250_set_iic_transaction_mode ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
mpu9250_iic_transaction_mode_t mode )

set the iic transaction mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 11807 of file driver_mpu9250.c.

◆ mpu9250_set_iic_transferred_len()

uint8_t mpu9250_set_iic_transferred_len ( mpu9250_handle_t * handle,
mpu9250_iic_slave_t slave,
uint8_t len )

set the iic transferred length

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 12196 of file driver_mpu9250.c.

◆ mpu9250_set_iic_wait_for_external_sensor()

uint8_t mpu9250_set_iic_wait_for_external_sensor ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable iic wait for external sensor

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 10341 of file driver_mpu9250.c.

◆ mpu9250_set_interface()

uint8_t mpu9250_set_interface ( mpu9250_handle_t * handle,
mpu9250_interface_t interface )

set the chip interface

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]interfacechip interface
Returns
status code
  • 0 success
  • 2 handle is NULL
Note
none

Definition at line 3921 of file driver_mpu9250.c.

◆ mpu9250_set_interrupt()

uint8_t mpu9250_set_interrupt ( mpu9250_handle_t * handle,
mpu9250_interrupt_t type,
mpu9250_bool_t enable )

enable or disable the interrupt

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8872 of file driver_mpu9250.c.

◆ mpu9250_set_interrupt_latch()

uint8_t mpu9250_set_interrupt_latch ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the interrupt latch

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8461 of file driver_mpu9250.c.

◆ mpu9250_set_interrupt_level()

uint8_t mpu9250_set_interrupt_level ( mpu9250_handle_t * handle,
mpu9250_pin_level_t level )

set the interrupt level

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8297 of file driver_mpu9250.c.

◆ mpu9250_set_interrupt_pin_type()

uint8_t mpu9250_set_interrupt_pin_type ( mpu9250_handle_t * handle,
mpu9250_pin_type_t type )

set the interrupt pin type

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8379 of file driver_mpu9250.c.

◆ mpu9250_set_interrupt_read_clear()

uint8_t mpu9250_set_interrupt_read_clear ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the interrupt reading clear

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 8543 of file driver_mpu9250.c.

◆ mpu9250_set_low_pass_filter()

uint8_t mpu9250_set_low_pass_filter ( mpu9250_handle_t * handle,
mpu9250_low_pass_filter_t filter )

set the low pass filter

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7166 of file driver_mpu9250.c.

◆ mpu9250_set_low_power_accel_output_rate()

uint8_t mpu9250_set_low_power_accel_output_rate ( mpu9250_handle_t * handle,
mpu9250_low_power_accel_output_rate_t rate )

set the low power accel output rate

Parameters
[in]*handlepointer to an mpu9250 handle structure
[in]ratelow power accel output rate
Returns
status code
  • 0 success
  • 1 set low power accel output rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
Note
none

Definition at line 7967 of file driver_mpu9250.c.

◆ mpu9250_set_motion_threshold()

uint8_t mpu9250_set_motion_threshold ( mpu9250_handle_t * handle,
uint8_t threshold )

set the motion_threshold

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 9968 of file driver_mpu9250.c.

◆ mpu9250_set_ptat()

uint8_t mpu9250_set_ptat ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the temperature sensor

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6448 of file driver_mpu9250.c.

◆ mpu9250_set_sample_rate_divider()

uint8_t mpu9250_set_sample_rate_divider ( mpu9250_handle_t * handle,
uint8_t d )

set the sample rate divider

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 7014 of file driver_mpu9250.c.

◆ mpu9250_set_signal_path_reset()

uint8_t mpu9250_set_signal_path_reset ( mpu9250_handle_t * handle,
mpu9250_signal_path_reset_t path )

set the signal path reset

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6969 of file driver_mpu9250.c.

◆ mpu9250_set_sleep()

uint8_t mpu9250_set_sleep ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable the sleep mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6612 of file driver_mpu9250.c.

◆ mpu9250_set_standby_mode()

uint8_t mpu9250_set_standby_mode ( mpu9250_handle_t * handle,
mpu9250_source_t source,
mpu9250_bool_t enable )

set source into standby mode

Parameters
[in]*handlepointer to an mpu9250 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

Definition at line 6777 of file driver_mpu9250.c.

◆ mpu9250_set_wake_on_motion()

uint8_t mpu9250_set_wake_on_motion ( mpu9250_handle_t * handle,
mpu9250_bool_t enable )

enable or disable wake on motion

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

Definition at line 8049 of file driver_mpu9250.c.