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

mpu6050 dmp driver modules More...

Macros

#define MPU6050_DMP_CODE_SIZE   3062
 mpu6050 dmp code definition More...
 

Enumerations

enum  mpu6050_dmp_interrupt_mode_t { MPU6050_DMP_INTERRUPT_MODE_CONTINUOUS = 0x00 , MPU6050_DMP_INTERRUPT_MODE_GESTURE = 0x01 }
 mpu6050 dmp interrupt mode enumeration definition More...
 
enum  mpu6050_dmp_feature_t {
  MPU6050_DMP_FEATURE_TAP = 0x001 , MPU6050_DMP_FEATURE_ORIENT = 0x002 , MPU6050_DMP_FEATURE_3X_QUAT = 0x004 , MPU6050_DMP_FEATURE_PEDOMETER = 0x008 ,
  MPU6050_DMP_FEATURE_6X_QUAT = 0x010 , MPU6050_DMP_FEATURE_GYRO_CAL = 0x020 , MPU6050_DMP_FEATURE_SEND_RAW_ACCEL = 0x040 , MPU6050_DMP_FEATURE_SEND_RAW_GYRO = 0x080 ,
  MPU6050_DMP_FEATURE_SEND_CAL_GYRO = 0x100
}
 mpu6050 dmp feature enumeration definition More...
 
enum  mpu6050_dmp_tap_t {
  MPU6050_DMP_TAP_X_UP = 0x01 , MPU6050_DMP_TAP_X_DOWN = 0x02 , MPU6050_DMP_TAP_Y_UP = 0x03 , MPU6050_DMP_TAP_Y_DOWN = 0x04 ,
  MPU6050_DMP_TAP_Z_UP = 0x05 , MPU6050_DMP_TAP_Z_DOWN = 0x06
}
 mpu6050 dmp tap enumeration definition More...
 
enum  mpu6050_dmp_orient_t { MPU6050_DMP_ORIENT_PORTRAIT = 0x00 , MPU6050_DMP_ORIENT_LANDSCAPE = 0x01 , MPU6050_DMP_ORIENT_REVERSE_PORTRAIT = 0x02 , MPU6050_DMP_ORIENT_REVERSE_LANDSCAPE = 0x03 }
 mpu6050 dmp orient enumeration definition More...
 

Functions

uint8_t mpu6050_dmp_load_firmware (mpu6050_handle_t *handle)
 load the dmp firmware More...
 
uint8_t mpu6050_dmp_set_pedometer_walk_time (mpu6050_handle_t *handle, uint32_t ms)
 dmp set the pedometer walk time More...
 
uint8_t mpu6050_dmp_get_pedometer_walk_time (mpu6050_handle_t *handle, uint32_t *ms)
 dmp get the pedometer walk time More...
 
uint8_t mpu6050_dmp_set_pedometer_step_count (mpu6050_handle_t *handle, uint32_t count)
 dmp set the pedometer step count More...
 
uint8_t mpu6050_dmp_get_pedometer_step_count (mpu6050_handle_t *handle, uint32_t *count)
 dmp get the pedometer step count More...
 
uint8_t mpu6050_dmp_set_shake_reject_timeout (mpu6050_handle_t *handle, uint16_t ms)
 dmp set the shake reject timeout More...
 
uint8_t mpu6050_dmp_get_shake_reject_timeout (mpu6050_handle_t *handle, uint16_t *ms)
 dmp get the shake reject timeout More...
 
uint8_t mpu6050_dmp_set_shake_reject_time (mpu6050_handle_t *handle, uint16_t ms)
 dmp set the shake reject time More...
 
uint8_t mpu6050_dmp_get_shake_reject_time (mpu6050_handle_t *handle, uint16_t *ms)
 dmp get the shake reject time More...
 
uint8_t mpu6050_dmp_set_shake_reject_thresh (mpu6050_handle_t *handle, uint16_t dps)
 dmp set the shake reject thresh More...
 
uint8_t mpu6050_dmp_get_shake_reject_thresh (mpu6050_handle_t *handle, uint16_t *dps)
 dmp get the shake reject thresh More...
 
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 More...
 
uint8_t mpu6050_dmp_get_tap_time_multi (mpu6050_handle_t *handle, uint16_t *ms)
 dmp get max time between taps to register as a multi tap More...
 
