@@ -26,7 +26,9 @@ static void ti_hdc_gpio_callback(struct device *dev,
2626
2727 ARG_UNUSED (pins );
2828
29- gpio_pin_disable_callback (dev , DT_INST_0_TI_HDC_DRDY_GPIOS_PIN );
29+ gpio_pin_interrupt_configure (drv_data -> gpio ,
30+ DT_INST_0_TI_HDC_DRDY_GPIOS_PIN ,
31+ GPIO_INT_DISABLE );
3032 k_sem_give (& drv_data -> data_sem );
3133}
3234#endif
@@ -39,7 +41,9 @@ static int ti_hdc_sample_fetch(struct device *dev, enum sensor_channel chan)
3941 __ASSERT_NO_MSG (chan == SENSOR_CHAN_ALL );
4042
4143#if defined(DT_INST_0_TI_HDC_DRDY_GPIOS_CONTROLLER )
42- gpio_pin_enable_callback (drv_data -> gpio , DT_INST_0_TI_HDC_DRDY_GPIOS_PIN );
44+ gpio_pin_interrupt_configure (drv_data -> gpio ,
45+ DT_INST_0_TI_HDC_DRDY_GPIOS_PIN ,
46+ GPIO_INT_EDGE_TO_ACTIVE );
4347#endif
4448
4549 buf [0 ] = TI_HDC_REG_TEMP ;
@@ -150,11 +154,7 @@ static int ti_hdc_init(struct device *dev)
150154 }
151155
152156 gpio_pin_configure (drv_data -> gpio , DT_INST_0_TI_HDC_DRDY_GPIOS_PIN ,
153- GPIO_DIR_IN | GPIO_INT | GPIO_INT_EDGE |
154- #if defined(DT_INST_0_TI_HDC_DRDY_GPIOS_FLAGS )
155- DT_INST_0_TI_HDC_DRDY_GPIOS_FLAGS |
156- #endif
157- GPIO_INT_ACTIVE_LOW | GPIO_INT_DEBOUNCE );
157+ GPIO_INPUT | DT_INST_0_TI_HDC_DRDY_GPIOS_FLAGS );
158158
159159 gpio_init_callback (& drv_data -> gpio_cb ,
160160 ti_hdc_gpio_callback ,
@@ -164,6 +164,10 @@ static int ti_hdc_init(struct device *dev)
164164 LOG_DBG ("Failed to set GPIO callback" );
165165 return - EIO ;
166166 }
167+
168+ gpio_pin_interrupt_configure (drv_data -> gpio ,
169+ DT_INST_0_TI_HDC_DRDY_GPIOS_PIN ,
170+ GPIO_INT_EDGE_TO_ACTIVE );
167171#endif
168172
169173 LOG_INF ("Initialized device successfully" );
0 commit comments