lsm6ds3tr_c.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* Includes ------------------------------------------------------------------*/
  2. #include "lsm6ds3tr-c_reg.h"
  3. #include "nrf_delay.h"
  4. #include "SEGGER_RTT.h"
  5. #include <string.h>
  6. #include <stdio.h>
  7. typedef enum{
  8. LSM_DEV_FRONT = 0,
  9. LSM_DEV_CENTER = 1
  10. }lsm_device_t;
  11. typedef enum{
  12. LSM_STATE_ACC_QMC_FIFO_MODE = 0,
  13. LSM_STATE_GRY_ACC_QMC_FIFO_MODE = 1,
  14. LSM_STATE_ACC_MODE = 2,
  15. LSM_STATE_ILLEGAL_MODE = 3
  16. }lsm_mode_t;
  17. /* API ------------------------------------------------------------------*/
  18. int32_t lsm6ds3tr_c_switch_read_sensor_hub_cx(lsm_device_t dex_num, uint8_t device_addr, uint8_t reg, uint8_t* data,uint16_t len);
  19. int32_t lsm6ds3_c_switch_write_sensor_hub_cx(lsm_device_t dex_num, uint8_t device_addr, uint8_t reg, uint8_t* data);
  20. int lsm6ds3tr_c_init(lsm_device_t dex_num);
  21. void lsm6ds3tr_c_standby_power_acc_mode_config(lsm_device_t dex_num);
  22. void lsm6ds3tr_c_standby_power_acc_mode_start(lsm_device_t dex_num);
  23. void lsm6ds3tr_c_standby_power_acc_read(lsm_device_t dex_num, int16_t *acc);
  24. int16_t lsm6ds3tr_c_fifo_mode_read_group_num(lsm_device_t dex_num, lsm_mode_t fifo_mode);
  25. void lsm6ds3tr_c_acc_sensor_hub_qmc6310_fifo_with_timestamp_mode_config(lsm_device_t dex_num);
  26. void lsm6ds3tr_c_acc_sensor_hub_qmc6310_fifo_with_timestamp_mode_start(lsm_device_t dex_num);
  27. int lsm6ds3tr_c_acc_sensor_hub_qmc6310_fifo_with_timestamp_read(lsm_device_t dex_num, int16_t *acc, int16_t *mag, int32_t *timestamp, int16_t group_num);
  28. void lsm6ds3tr_c_gry_acc_sensor_hub_qmc6310_fifo_with_timestamp_mode_config(lsm_device_t dex_num);
  29. void lsm6ds3tr_c_gry_acc_sensor_hub_qmc6310_fifo_with_timestamp_mode_start(lsm_device_t dex_num);
  30. int lsm6ds3tr_c_gry_acc_sensor_hub_qmc6310_fifo_with_timestamp_read(lsm_device_t dex_num, int16_t *gry, int16_t *acc, int16_t *mag, int32_t *timestamp, int16_t group_num);
  31. void lsm6ds3tr_c_get_mode_stat(lsm_device_t dex_num, uint8_t *stat);
  32. void lsm6ds3tr_c_powerdown_mode(lsm_device_t dex_num);
  33. void lsm6ds3tr_c_suspend_mode(lsm_device_t dex_num);