LSM6DSOX Interrupt registered but all mlc_out registers are empty?
Hey!
After doing some work I connected a Nucleo-L011K4 to the STEVAL-MKI197V1 breakout sensor board with the LSM6DSOX. I am connected through SPI, loaded the configuration (header file) on it and get it running. I've also set up a GPIO on the Nucleo board that is connected to the INT1 pin of the sensor board and makes an interrupt when the INT1 of the sensor gets high. This all works and the interrupt is called when expected. However, I also want to read the code of the interrupt, which would be 0 or 4 depending on the detected movement.
I use the following code bit
lsm6dsox_all_sources_t status;
uint8_t mlc_out[8];
lsm6dsox_all_sources_get(&dev_ctx, &status);
if (status.mlc_status.is_mlc1){
lsm6dsox_mlc_out_get(&dev_ctx, mlc_out);
sprintf((char*)tx_buffer, "Detect MLC interrupt code: %02X\r\n",
mlc_out[0]);
tx_com(tx_buffer, strlen((char const*)tx_buffer));
}I use this to print out the code, ONLY when I notice the interrupt from INT1.
The problem is, that the interrupt gets detected, and it prints out, but the print code is always 00. What did I do wrong? Also, I tried other registers of mlc_out, but those others also print out 00.
