Lines Matching refs:lis2de12
59 struct lis2de12_data *lis2de12 = dev->data; in lis2de12_trigger_set() local
68 lis2de12->handler_drdy_acc = handler; in lis2de12_trigger_set()
69 lis2de12->trig_drdy_acc = trig; in lis2de12_trigger_set()
88 struct lis2de12_data *lis2de12 = dev->data; in lis2de12_handle_interrupt() local
104 if ((status.zyxda) && (lis2de12->handler_drdy_acc != NULL)) { in lis2de12_handle_interrupt()
105 lis2de12->handler_drdy_acc(dev, lis2de12->trig_drdy_acc); in lis2de12_handle_interrupt()
109 gpio_pin_interrupt_configure_dt(lis2de12->drdy_gpio, in lis2de12_handle_interrupt()
116 struct lis2de12_data *lis2de12 = in lis2de12_gpio_callback() local
121 gpio_pin_interrupt_configure_dt(lis2de12->drdy_gpio, GPIO_INT_DISABLE); in lis2de12_gpio_callback()
124 k_sem_give(&lis2de12->gpio_sem); in lis2de12_gpio_callback()
126 k_work_submit(&lis2de12->work); in lis2de12_gpio_callback()
131 static void lis2de12_thread(struct lis2de12_data *lis2de12) in lis2de12_thread() argument
134 k_sem_take(&lis2de12->gpio_sem, K_FOREVER); in lis2de12_thread()
135 lis2de12_handle_interrupt(lis2de12->dev); in lis2de12_thread()
143 struct lis2de12_data *lis2de12 = in lis2de12_work_cb() local
146 lis2de12_handle_interrupt(lis2de12->dev); in lis2de12_work_cb()
152 struct lis2de12_data *lis2de12 = dev->data; in lis2de12_init_interrupt() local
156 lis2de12->drdy_gpio = (struct gpio_dt_spec *)&cfg->int1_gpio; in lis2de12_init_interrupt()
159 if (!gpio_is_ready_dt(lis2de12->drdy_gpio)) { in lis2de12_init_interrupt()
161 lis2de12->drdy_gpio); in lis2de12_init_interrupt()
166 k_sem_init(&lis2de12->gpio_sem, 0, K_SEM_MAX_LIMIT); in lis2de12_init_interrupt()
168 k_thread_create(&lis2de12->thread, lis2de12->thread_stack, in lis2de12_init_interrupt()
170 (k_thread_entry_t)lis2de12_thread, lis2de12, in lis2de12_init_interrupt()
173 k_thread_name_set(&lis2de12->thread, dev->name); in lis2de12_init_interrupt()
175 lis2de12->work.handler = lis2de12_work_cb; in lis2de12_init_interrupt()
178 ret = gpio_pin_configure_dt(lis2de12->drdy_gpio, GPIO_INPUT); in lis2de12_init_interrupt()
184 gpio_init_callback(&lis2de12->gpio_cb, in lis2de12_init_interrupt()
186 BIT(lis2de12->drdy_gpio->pin)); in lis2de12_init_interrupt()
188 if (gpio_add_callback(lis2de12->drdy_gpio->port, &lis2de12->gpio_cb) < 0) { in lis2de12_init_interrupt()
193 return gpio_pin_interrupt_configure_dt(lis2de12->drdy_gpio, in lis2de12_init_interrupt()