uint8_t mpu6050_dmp_set_tap_time (mpu6050_handle_t *handle, uint16_t ms)
 dmp set the tap time More...
 
uint8_t mpu6050_dmp_get_tap_time (mpu6050_handle_t *handle, uint16_t *ms)
 dmp get the tap time More...
 
uint8_t mpu6050_dmp_set_min_tap_count (mpu6050_handle_t *handle, uint8_t cnt)
 dmp set the min tap count More...
 
uint8_t mpu6050_dmp_get_min_tap_count (mpu6050_handle_t *handle, uint8_t *cnt)
 dmp get the min tap count More...
 
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 More...
 
uint8_t mpu6050_dmp_get_tap_axes (mpu6050_handle_t *handle, mpu6050_axis_t axis, mpu6050_bool_t *enable)
 dmp get the tap axes status More...
 
uint8_t mpu6050_dmp_set_tap_thresh (mpu6050_handle_t *handle, mpu6050_axis_t axis, uint16_t mg_ms)
 dmp set the tap thresh More...
 
uint8_t mpu6050_dmp_get_tap_thresh (mpu6050_handle_t *handle, mpu6050_axis_t axis, uint16_t *mg_ms)
 dmp get the tap thresh More...
 
uint8_t mpu6050_dmp_set_fifo_rate (mpu6050_handle_t *handle, uint16_t rate)
 dmp set the fifo rate More...
 
uint8_t mpu6050_dmp_get_fifo_rate (mpu6050_handle_t *handle, uint16_t *rate)
 dmp get the fifo rate More...
 
