72 void (*receive_callback)(uint8_t type),
73 void (*tap_callback)(uint8_t count, uint8_t direction),
74 void (*orient_callback)(uint8_t orientation)
79 int32_t gyro_offset_raw[3];
80 int32_t accel_offset_raw[3];
81 int32_t gyro_offset[3];
82 int32_t accel_offset[3];
83 int8_t gyro_orientation[9] = {1, 0, 0,
418 if (tap_callback != NULL)
805 gyro_offset, accel_offset);
893 int16_t (*gyro_raw)[3],
float (*gyro_dps)[3],
895 float *pitch,
float *roll,
float *yaw,
901 gyro_raw, gyro_dps, quat,
902 pitch, roll, yaw, l) != 0
driver mpu6050 dmp header file
uint8_t mpu6050_set_wake_up_frequency(mpu6050_handle_t *handle, mpu6050_wake_up_frequency_t frequency)
set the wake up frequency
uint8_t mpu6050_init(mpu6050_handle_t *handle)
initialize the chip
uint8_t mpu6050_set_accelerometer_range(mpu6050_handle_t *handle, mpu6050_accelerometer_range_t range)
set the accelerometer range
mpu6050_address_t
mpu6050 address enumeration definition
uint8_t mpu6050_set_standby_mode(mpu6050_handle_t *handle, mpu6050_source_t source, mpu6050_bool_t enable)
set source into standby mode
uint8_t mpu6050_motion_threshold_convert_to_register(mpu6050_handle_t *handle, float mg, uint8_t *reg)
convert the motion threshold to the register raw data
uint8_t mpu6050_self_test(mpu6050_handle_t *handle, int32_t gyro_offset_raw[3], int32_t accel_offset_raw[3])
run the self test
uint8_t mpu6050_set_motion_threshold(mpu6050_handle_t *handle, uint8_t threshold)
set the motion_threshold
uint8_t mpu6050_set_sample_rate_divider(mpu6050_handle_t *handle, uint8_t d)
set the sample rate divider
uint8_t mpu6050_set_motion_duration(mpu6050_handle_t *handle, uint8_t duration)
set the motion duration
uint8_t mpu6050_set_gyroscope_range(mpu6050_handle_t *handle, mpu6050_gyroscope_range_t range)
set the gyroscope range
uint8_t mpu6050_set_addr_pin(mpu6050_handle_t *handle, mpu6050_address_t addr_pin)
set the chip address pin
uint8_t mpu6050_set_interrupt_read_clear(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the interrupt reading clear
uint8_t mpu6050_set_fifo_enable(mpu6050_handle_t *handle, mpu6050_fifo_t fifo, mpu6050_bool_t enable)
enable or disable the fifo function
uint8_t mpu6050_set_interrupt(mpu6050_handle_t *handle, mpu6050_interrupt_t type, mpu6050_bool_t enable)
enable or disable the interrupt
uint8_t mpu6050_set_iic_bypass(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the iic bypass
uint8_t mpu6050_set_gyroscope_test(mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t enable)
set the gyroscope test
uint8_t mpu6050_set_cycle_wake_up(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the cycle wake up mode
uint8_t mpu6050_set_interrupt_pin_type(mpu6050_handle_t *handle, mpu6050_pin_type_t type)
set the interrupt pin type
uint8_t mpu6050_irq_handler(mpu6050_handle_t *handle)
irq handler
uint8_t mpu6050_set_iic_master(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the iic master mode
uint8_t mpu6050_force_fifo_reset(mpu6050_handle_t *handle)
force reset the fifo
uint8_t mpu6050_set_temperature_sensor(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the temperature sensor
uint8_t mpu6050_set_interrupt_latch(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the interrupt latch
uint8_t mpu6050_set_accelerometer_test(mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t enable)
set the accelerometer test
uint8_t mpu6050_set_extern_sync(mpu6050_handle_t *handle, mpu6050_extern_sync_t sync)
set the extern sync type
uint8_t mpu6050_set_sleep(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the sleep mode
struct mpu6050_handle_s mpu6050_handle_t
mpu6050 handle structure definition
uint8_t mpu6050_set_fifo(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable fifo
uint8_t mpu6050_set_interrupt_level(mpu6050_handle_t *handle, mpu6050_pin_level_t level)
set the interrupt level
uint8_t mpu6050_motion_duration_convert_to_register(mpu6050_handle_t *handle, uint8_t ms, uint8_t *reg)
convert the motion duration to the register raw data
uint8_t mpu6050_set_clock_source(mpu6050_handle_t *handle, mpu6050_clock_source_t clock_source)
set the chip clock source
uint8_t mpu6050_set_fsync_interrupt(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the fsync interrupt
uint8_t mpu6050_set_low_pass_filter(mpu6050_handle_t *handle, mpu6050_low_pass_filter_t filter)
set the low pass filter
uint8_t mpu6050_deinit(mpu6050_handle_t *handle)
close the chip
uint8_t mpu6050_set_fsync_interrupt_level(mpu6050_handle_t *handle, mpu6050_pin_level_t level)
set the fsync interrupt level
uint8_t mpu6050_set_force_accel_sample(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable force accel sample
@ MPU6050_INTERRUPT_I2C_MAST
@ MPU6050_INTERRUPT_DATA_READY
@ MPU6050_INTERRUPT_FIFO_OVERFLOW
@ MPU6050_INTERRUPT_MOTION
uint8_t mpu6050_dmp_set_tap_thresh(mpu6050_handle_t *handle, mpu6050_axis_t axis, uint16_t mg_ms)
dmp set the tap thresh
uint8_t mpu6050_dmp_set_gyro_bias(mpu6050_handle_t *handle, int32_t bias[3])
dmp set the gyro bias
uint8_t mpu6050_dmp_set_orientation(mpu6050_handle_t *handle, int8_t mat[9])
dmp set the orientation
uint8_t mpu6050_dmp_set_enable(mpu6050_handle_t *handle, mpu6050_bool_t enable)
enable or disable the dmp
uint8_t mpu6050_dmp_load_firmware(mpu6050_handle_t *handle)
load the dmp firmware
uint8_t mpu6050_dmp_set_tap_callback(mpu6050_handle_t *handle, void(*callback)(uint8_t count, uint8_t direction))
dmp set the tap callback
uint8_t mpu6050_dmp_set_orient_callback(mpu6050_handle_t *handle, void(*callback)(uint8_t orientation))
dmp set the orient callback
uint8_t mpu6050_dmp_set_shake_reject_timeout(mpu6050_handle_t *handle, uint16_t ms)
dmp set the shake reject timeout
uint8_t mpu6050_dmp_read(mpu6050_handle_t *handle, int16_t(*accel_raw)[3], float(*accel_g)[3], int16_t(*gyro_raw)[3], float(*gyro_dps)[3], int32_t(*quat)[4], float *pitch, float *roll, float *yaw, uint16_t *l)
dmp read the data
uint8_t mpu6050_dmp_set_tap_time_multi(mpu6050_handle_t *handle, uint16_t ms)
dmp set max time between taps to register as a multi tap
uint8_t mpu6050_dmp_set_accel_bias(mpu6050_handle_t *handle, int32_t bias[3])
dmp set the accel bias
uint8_t mpu6050_dmp_get_pedometer_step_count(mpu6050_handle_t *handle, uint32_t *count)
dmp get the pedometer step count
uint8_t mpu6050_dmp_set_pedometer_step_count(mpu6050_handle_t *handle, uint32_t count)
dmp set the pedometer step count
uint8_t mpu6050_dmp_set_feature(mpu6050_handle_t *handle, uint16_t mask)
dmp enable or disable the dmp feature
uint8_t mpu6050_dmp_gyro_accel_raw_offset_convert(mpu6050_handle_t *handle, int32_t gyro_offset_raw[3], int32_t accel_offset_raw[3], int32_t gyro_offset[3], int32_t accel_offset[3])
dmp gyro accel raw offset convert
uint8_t mpu6050_dmp_set_shake_reject_thresh(mpu6050_handle_t *handle, uint16_t dps)
dmp set the shake reject thresh
uint8_t mpu6050_dmp_set_fifo_rate(mpu6050_handle_t *handle, uint16_t rate)
dmp set the fifo rate
uint8_t mpu6050_dmp_set_tap_axes(mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t enable)
dmp enable or disable the tap axes
uint8_t mpu6050_dmp_set_shake_reject_time(mpu6050_handle_t *handle, uint16_t ms)
dmp set the shake reject time
uint8_t mpu6050_dmp_set_min_tap_count(mpu6050_handle_t *handle, uint8_t cnt)
dmp set the min tap count
uint8_t mpu6050_dmp_set_tap_time(mpu6050_handle_t *handle, uint16_t ms)
dmp set the tap time
uint8_t mpu6050_dmp_set_interrupt_mode(mpu6050_handle_t *handle, mpu6050_dmp_interrupt_mode_t mode)
dmp set the interrupt mode
uint8_t mpu6050_dmp_set_pedometer_walk_time(mpu6050_handle_t *handle, uint32_t ms)
dmp set the pedometer walk time
@ MPU6050_DMP_FEATURE_PEDOMETER
@ MPU6050_DMP_FEATURE_TAP
@ MPU6050_DMP_FEATURE_ORIENT
@ MPU6050_DMP_FEATURE_6X_QUAT
@ MPU6050_DMP_FEATURE_GYRO_CAL
@ MPU6050_DMP_FEATURE_SEND_RAW_ACCEL
@ MPU6050_DMP_FEATURE_SEND_CAL_GYRO
#define MPU6050_DMP_DEFAULT_IIC_MASTER
#define MPU6050_DMP_DEFAULT_RATE
#define MPU6050_DMP_DEFAULT_INTERRUPT_PIN_TYPE
uint8_t mpu6050_dmp_init(mpu6050_address_t addr_pin, void(*receive_callback)(uint8_t type), void(*tap_callback)(uint8_t count, uint8_t direction), void(*orient_callback)(uint8_t orientation))
dmp example init
#define MPU6050_DMP_DEFAULT_IIC_BYPASS
uint8_t mpu6050_dmp_deinit(void)
dmp example deinit
#define MPU6050_DMP_DEFAULT_INTERRUPT_READ_CLEAR
#define MPU6050_DMP_DEFAULT_TAP_X_THRESH
#define MPU6050_DMP_DEFAULT_WAKE_UP_FREQUENCY
#define MPU6050_DMP_DEFAULT_GYROSCOPE_RANGE
#define MPU6050_DMP_DEFAULT_TAP_Y_THRESH
#define MPU6050_DMP_DEFAULT_TAP_TIME_MULTI
#define MPU6050_DMP_DEFAULT_ACCELEROMETER_RANGE
#define MPU6050_DMP_DEFAULT_CYCLE_WAKE_UP
#define MPU6050_DMP_DEFAULT_INTERRUPT_LATCH
uint8_t mpu6050_dmp_get_pedometer_counter(uint32_t *cnt)
dmp example get pedometer counter
#define MPU6050_DMP_DEFAULT_SHAKE_REJECT_TIMEOUT
#define MPU6050_DMP_DEFAULT_CLOCK_SOURCE
mpu6050 dmp example default definition
#define MPU6050_DMP_DEFAULT_TAP_Z_THRESH
#define MPU6050_DMP_DEFAULT_INTERRUPT_MODE
#define MPU6050_DMP_DEFAULT_SHAKE_REJECT_TIME
#define MPU6050_DMP_DEFAULT_INTERRUPT_DATA_READY
#define MPU6050_DMP_DEFAULT_SHAKE_REJECT_THRESH
uint8_t mpu6050_dmp_read_all(int16_t(*accel_raw)[3], float(*accel_g)[3], int16_t(*gyro_raw)[3], float(*gyro_dps)[3], int32_t(*quat)[4], float *pitch, float *roll, float *yaw, uint16_t *l)
dmp example read
#define MPU6050_DMP_DEFAULT_LOW_PASS_FILTER
#define MPU6050_DMP_DEFAULT_EXTERN_SYNC
#define MPU6050_DMP_DEFAULT_INTERRUPT_DMP
#define MPU6050_DMP_DEFAULT_PEOMETER_STEP_COUNT
#define MPU6050_DMP_DEFAULT_MOTION_DURATION
#define MPU6050_DMP_DEFAULT_MOTION_THRESHOLD
#define MPU6050_DMP_DEFAULT_PEOMETER_WALK_TIME
#define MPU6050_DMP_DEFAULT_INTERRUPT_MOTION
#define MPU6050_DMP_DEFAULT_FSYNC_INTERRUPT
#define MPU6050_DMP_DEFAULT_INTERRUPT_FIFO_OVERFLOW
#define MPU6050_DMP_DEFAULT_TAP_TIME
#define MPU6050_DMP_DEFAULT_INTERRUPT_I2C_MAST
#define MPU6050_DMP_DEFAULT_MIN_TAP_COUNT
#define MPU6050_DMP_DEFAULT_FSYNC_INTERRUPT_LEVEL
uint8_t mpu6050_dmp_irq_handler(void)
dmp irq
#define MPU6050_DMP_DEFAULT_INTERRUPT_PIN_LEVEL
uint8_t mpu6050_interface_iic_deinit(void)
interface iic bus deinit
uint8_t mpu6050_interface_iic_read(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus read
void mpu6050_interface_debug_print(const char *const fmt,...)
interface print format data
uint8_t mpu6050_interface_iic_write(uint8_t addr, uint8_t reg, uint8_t *buf, uint16_t len)
interface iic bus write
uint8_t mpu6050_interface_iic_init(void)
interface iic bus init
void mpu6050_interface_delay_ms(uint32_t ms)
interface delay ms
#define DRIVER_MPU6050_LINK_IIC_DEINIT(HANDLE, FUC)
link iic_deinit function
#define DRIVER_MPU6050_LINK_INIT(HANDLE, STRUCTURE)
initialize mpu6050_handle_t structure
#define DRIVER_MPU6050_LINK_IIC_WRITE(HANDLE, FUC)
link iic_write function
#define DRIVER_MPU6050_LINK_DELAY_MS(HANDLE, FUC)
link delay_ms function
#define DRIVER_MPU6050_LINK_DEBUG_PRINT(HANDLE, FUC)
link debug_print function
#define DRIVER_MPU6050_LINK_RECEIVE_CALLBACK(HANDLE, FUC)
link receive_callback function
#define DRIVER_MPU6050_LINK_IIC_READ(HANDLE, FUC)
link iic_read function
#define DRIVER_MPU6050_LINK_IIC_INIT(HANDLE, FUC)
link iic_init function