cancel
Showing results for 
Search instead for 
Did you mean: 

How can I attach a function to an interrupt on the SensorTile.box lsm6dsox sensor.

OlaBola
Associate II

I have a interrupt that is generated from a finite state machine on the LSM6DSOX sensor. I have routed the interrupt to the INT1 pin. How can I attach an interrupt handler function to this interrupt so the function is executed whenever the interrupt happens.

/* Route signals on interrupt pin 1 */
  lsm6dsox_pin_int1_route_get(&dev_ctx, &pin_int1_route);
  pin_int1_route.fsm1 = PROPERTY_ENABLE;
  lsm6dsox_pin_int1_route_set(&dev_ctx, pin_int1_route);
  /* Configure interrupt pin mode notification */
  lsm6dsox_int_notification_set(&dev_ctx, LSM6DSOX_ALL_INT_PULSED);

All of the examples on [ST's github](https://github.com/STMicroelectronics/STMems_Standard_C_drivers/tree/master/lsm6dsox_STdC/examples) poll the interrupts continuously in a loop. There is no interrupt handler for the generated interrupts.

So, my question is: How can I attach the int1 interrupt to a function?

Thank you

0 REPLIES 0