uint8_t mpu6050_dmp_set_gyro_calibrate (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 dmp enable or disable gyro calibrate More...
 
uint8_t mpu6050_dmp_set_3x_quaternion (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 dmp enable or disable generate 3 axis quaternions from dmp More...
 
uint8_t mpu6050_dmp_set_6x_quaternion (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 dmp enable or disable generate 6 axis quaternions from dmp More...
 
uint8_t mpu6050_dmp_set_interrupt_mode (mpu6050_handle_t *handle, mpu6050_dmp_interrupt_mode_t mode)
 dmp set the interrupt mode More...
 
uint8_t mpu6050_dmp_set_gyro_bias (mpu6050_handle_t *handle, int32_t bias[3])
 dmp set the gyro bias More...
 
uint8_t mpu6050_dmp_set_accel_bias (mpu6050_handle_t *handle, int32_t bias[3])
 dmp set the accel bias More...
 
uint8_t mpu6050_dmp_set_orientation (mpu6050_handle_t *handle, int8_t mat[9])
 dmp set the orientation More...
 
uint8_t mpu6050_dmp_set_feature (mpu6050_handle_t *handle, uint16_t mask)
 dmp enable or disable the dmp feature More...
 
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 More...
 
uint8_t mpu6050_dmp_set_tap_callback (mpu6050_handle_t *handle, void(*callback)(uint8_t count, uint8_t direction))
 dmp set the tap callback More...
 
uint8_t mpu6050_dmp_set_orient_callback (mpu6050_handle_t *handle, void(*callback)(uint8_t orientation))
 dmp set the orient callback More...
 
uint8_t mpu6050_dmp_set_enable (mpu6050_handle_t *handle, mpu6050_bool_t enable)
 enable or disable the dmp More...
 
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 More...
 

Detailed Description

mpu6050 dmp driver modules

Macro Definition Documentation

◆ MPU6050_DMP_CODE_SIZE

#define MPU6050_DMP_CODE_SIZE   3062

mpu6050 dmp code definition

3062 bytes

Enumeration Type Documentation

◆ mpu6050_dmp_feature_t

mpu6050 dmp feature enumeration definition

Enumerator
MPU6050_DMP_FEATURE_TAP 

feature tap

MPU6050_DMP_FEATURE_ORIENT 

feature orient

MPU6050_DMP_FEATURE_3X_QUAT 

feature 3x quat

MPU6050_DMP_FEATURE_PEDOMETER 

feature pedometer

MPU6050_DMP_FEATURE_6X_QUAT 

feature 6x quat

MPU6050_DMP_FEATURE_GYRO_CAL 

feature gyro cal

MPU6050_DMP_FEATURE_SEND_RAW_ACCEL 

feature send raw accel

MPU6050_DMP_FEATURE_SEND_RAW_GYRO 

feature send raw gyro

MPU6050_DMP_FEATURE_SEND_CAL_GYRO 

feature send cal gyro

◆ mpu6050_dmp_interrupt_mode_t

mpu6050 dmp interrupt mode enumeration definition

Enumerator
MPU6050_DMP_INTERRUPT_MODE_CONTINUOUS 

continuous mode

MPU6050_DMP_INTERRUPT_MODE_GESTURE 

gesture mode

◆ mpu6050_dmp_orient_t

mpu6050 dmp orient enumeration definition

Enumerator
MPU6050_DMP_ORIENT_PORTRAIT 

portrait

MPU6050_DMP_ORIENT_LANDSCAPE 

landscape

MPU6050_DMP_ORIENT_REVERSE_PORTRAIT 

reverse portrait

MPU6050_DMP_ORIENT_REVERSE_LANDSCAPE 

reverse landscape

◆ mpu6050_dmp_tap_t

mpu6050 dmp tap enumeration definition

Enumerator
MPU6050_DMP_TAP_X_UP 

tap x up

MPU6050_DMP_TAP_X_DOWN 

tap x down

MPU6050_DMP_TAP_Y_UP 

tap y up

MPU6050_DMP_TAP_Y_DOWN 

tap y down

MPU6050_DMP_TAP_Z_UP 

tap z up

MPU6050_DMP_TAP_Z_DOWN 

tap z down

Function Documentation

◆ mpu6050_dmp_get_fifo_rate()

uint8_t mpu6050_dmp_get_fifo_rate ( mpu6050_handle_t handle,
uint16_t *  rate 
)

dmp get the fifo rate

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

◆ mpu6050_dmp_get_min_tap_count()

uint8_t mpu6050_dmp_get_min_tap_count ( mpu6050_handle_t handle,
uint8_t *  cnt 
)

dmp get the min tap count

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*cntpointer to a tap counter buffer
Returns
status code
  • 0 success
  • 1 dmp get min tap count failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_get_pedometer_step_count()

uint8_t mpu6050_dmp_get_pedometer_step_count ( mpu6050_handle_t handle,
uint32_t *  count 
)

dmp get the pedometer step count

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

◆ mpu6050_dmp_get_pedometer_walk_time()

uint8_t mpu6050_dmp_get_pedometer_walk_time ( mpu6050_handle_t handle,
uint32_t *  ms 
)

dmp get the pedometer walk time

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*mspointer to a walk time buffer
Returns
status code
  • 0 success
  • 1 dmp get pedometer walk time failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_get_shake_reject_thresh()

uint8_t mpu6050_dmp_get_shake_reject_thresh ( mpu6050_handle_t handle,
uint16_t *  dps 
)

dmp get the shake reject thresh

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*dpspointer to a shake reject thresh dps buffer
Returns
status code
  • 0 success
  • 1 dmp get shake reject thresh failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_get_shake_reject_time()

uint8_t mpu6050_dmp_get_shake_reject_time ( mpu6050_handle_t handle,
uint16_t *  ms 
)

dmp get the shake reject time

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*mspointer to a shake reject time buffer
Returns
status code
  • 0 success
  • 1 dmp get shake reject time failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_get_shake_reject_timeout()

uint8_t mpu6050_dmp_get_shake_reject_timeout ( mpu6050_handle_t handle,
uint16_t *  ms 
)

dmp get the shake reject timeout

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*mspointer to a reject timeout buffer
Returns
status code
  • 0 success
  • 1 dmp get shake reject timeout failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_get_tap_axes()

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

dmp get the tap axes status

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

◆ mpu6050_dmp_get_tap_thresh()

uint8_t mpu6050_dmp_get_tap_thresh ( mpu6050_handle_t handle,
mpu6050_axis_t  axis,
uint16_t *  mg_ms 
)

dmp get the tap thresh

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]axisset axis
[out]*mg_mspointer to an mg/ms thresh buffer
Returns
status code
  • 0 success
  • 1 dmp get tap thresh failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
  • 5 invalid axis
Note
none

◆ mpu6050_dmp_get_tap_time()

uint8_t mpu6050_dmp_get_tap_time ( mpu6050_handle_t handle,
uint16_t *  ms 
)

dmp get the tap time

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*mspointer to a tap time buffer
Returns
status code
  • 0 success
  • 1 dmp get tap time failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_get_tap_time_multi()

uint8_t mpu6050_dmp_get_tap_time_multi ( mpu6050_handle_t handle,
uint16_t *  ms 
)

dmp get max time between taps to register as a multi tap

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*mspointer to a delay time buffer
Returns
status code
  • 0 success
  • 1 dmp get tap time multi failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_gyro_accel_raw_offset_convert()

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

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

◆ mpu6050_dmp_load_firmware()

uint8_t mpu6050_dmp_load_firmware ( mpu6050_handle_t handle)

load the dmp firmware

Parameters
[in]*handlepointer to an mpu6050 handle structure
Returns
status code
  • 0 success
  • 1 load firmware failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is running
  • 5 code compare error
  • 6 set program start failed
Note
none

◆ mpu6050_dmp_read()

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

Parameters
[in]*handlepointer to an mpu6050 handle structure
[out]*accel_rawpointer to an accel raw buffer
[out]*accel_gpointer to an accel g buffer
[out]*gyro_rawpointer to a gyro raw buffer
[out]*gyro_dpspointer to a gyro dps buffer
[out]*quatpointer to a quat buffer
[out]*pitchpointer to a pitch buffer
[out]*rollpointer to a roll buffer
[out]*yawpointer to a yaw buffer
[in,out]*lpointer to a length buffer
Returns
status code
  • 0 success
  • 1 dmp get fifo rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
  • 5 quat check error
  • 6 fifo overflow
  • 7 fifo data is too little
  • 8 no data
Note
none

◆ mpu6050_dmp_set_3x_quaternion()

uint8_t mpu6050_dmp_set_3x_quaternion ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

dmp enable or disable generate 3 axis quaternions from dmp

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

◆ mpu6050_dmp_set_6x_quaternion()

uint8_t mpu6050_dmp_set_6x_quaternion ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

dmp enable or disable generate 6 axis quaternions from dmp

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

◆ mpu6050_dmp_set_accel_bias()

uint8_t mpu6050_dmp_set_accel_bias ( mpu6050_handle_t handle,
int32_t  bias[3] 
)

dmp set the accel bias

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]*biaspointer to a bias buffer
Returns
status code
  • 0 success
  • 1 dmp set accel bias failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_enable()

uint8_t mpu6050_dmp_set_enable ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

enable or disable the dmp

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

◆ mpu6050_dmp_set_feature()

uint8_t mpu6050_dmp_set_feature ( mpu6050_handle_t handle,
uint16_t  mask 
)

dmp enable or disable the dmp feature

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]maskset mask
Returns
status code
  • 0 success
  • 1 dmp set feature failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
