/* lis2de12_handle_interrupt - handle the drdy event read data and call handler if registered any  */
static void lis2de12_handle_interrupt(const struct device *dev)
/* lis2de12_handle_interrupt - handle the drdy event read data and call handler if registered any  */
static void lis2de12_handle_interrupt(const struct device *dev)
{
	struct lis2de12_data *lis2de12 = dev->data;
	const struct lis2de12_config *cfg = dev->config;
	stmdev_ctx_t *ctx = (stmdev_ctx_t *)&cfg->ctx;
	lis2de12_status_reg_t status;
	while (1) {
		if (lis2de12_status_get(ctx, &status) < 0) {
			LOG_ERR("failed reading status reg");
			return;
		}
		if (status.zyxda == 0) {
			break;
		}
		if ((status.zyxda) && (lis2de12->handler_drdy_acc != NULL)) {
			lis2de12->handler_drdy_acc(dev, lis2de12->trig_drdy_acc);
		}
	}
	gpio_pin_interrupt_configure_dt(lis2de12->drdy_gpio,
					GPIO_INT_EDGE_TO_ACTIVE);
}