imu.h 610 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef IMU_H
  2. #define IMU_H
  3. #include <stdbool.h>
  4. #include <furi_hal.h>
  5. #include "imu_bmi160.h"
  6. #include "imu_lsm6ds3trc.h"
  7. #include "imu_lsm6dso.h"
  8. #ifdef __cplusplus
  9. extern "C" {
  10. #endif
  11. #define ACC_DATA_READY (1 << 0)
  12. #define GYR_DATA_READY (1 << 1)
  13. #define IMU_TAG "IMU_H"
  14. typedef struct
  15. {
  16. unsigned int address;
  17. bool (*begin)(void);
  18. void (*end)(void);
  19. int (*read)(double* vec);
  20. char name[255];
  21. } imu_t;
  22. bool imu_begin();
  23. void imu_end();
  24. int imu_read(double* vec);
  25. imu_t* get_imu(uint8_t address);
  26. unsigned int imu_scan_i2c();
  27. imu_t* find_imu();
  28. #ifdef __cplusplus
  29. }
  30. #endif
  31. #endif