2022-07-20 03:57 PM
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