mask can be MPU6050_DMP_FEATURE_TAP, MPU6050_DMP_FEATURE_ORIENT MPU6050_DMP_FEATURE_3X_QUAT, MPU6050_DMP_FEATURE_PEDOMETER MPU6050_DMP_FEATURE_6X_QUAT, MPU6050_DMP_FEATURE_GYRO_CAL MPU6050_DMP_FEATURE_SEND_RAW_ACCEL, MPU6050_DMP_FEATURE_SEND_RAW_GYRO MPU6050_DMP_FEATURE_SEND_CAL_GYRO or combination

◆ mpu6050_dmp_set_fifo_rate()

uint8_t mpu6050_dmp_set_fifo_rate ( mpu6050_handle_t handle,
uint16_t  rate 
)

dmp set the fifo rate

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]rateset rate
Returns
status code
  • 0 success
  • 1 dmp set fifo rate failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
  • 5 rate > 200
Note
none

◆ mpu6050_dmp_set_gyro_bias()

uint8_t mpu6050_dmp_set_gyro_bias ( mpu6050_handle_t handle,
int32_t  bias[3] 
)

dmp set the gyro bias

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]*biaspointer to a bias buffer
Returns
status code
  • 0 success
  • 1 dmp set gyro bias failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_gyro_calibrate()

uint8_t mpu6050_dmp_set_gyro_calibrate ( mpu6050_handle_t handle,
mpu6050_bool_t  enable 
)

dmp enable or disable gyro calibrate

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

