app_imu_dmp.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. /*
  2. * app_imu_dmp.h
  3. *
  4. * Created on: Nov 23, 2023
  5. * Author: juraj
  6. */
  7. #ifndef INC_APP_IMU_DMP_H_
  8. #define INC_APP_IMU_DMP_H_
  9. #include "app_bridge.h"
  10. #ifdef __cplusplus
  11. extern "C"
  12. {
  13. #endif
  14. #define ACC_MULT_LOG -4
  15. #define GYR_MULT_LOG -2
  16. #define EUL_MULT_LOG -2
  17. #define ACC_MULT_NUM 10000
  18. #define GYR_MULT_NUM 100
  19. #define EUL_MULT_NUM 100
  20. #define ACC_BYTES 3
  21. #define GYR_BYTES 2
  22. #define EUL_BYTES 3
  23. enum imu_sensorID_t
  24. {
  25. ID_ALL = 0,
  26. ID_ACCELEROMETER = 1,
  27. ID_GYROSCOPE = 2,
  28. ID_EULER_ANGLES_GAUGE = 3
  29. };
  30. nBusAppInterface_t *getImuDriver();
  31. void imuDmp_init(void *hw_interface, void *hw_config);
  32. void imuDmp_reset();
  33. nBus_sensorType_t imuDmp_getType(uint8_t sensor_index);
  34. nBus_sensorCount_t imuDmp_getSensorCount();
  35. uint8_t imuDmp_getData(uint8_t sensor_index, uint8_t *data);
  36. nBus_statusType_t imuDmp_setData(uint8_t *data, uint8_t count, uint8_t *response);
  37. uint8_t imuDmp_hasParam(uint8_t sensor_index, nBus_param_t param_name);
  38. int32_t imuDmp_getParam(uint8_t sensor_index, nBus_param_t param_name);
  39. nBus_statusType_t imuDmp_setParam(uint8_t sensor_index, nBus_param_t param_name, int32_t param_value);
  40. nBus_statusType_t imuDmp_start(void);
  41. nBus_statusType_t imuDmp_stop(void);
  42. void imuDmp_readData(void);
  43. uint8_t imuDmp_store(void);
  44. nBus_statusType_t imuDmp_calibrate(uint8_t sensor_index);
  45. nBus_sensorFormat_t imuDmp_getSensorFormat(uint8_t sensor_index);
  46. nBus_statusType_t imuDmp_find(uint8_t enable);
  47. uint8_t imuDmp_device_ready();
  48. #ifdef __cplusplus
  49. }
  50. #endif
  51. #endif /* INC_APP_IMU_DMP_H_ */