imu_mouse.h 688 B

1234567891011121314151617181920212223242526
  1. #pragma once
  2. #include "sensors/ICM42688P.h"
  3. typedef struct {
  4. bool (*mouse_move)(void* inst, int8_t dx, int8_t dy);
  5. bool (*mouse_key_press)(void* inst, uint8_t button);
  6. bool (*mouse_key_release)(void* inst, uint8_t button);
  7. bool (*mouse_scroll)(void* inst, int8_t value);
  8. uint32_t report_rate_max;
  9. } ImuHidApi;
  10. typedef enum {
  11. ImuMouseKeyRight,
  12. ImuMouseKeyLeft,
  13. } ImuMouseKey;
  14. typedef struct ImuThread ImuThread;
  15. ImuThread* imu_start(ICM42688P* icm42688p, const ImuHidApi* hid, void* hid_inst);
  16. void imu_stop(ImuThread* imu);
  17. void imu_mouse_key_press(ImuThread* imu, ImuMouseKey key, bool state);
  18. void imu_mouse_scroll_mode(ImuThread* imu, bool enable);