Skip to main content
Visitor II
September 24, 2025
Solved

iis2iclx how to read fifo

  • September 24, 2025
  • 1 reply
  • 682 views

I want to read acc data by fifo, but int1 can't work. I think there might be something wrong with my setup, but I can't figure out where the problem lies. This is my code.

 
/* Wait sensor boot time */
 platform_delay(BOOT_TIME);
 /* Check device ID */
 whoamI = 0;
 iis2iclx_device_id_get(&dev_ctx, &whoamI);

 if ( whoamI != IIS2ICLX_ID )
 while (1); /*manage here device not found */

 /* Restore default configuration */
 iis2iclx_reset_set(&dev_ctx, PROPERTY_ENABLE);

 do {
 iis2iclx_reset_get(&dev_ctx, &rst);
 } while (rst);

 /* Set full scale */
 iis2iclx_xl_full_scale_set(&dev_ctx, IIS2ICLX_2g);
 /* Configure filtering chain(No aux interface)
 * Accelerometer - LPF1 + LPF2 path
 */
 iis2iclx_xl_hp_path_on_out_set(&dev_ctx, IIS2ICLX_LP_ODR_DIV_100);
 iis2iclx_xl_filter_lp2_set(&dev_ctx, PROPERTY_ENABLE);

 // iis2iclx_fifo_virtual_sens_odr_chg_set(&dev_ctx, PROPERTY_ENABLE);
 iis2iclx_fifo_stop_on_wtm_set(&dev_ctx, PROPERTY_ENABLE);
 iis2iclx_fifo_xl_batch_set(&dev_ctx, IIS2ICLX_XL_BATCHED_AT_104Hz);
 iis2iclx_fifo_watermark_set(&dev_ctx, 112);
 iis2iclx_fifo_mode_set(&dev_ctx, IIS2ICLX_FIFO_MODE);
 iis2iclx_fifo_mode_t fifo_mode;
 iis2iclx_fifo_mode_get(&dev_ctx, &fifo_mode);
 iis2iclx_fifo_temp_batch_set(&dev_ctx, IIS2ICLX_TEMP_NOT_BATCHED);
 iis2iclx_fifo_timestamp_decimation_set(&dev_ctx, IIS2ICLX_NO_DECIMATION);
 iis2iclx_pin_int1_route_t int1_route;
 int1_route.int1_ctrl.int1_fifo_th = 1;
 int1_route.int1_ctrl.int1_fifo_ovr = 1;
 int1_route.int1_ctrl.int1_fifo_full = 1;
 int1_route.int1_ctrl.int1_cnt_bdr = 1;
 iis2iclx_pin_int1_route_set(&dev_ctx, &int1_route);

Edited to apply source code formatting - please see How to insert source code for future reference.

    This topic has been closed for replies.
    Best answer by Alpha_Lee

    I finded the problem. I lose this code

    iis2iclx_xl_data_rate_set(&dev_ctx, IIS2ICLX_XL_ODR_104Hz);

    1 reply

    Alpha_LeeAuthorAnswer
    Visitor II
    September 25, 2025

    I finded the problem. I lose this code

    iis2iclx_xl_data_rate_set(&dev_ctx, IIS2ICLX_XL_ODR_104Hz);