imu.h 596 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef IMU_H
  2. #define IMU_H
  3. #include <stdbool.h>
  4. #include <furi_hal.h>
  5. #include "imu_t.h"
  6. #include "bmi160.h"
  7. #include "lsm6ds3trc.h"
  8. #include "lsm6dso.h"
  9. #ifdef __cplusplus
  10. extern "C" {
  11. #endif
  12. #define ACC_DATA_READY (1 << 0)
  13. #define GYR_DATA_READY (1 << 1)
  14. #define IMU_TAG "IMU_H"
  15. static const double DEG_TO_RAD = 0.017453292519943295769236907684886;
  16. static const double GRAVITY = 9.81;
  17. bool imu_begin();
  18. void imu_end();
  19. int imu_read(double* vec);
  20. struct imu_t* get_imu(uint8_t address);
  21. unsigned int imu_scan_i2c();
  22. struct imu_t* find_imu();
  23. #ifdef __cplusplus
  24. }
  25. #endif
  26. #endif // IMU_H