diff --git a/drivers/ads101x/Kconfig b/drivers/ads101x/Kconfig index 4a1fc80e7b..6e1e91a438 100644 --- a/drivers/ads101x/Kconfig +++ b/drivers/ads101x/Kconfig @@ -14,7 +14,8 @@ config MODULE_ADS101X select MODULE_PERIPH_GPIO select MODULE_PERIPH_GPIO_IRQ select MODULE_PERIPH_I2C - select MODULE_XTIMER + select MODULE_ZTIMER + select MODULE_ZTIMER_MSEC help This driver works with the ads1013, ads1014, ads1015, ads1113, ads1114 and ads1115 models. diff --git a/drivers/ads101x/Makefile.dep b/drivers/ads101x/Makefile.dep index ac9f3060a5..b8ca432d94 100644 --- a/drivers/ads101x/Makefile.dep +++ b/drivers/ads101x/Makefile.dep @@ -1,3 +1,4 @@ FEATURES_REQUIRED += periph_gpio_irq FEATURES_REQUIRED += periph_i2c -USEMODULE += xtimer +USEMODULE += ztimer +USEMODULE += ztimer_msec diff --git a/drivers/ads101x/ads101x.c b/drivers/ads101x/ads101x.c index 973d300246..3b7974c15c 100644 --- a/drivers/ads101x/ads101x.c +++ b/drivers/ads101x/ads101x.c @@ -22,7 +22,7 @@ #include "assert.h" #include "periph/i2c.h" #include "periph/gpio.h" -#include "xtimer.h" +#include "ztimer.h" #include "ads101x.h" #include "ads101x_params.h" @@ -31,8 +31,8 @@ #define ENABLE_DEBUG 0 #include "debug.h" -#ifndef ADS101X_READ_DELAY -#define ADS101X_READ_DELAY (8 * US_PER_MS) /* Compatible with 128SPS */ +#ifndef ADS101X_READ_DELAY_MS +#define ADS101X_READ_DELAY_MS 8 /* ompatible with 128SPS */ #endif #define DEV (dev->params.i2c) @@ -138,7 +138,7 @@ int ads101x_read_raw(const ads101x_t *dev, int16_t *raw) i2c_write_regs(DEV, ADDR, ADS101X_CONF_ADDR, ®s, 2, 0x0); /* Wait for the sample to be acquired */ - xtimer_usleep(ADS101X_READ_DELAY); + ztimer_sleep(ZTIMER_MSEC, ADS101X_READ_DELAY_MS); /* Read the sample */ if (i2c_read_regs(DEV, ADDR, ADS101X_CONV_RES_ADDR, ®s, 2, 0x0) < 0) {