lsm6ds3tr_c.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /* Includes ------------------------------------------------------------------*/
  2. #include "lsm6ds3tr-c_reg.h"
  3. #include "bsp_spi.h"
  4. #include "nrf_delay.h"
  5. #include "SEGGER_RTT.h"
  6. #include <string.h>
  7. #include <stdio.h>
  8. /* Private type -------------------------------------------------------------*/
  9. typedef union{
  10. int16_t i16bit[3];
  11. uint8_t u8bit[6];
  12. } axis3bit16_t;
  13. typedef struct {
  14. uint8_t enable;
  15. lsm6ds3tr_c_odr_xl_t odr;
  16. uint16_t odr_hz_val;
  17. lsm6ds3tr_c_fs_xl_t fs;
  18. uint8_t decimation;
  19. uint8_t samples_num_in_pattern;
  20. } sensor_lsm6ds3_xl;
  21. typedef struct {
  22. uint8_t enable;
  23. lsm6ds3tr_c_odr_g_t odr;
  24. uint16_t odr_hz_val;
  25. lsm6ds3tr_c_fs_g_t fs;
  26. uint8_t decimation;
  27. uint8_t samples_num_in_pattern;
  28. } sensor_lsm6ds3_gy;
  29. /* API ------------------------------------------------------------------*/
  30. void lsm6ds3tr_c_init(void);
  31. void lsm6ds3tr_c_fifo_mode(void);
  32. void lsm6ds3tr_c_fifo_read(axis3bit16_t **acc, uint16_t *acc_num, axis3bit16_t **gry, uint16_t *gry_num);
  33. void lsm6ds3tr_c_low_power_acc_mode(void);
  34. void lsm6ds3tr_c_low_power_acc(int16_t *acc);
  35. void lsm6ds3tr_c_read_data_polling_mode(void);
  36. void lsm6ds3tr_c_read_data_polling(int16_t *acc, int16_t *gry, int16_t *temp);
  37. void lsm6ds3tr_c_get_accel_power_mode_stat(uint8_t *stat);