@@ -33,8 +33,9 @@ int lis3mdl_trigger_set(struct device *dev,
3333
3434 drv_data -> data_ready_trigger = * trig ;
3535
36- gpio_pin_enable_callback (drv_data -> gpio ,
37- DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN );
36+ gpio_pin_interrupt_configure (drv_data -> gpio ,
37+ DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN ,
38+ GPIO_INT_EDGE_TO_ACTIVE );
3839
3940 return 0 ;
4041}
@@ -47,7 +48,9 @@ static void lis3mdl_gpio_callback(struct device *dev,
4748
4849 ARG_UNUSED (pins );
4950
50- gpio_pin_disable_callback (dev , DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN );
51+ gpio_pin_interrupt_configure (dev ,
52+ DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN ,
53+ GPIO_INT_DISABLE );
5154
5255#if defined(CONFIG_LIS3MDL_TRIGGER_OWN_THREAD )
5356 k_sem_give (& drv_data -> gpio_sem );
@@ -66,8 +69,9 @@ static void lis3mdl_thread_cb(void *arg)
6669 & drv_data -> data_ready_trigger );
6770 }
6871
69- gpio_pin_enable_callback (drv_data -> gpio ,
70- DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN );
72+ gpio_pin_interrupt_configure (drv_data -> gpio ,
73+ DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN ,
74+ GPIO_INT_EDGE_TO_ACTIVE );
7175}
7276
7377#ifdef CONFIG_LIS3MDL_TRIGGER_OWN_THREAD
@@ -110,8 +114,8 @@ int lis3mdl_init_interrupt(struct device *dev)
110114
111115 gpio_pin_configure (drv_data -> gpio ,
112116 DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN ,
113- GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
114- GPIO_INT_ACTIVE_HIGH | GPIO_INT_DEBOUNCE );
117+ GPIO_INPUT |
118+ DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_FLAGS );
115119
116120 gpio_init_callback (& drv_data -> gpio_cb ,
117121 lis3mdl_gpio_callback ,
@@ -148,8 +152,9 @@ int lis3mdl_init_interrupt(struct device *dev)
148152 drv_data -> dev = dev ;
149153#endif
150154
151- gpio_pin_enable_callback (drv_data -> gpio ,
152- DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN );
155+ gpio_pin_interrupt_configure (drv_data -> gpio ,
156+ DT_INST_0_ST_LIS3MDL_MAGN_IRQ_GPIOS_PIN ,
157+ GPIO_INT_EDGE_TO_ACTIVE );
153158
154159 return 0 ;
155160}
0 commit comments