Solved
FIFO usage and tap interrupt.
Hi, I am working with LSM6DS3TR sensor and need some advice on FIFO usage. I have followed sample code from the ST's GitHub page but still have some questions. I am using continuous-to-FIFO mode and tap interrupt.
- I see samples on my screen when interrupt happens. Do these samples come from FIFO or from the present state of the IMU?
- If coming from FIFO, I am unable to get more than 350 patterns. In code below, it prints 300 samples. How do I get more patterns?
- The FIFO can memorise 4096 samples of 16 bits each. Does this mean I can have 4096 samples of data or 4096/16 samples?
//Set FIFO watermark to a multiple of a pattern
pattern_len = 6;
pattern_numbers = 300;
lsm6ds3tr_c_fifo_watermark_set(&lsm6ds3, pattern_numbers*pattern_len);
lsm6ds3tr_c_fifo_stop_on_wtm_set(&lsm6ds3, PROPERTY_ENABLE);
//Set FIFO mode to Stream-to-FIFO mode
lsm6ds3tr_c_fifo_mode_set(&lsm6ds3, LSM6DS3TR_C_STREAM_TO_FIFO_MODE);
//Enable FIFO watermark interrupt generation on INT1 pin
lsm6ds3tr_c_pin_int1_route_get(&lsm6ds3, &int_1_reg);
int_1_reg.int1_single_tap = PROPERTY_ENABLE;
lsm6ds3tr_c_pin_int1_route_set(&lsm6ds3, int_1_reg);
//Set FIFO sensor decimator
lsm6ds3tr_c_fifo_xl_batch_set(&lsm6ds3, LSM6DS3TR_C_FIFO_XL_NO_DEC);
lsm6ds3tr_c_fifo_gy_batch_set(&lsm6ds3, LSM6DS3TR_C_FIFO_GY_NO_DEC);
