I am using the code below to generate fifo watermark interrupts but I don't see any watermark interrupts generated. What am I doing wrong? (Sorry for the bad make up but I dont see an option to add a code ) int8_t Open_BMI160_FIFO(struct bmi160_dev *dev) { int8_t rslt = BMI160_OK; struct bmi160_int_settg int_config; fifo_frame.data = fifo_buff; fifo_frame.length = 1024; dev->fifo = &fifo_frame; /* Clear FIFO configuration register */ rslt = bmi160_set_fifo_config(BMI160_FIFO_CONFIG_1_MASK, BMI160_DISABLE, dev); if (rslt != BMI160_OK) { PDEBUG("Clear FIFO configuration register error, error code: %d\r\n", rslt); return rslt; } rslt = bmi160_set_fifo_wm(43, dev);//7*50=350 bytes, water mark value was word unit, cann't be greater than 255, 87*4=348 if(rslt != BMI160_OK) { PDEBUG("bmi160_set_fifo_wm error, error code: %d\r\n", rslt); } // BMI160_FIFO_A_ENABLE enable fifo for accelerometer only rslt = bmi160_set_fifo_config(/*BMI160_FIFO_A_ENABLE |BMI160_FIFO_TAG_INT1 */ BMI160_FIFO_ACCEL|BMI160_FIFO_HEADER, BMI160_ENABLE, dev); if(rslt != BMI160_OK) { PDEBUG("bmi160_set_fifo_config error, error code: %d\r\n", rslt); } /* Flush FIFO */ rslt = bmi160_set_fifo_flush(dev); if (rslt != BMI160_OK) { PDEBUG("Flush FIFO error, error code: %d\r\n", rslt); return rslt; } /* Select the Interrupt channel/pin */ int_config.int_channel = BMI160_INT_CHANNEL_1;// Interrupt channel/pin 2 /* Select the Interrupt type */ int_config.int_type = BMI160_ACC_GYRO_FIFO_WATERMARK_INT;// Choosing interrupt /* Select the interrupt channel/pin settings */ int_config.int_pin_settg.output_en = BMI160_ENABLE;// Enabling interrupt pins to act as output pin int_config.int_pin_settg.output_mode = BMI160_DISABLE;// Choosing push-pull mode for interrupt pin int_config.int_pin_settg.output_type = BMI160_DISABLE;// Choosing active high output int_config.int_pin_settg.edge_ctrl = BMI160_DISABLE;// Choosing edge triggered output int_config.int_pin_settg.input_en = BMI160_DISABLE;// Disabling interrupt pin to act as input int_config.fifo_wtm_int_en = BMI160_ENABLE;//Enable FIFO watermark interrupt /* Set the FIFO watermark interrupt */ bmi160_set_int_config(&int_config, dev); return rslt; }
... View more