◆ mpu6050_dmp_set_interrupt_mode()

uint8_t mpu6050_dmp_set_interrupt_mode ( mpu6050_handle_t handle,
mpu6050_dmp_interrupt_mode_t  mode 
)

dmp set the interrupt mode

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

◆ mpu6050_dmp_set_min_tap_count()

uint8_t mpu6050_dmp_set_min_tap_count ( mpu6050_handle_t handle,
uint8_t  cnt 
)

dmp set the min tap count

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]cnttap counter
Returns
status code
  • 0 success
  • 1 dmp set min tap count failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
  • 5 cnt must be between 1 and 4
Note
1 <= cnt <= 4

◆ mpu6050_dmp_set_orient_callback()

uint8_t mpu6050_dmp_set_orient_callback ( mpu6050_handle_t handle,
void(*)(uint8_t orientation)  callback 
)

dmp set the orient callback

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]*callbackpointer to a callback function address
Returns
status code
  • 0 success
  • 1 dmp set orient callback failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_orientation()

uint8_t mpu6050_dmp_set_orientation ( mpu6050_handle_t handle,
int8_t  mat[9] 
)

dmp set the orientation

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]*matpointer to an orientation matrix buffer
Returns
status code
  • 0 success
  • 1 dmp set orientation failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_pedometer_step_count()

uint8_t mpu6050_dmp_set_pedometer_step_count ( mpu6050_handle_t handle,
uint32_t  count 
)

dmp set the pedometer step count

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]countstep count
Returns
status code
  • 0 success
  • 1 dmp set pedometer step count failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_pedometer_walk_time()

uint8_t mpu6050_dmp_set_pedometer_walk_time ( mpu6050_handle_t handle,
uint32_t  ms 
)

dmp set the pedometer walk time

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]mswalk time
Returns
status code
  • 0 success
  • 1 dmp set pedometer walk time failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_shake_reject_thresh()

uint8_t mpu6050_dmp_set_shake_reject_thresh ( mpu6050_handle_t handle,
uint16_t  dps 
)

dmp set the shake reject thresh

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]dpsshake reject thresh
Returns
status code
  • 0 success
  • 1 dmp set shake reject thresh failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_shake_reject_time()

uint8_t mpu6050_dmp_set_shake_reject_time ( mpu6050_handle_t handle,
uint16_t  ms 
)

dmp set the shake reject time

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]msshake reject time
Returns
status code
  • 0 success
  • 1 dmp set shake reject time failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_shake_reject_timeout()

uint8_t mpu6050_dmp_set_shake_reject_timeout ( mpu6050_handle_t handle,
uint16_t  ms 
)

dmp set the shake reject timeout

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]msreject timeout
Returns
status code
  • 0 success
  • 1 dmp set shake reject timeout failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_tap_axes()

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

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]axisset axis
[in]enablebool value
Returns
status code
  • 0 success
  • 1 dmp set tap axes failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_tap_callback()

uint8_t mpu6050_dmp_set_tap_callback ( mpu6050_handle_t handle,
void(*)(uint8_t count, uint8_t direction)  callback 
)

dmp set the tap callback

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]*callbackpointer to a callback function address
Returns
status code
  • 0 success
  • 1 dmp set tap callback failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_tap_thresh()

uint8_t mpu6050_dmp_set_tap_thresh ( mpu6050_handle_t handle,
mpu6050_axis_t  axis,
uint16_t  mg_ms 
)

dmp set the tap thresh

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]axisset axis
[in]mg_msset thresh
Returns
status code
  • 0 success
  • 1 dmp set tap thresh failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
  • 5 mg/ms > 1600
  • 6 invalid axis
Note
none

◆ mpu6050_dmp_set_tap_time()

uint8_t mpu6050_dmp_set_tap_time ( mpu6050_handle_t handle,
uint16_t  ms 
)

dmp set the tap time

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]mstap time
Returns
status code
  • 0 success
  • 1 dmp set tap time failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none

◆ mpu6050_dmp_set_tap_time_multi()

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

Parameters
[in]*handlepointer to an mpu6050 handle structure
[in]msdelay time
Returns
status code
  • 0 success
  • 1 dmp set tap time multi failed
  • 2 handle is NULL
  • 3 handle is not initialized
  • 4 dmp is not inited
Note
none