You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by vi...@apache.org on 2019/08/02 18:40:35 UTC

[mynewt-core] branch master updated: hw/drivers/lps33thw:Added support to FIFO (#1941)

This is an automated email from the ASF dual-hosted git repository.

vipulrahane pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 6220fae  hw/drivers/lps33thw:Added support to FIFO (#1941)
6220fae is described below

commit 6220faec7612e2417b52819ac8c1a6d19499f493
Author: Mario Tesi <31...@users.noreply.github.com>
AuthorDate: Fri Aug 2 20:40:29 2019 +0200

    hw/drivers/lps33thw:Added support to FIFO (#1941)
    
    Add support to FIFO on LPS33THW driver
        FIFO supports the following features:
            - configurable FIFO watermark
            - interrupt on FIFO watermark
            - reading mode [polling, stream]
    
        Driver tested on STM32F4-Discovery board as "off board" device
        connected to I2C master interface.
    
    Signed-off-by: tesimari <ma...@st.com>
---
 .../sensors/lps33thw/include/lps33thw/lps33thw.h   |  27 ++
 hw/drivers/sensors/lps33thw/src/lps33thw.c         | 293 +++++++++++++++++++--
 hw/drivers/sensors/lps33thw/src/lps33thw_priv.h    |  13 +
 hw/drivers/sensors/lps33thw/syscfg.yml             |  10 +-
 4 files changed, 320 insertions(+), 23 deletions(-)

diff --git a/hw/drivers/sensors/lps33thw/include/lps33thw/lps33thw.h b/hw/drivers/sensors/lps33thw/include/lps33thw/lps33thw.h
index b4a7c1c..5417ddd 100644
--- a/hw/drivers/sensors/lps33thw/include/lps33thw/lps33thw.h
+++ b/hw/drivers/sensors/lps33thw/include/lps33thw/lps33thw.h
@@ -58,6 +58,25 @@ enum lps33thw_low_pass_config {
     LPS33THW_LPF_ENABLED_HIGH_BW = 0x03  /* Bandwidth = data rate / 20 */
 };
 
+/*
+ * Sensor read mode
+ *
+ * LPS33THW_READ_POLL enable polling mode
+ * LPS33THW_READ_STREAM enable FIFO read mode
+ */
+enum lps33thw_read_mode {
+    LPS33THW_READ_POLL = 0,
+    LPS33THW_READ_STREAM = 1,
+};
+
+struct lps33thw_int {
+    /* Synchronize access to this structure */
+    os_sr_t lock;
+
+    /* Sleep waiting for an interrupt to occur */
+    struct os_sem wait;
+};
+
 struct lps33thw_int_cfg {
     uint8_t pin;
     unsigned int data_rdy : 1;
@@ -66,8 +85,10 @@ struct lps33thw_int_cfg {
     unsigned int active_low : 1;
     unsigned int open_drain : 1;
     unsigned int latched : 1;
+    unsigned int fifo_wtm_rdy : 1;
 };
 
+
 struct lps33thw_cfg {
     sensor_type_t mask;
     struct lps33thw_int_cfg int_cfg;
@@ -76,10 +97,15 @@ struct lps33thw_cfg {
     unsigned int autozero : 1;
     unsigned int autorifp : 1;
     unsigned int low_noise_en: 1;
+    uint8_t fifo_wtm;
+    enum lps33thw_read_mode read_mode;
 };
 
 struct lps33thw_private_driver_data {
     struct sensor_read_ctx user_ctx;
+
+    /* Inetrrupt state */
+    struct lps33thw_int *interrupt;
 };
 
 struct lps33thw {
@@ -92,6 +118,7 @@ struct lps33thw {
     struct lps33thw_cfg cfg;
     os_time_t last_read_time;
     struct lps33thw_private_driver_data pdd;
+    struct lps33thw_int interrupt;
 #if MYNEWT_VAL(BUS_DRIVER_PRESENT)
     bool node_is_spi;
 #endif
diff --git a/hw/drivers/sensors/lps33thw/src/lps33thw.c b/hw/drivers/sensors/lps33thw/src/lps33thw.c
index ab8186c..d389359 100644
--- a/hw/drivers/sensors/lps33thw/src/lps33thw.c
+++ b/hw/drivers/sensors/lps33thw/src/lps33thw.c
@@ -139,6 +139,7 @@ static void lps33thw_one_shot_read_cb(struct os_event *ev)
     }
 }
 #endif
+
 /*
  * Converts pressure value in pascals to a value found in the pressure
  * threshold register of the device.
@@ -442,7 +443,7 @@ lps33thw_i2c_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size,
  */
 static int
 lps33thw_get_regs(struct sensor_itf *itf, uint8_t reg, uint8_t size,
-    uint8_t *buffer)
+		  uint8_t *buffer)
 {
     int rc;
 
@@ -665,6 +666,7 @@ lps33thw_enable_interrupt(struct sensor *sensor, hal_gpio_irq_handler_t handler,
         return rc;
     }
     (void)press;
+    lps33thw->pdd.interrupt = &lps33thw->interrupt;
 
     rc = lps33thw_get_regs(itf, LPS33THW_INT_SOURCE, 1, &int_source);
     if (rc) {
@@ -683,6 +685,7 @@ lps33thw_disable_interrupt(struct sensor *sensor)
 
     lps33thw = (struct lps33thw *)SENSOR_GET_DEVICE(sensor);
     int_cfg = &lps33thw->cfg.int_cfg;
+    lps33thw->pdd.interrupt = NULL;
 
     hal_gpio_irq_release(int_cfg->pin);
 }
@@ -776,7 +779,7 @@ lps33thw_config_interrupt(struct sensor *sensor, struct lps33thw_int_cfg cfg)
 
     lps33thw->cfg.int_cfg = cfg;
 
-    if (cfg.data_rdy) {
+    if (cfg.data_rdy || cfg.fifo_wtm_rdy) {
         rc = lps33thw_set_value(itf, LPS33THW_INTERRUPT_CFG_PLE, 0);
         if (rc) {
             return rc;
@@ -793,7 +796,7 @@ lps33thw_config_interrupt(struct sensor *sensor, struct lps33thw_int_cfg cfg)
         if (rc) {
             return rc;
         }
-    } else if (cfg.pressure_low || cfg.pressure_high){
+    } else if (cfg.pressure_low || cfg.pressure_high) {
         rc = lps33thw_set_value(itf, LPS33THW_INTERRUPT_CFG_PLE,
             cfg.pressure_low);
         if (rc) {
@@ -808,8 +811,8 @@ lps33thw_config_interrupt(struct sensor *sensor, struct lps33thw_int_cfg cfg)
         if (rc) {
             return rc;
         }
-        rc = lps33thw_set_value(itf, LPS33THW_CTRL_REG3_INT_S, cfg.pressure_high |
-            (cfg.pressure_low << 1));
+        rc = lps33thw_set_value(itf, LPS33THW_CTRL_REG3_INT_S,
+				cfg.pressure_high | (cfg.pressure_low << 1));
         if (rc) {
             return rc;
         }
@@ -823,6 +826,10 @@ lps33thw_config_interrupt(struct sensor *sensor, struct lps33thw_int_cfg cfg)
     if (rc) {
         return rc;
     }
+    rc = lps33thw_set_value(itf, LPS33THW_CTRL_REG3_FIFO_WTM, cfg.fifo_wtm_rdy);
+    if (rc) {
+        return rc;
+    }
     rc = lps33thw_set_value(itf, LPS33THW_CTRL_REG2_INT_H_L, cfg.active_low);
     if (rc) {
         return rc;
@@ -927,25 +934,27 @@ lps33thw_init(struct os_dev *dev, void *arg)
     struct lps33thw *lps;
     struct sensor *sensor;
     int rc;
+    os_error_t error;
 
     if (!arg || !dev) {
         return SYS_ENODEV;
     }
 
-    lps = (struct lps33thw *) dev;
+    lps = (struct lps33thw *)dev;
 #if MYNEWT_VAL(LPS33THW_ONE_SHOT_MODE)
-    os_callout_init(&lps->lps33thw_one_shot_read, sensor_mgr_evq_get(), lps33thw_one_shot_read_cb, dev);
+    os_callout_init(&lps->lps33thw_one_shot_read, sensor_mgr_evq_get(),
+		    lps33thw_one_shot_read_cb, dev);
 #endif
 
     sensor = &lps->sensor;
     lps->cfg.mask = SENSOR_TYPE_ALL;
 
     /* Initialise the stats entry */
-    rc = stats_init(
-        STATS_HDR(g_lps33thwstats),
+    rc = stats_init(STATS_HDR(g_lps33thwstats),
         STATS_SIZE_INIT_PARMS(g_lps33thwstats, STATS_SIZE_32),
         STATS_NAME_INIT_PARMS(lps33thw_stat_section));
     SYSINIT_PANIC_ASSERT(rc == 0);
+
     /* Register the entry with the stats registry */
     rc = stats_register(dev->od_name, STATS_HDR(g_lps33thwstats));
     SYSINIT_PANIC_ASSERT(rc == 0);
@@ -973,6 +982,10 @@ lps33thw_init(struct os_dev *dev, void *arg)
         return rc;
     }
 
+    /* Init semaphore for task to wait on when irq asleep */
+    error = os_sem_init(&(lps->interrupt.wait), 0);
+    assert(error == OS_OK);
+
 #if !MYNEWT_VAL(BUS_DRIVER_PRESENT)
     if (sensor->s_itf.si_type == SENSOR_ITF_SPI) {
         rc = hal_spi_config(sensor->s_itf.si_num, &spi_lps33thw_settings);
@@ -1003,10 +1016,9 @@ lps33thw_config(struct lps33thw *lps, struct lps33thw_cfg *cfg)
 {
     int rc;
     struct sensor_itf *itf;
+    uint8_t val;
 
     itf = SENSOR_GET_ITF(&(lps->sensor));
-
-    uint8_t val;
     rc = lps33thw_get_regs(itf, LPS33THW_WHO_AM_I, 1, &val);
     if (rc) {
         return rc;
@@ -1015,35 +1027,51 @@ lps33thw_config(struct lps33thw *lps, struct lps33thw_cfg *cfg)
         return SYS_EINVAL;
     }
 
-    rc = lps33thw_set_value(itf, LPS33THW_INTERRUPT_CFG_AUTORIFP, cfg->autorifp);
+    rc = lps33thw_set_value(itf, LPS33THW_INTERRUPT_CFG_AUTORIFP,
+			    cfg->autorifp);
     if (rc) {
         return rc;
     }
+    lps->cfg.autorifp = cfg->autorifp;
 
-    rc = lps33thw_set_value(itf, LPS33THW_INTERRUPT_CFG_AUTOZERO, cfg->autozero);
+    rc = lps33thw_set_value(itf, LPS33THW_INTERRUPT_CFG_AUTOZERO,
+			    cfg->autozero);
     if (rc) {
         return rc;
     }
+    lps->cfg.autozero = cfg->autozero;
 
     rc = lps33thw_set_data_rate(itf, cfg->data_rate);
     if (rc) {
         return rc;
     }
+    lps->cfg.data_rate = cfg->data_rate;
 
     rc = lps33thw_set_lpf(itf, cfg->lpf);
     if (rc) {
         return rc;
     }
+    lps->cfg.lpf = cfg->lpf;
 
-    rc = lps33thw_set_value(itf, LPS33THW_CTRL_REG2_LOW_NOISE_EN, cfg->low_noise_en);
+    rc = lps33thw_set_value(itf, LPS33THW_CTRL_REG2_LOW_NOISE_EN,
+			    cfg->low_noise_en);
     if (rc) {
         return rc;
     }
+    lps->cfg.low_noise_en = cfg->low_noise_en;
 
-    rc = lps33thw_config_interrupt(&(lps->sensor), cfg->int_cfg);
+    /* Configure FIFO watermark */
+    rc = lps33thw_set_value(itf, LPS33THW_FIFO_WTM_THR, cfg->fifo_wtm);
     if (rc) {
+        return rc;
+    }
+    lps->cfg.fifo_wtm = cfg->fifo_wtm;
 
+    rc = lps33thw_config_interrupt(&(lps->sensor), cfg->int_cfg);
+    if (rc) {
+        return rc;
     }
+    lps->cfg.int_cfg = cfg->int_cfg;
 
     rc = sensor_set_type_mask(&(lps->sensor), cfg->mask);
     if (rc) {
@@ -1051,6 +1079,7 @@ lps33thw_config(struct lps33thw *lps, struct lps33thw_cfg *cfg)
     }
 
     lps->cfg.mask = cfg->mask;
+    lps->cfg.read_mode = cfg->read_mode;
 
     return 0;
 }
@@ -1080,8 +1109,8 @@ lps33thw_read_interrupt_handler(void *arg)
 }
 
 static int
-lps33thw_sensor_read(struct sensor *sensor, sensor_type_t type,
-        sensor_data_func_t data_func, void *data_arg, uint32_t timeout)
+lps33thw_sensor_read_poll(struct sensor *sensor, sensor_type_t type,
+        sensor_data_func_t data_func, void *data_arg)
 {
     int rc = SYS_EINVAL;
     struct sensor_itf *itf = SENSOR_GET_ITF(sensor);
@@ -1093,8 +1122,6 @@ lps33thw_sensor_read(struct sensor *sensor, sensor_type_t type,
         return rc;
     }
 
-    (void)timeout;
-
 #if MYNEWT_VAL(LPS33THW_ONE_SHOT_MODE)
     if (rate != LPS33THW_75HZ) {
         lps33thw->data_func = data_func;
@@ -1123,7 +1150,7 @@ lps33thw_sensor_read(struct sensor *sensor, sensor_type_t type,
             if (rc) {
                 return rc;
             }
-        } else {
+	} else {
             /* Read once */
             struct sensor_press_data spd;
             rc = lps33thw_get_pressure(itf, &spd.spd_press);
@@ -1155,6 +1182,227 @@ lps33thw_sensor_read(struct sensor *sensor, sensor_type_t type,
     return rc;
 }
 
+static int lps33thw_read_fifo(struct sensor_itf *itf,
+			      struct sensor_temp_data *std,
+			      struct sensor_press_data *spd)
+{
+    int rc;
+    uint8_t fifo_data[5];
+    int32_t int_press;
+    int16_t int_temp;
+
+    rc = lps33thw_get_regs(itf, LPS33THW_FIFO_SDATA_OUT_PRESS, 5, fifo_data);
+    if (rc) {
+	return rc;
+    }
+
+    int_press = ((int8_t)fifo_data[2] << 16) | (fifo_data[1] << 8) | fifo_data[0];
+    spd->spd_press_is_valid = 1;
+    spd->spd_press = lps33thw_reg_to_pa(int_press);
+
+    int_temp = ((int8_t)fifo_data[4] << 8) | fifo_data[3];
+    std->std_temp_is_valid = 1;
+    std->std_temp = lps33thw_reg_to_degc(int_temp);
+
+    return 0;
+}
+
+static int lps33thw_wait_interrupt(struct lps33thw_int *interrupt)
+{
+    os_error_t error;
+
+    error = os_sem_pend(&interrupt->wait, LPS33THW_MAX_INT_WAIT);
+    if (error == OS_TIMEOUT) {
+	return error;
+    }
+    assert(error == OS_OK);
+
+    return OS_OK;
+}
+
+/**
+ * Wake tasks waiting on interrupt->wait lock
+ *
+ * This call resume task waiting on lps33thw_wake_interrupt lock
+ *
+ * @param the interrupt structure
+ *
+ * @return 0 on success, non-zero on failure
+ */
+static void lps33thw_wake_interrupt(struct lps33thw_int *interrupt)
+{
+    os_error_t error;
+
+    /* Release semaphore to wait_interrupt routine */
+    error = os_sem_release(&interrupt->wait);
+    assert(error == OS_OK);
+}
+
+/**
+ * Wake tasks waiting on interrupt->wait lock
+ *
+ * This call resume task waiting on lps33thw_wake_interrupt lock
+ *
+ * @param the interrupt structure
+ *
+ * @return 0 on success, non-zero on failure
+ */
+static void lps33thw_int_irq_handler(void *arg)
+{
+    struct sensor *sensor = arg;
+    struct lps33thw *lps33thw;
+
+    lps33thw = (struct lps33thw *)SENSOR_GET_DEVICE(sensor);
+
+    if(lps33thw->pdd.interrupt) {
+        lps33thw_wake_interrupt(lps33thw->pdd.interrupt);
+    }
+}
+
+/**
+ * Read data samples from FIFO
+ *
+ * FIFO store both SENSOR_TYPE_TEMPERATURE
+ * and SENSOR_TYPE_PRESSURE sample data
+ *
+ * @param sensor The sensor object
+ * @param type sensor type bitmask
+ * @param data_func callback register data function
+ * @param data_arg function arguments
+ * @param time_ms
+ *
+ * @return 0 on success, non-zero error on failure.
+ */
+int lps33thw_stream_read(struct sensor *sensor, sensor_type_t sensor_type,
+                        sensor_data_func_t read_func, void *data_arg,
+                        uint32_t time_ms)
+{
+    struct lps33thw *lps33thw;
+    struct lps33thw_private_driver_data *pdd;
+    struct sensor_itf *itf;
+    uint8_t fifo_samples;
+    os_time_t time_ticks;
+    os_time_t stop_ticks = 0;
+    int rc;
+    struct sensor_temp_data std;
+    struct sensor_press_data spd;
+
+    /* Temperature/Pressure only */
+    if (!(sensor_type & SENSOR_TYPE_TEMPERATURE) &&
+        !(sensor_type & SENSOR_TYPE_PRESSURE)) {
+        return SYS_EINVAL;
+    }
+
+    lps33thw  = (struct lps33thw *)SENSOR_GET_DEVICE(sensor);
+    if (lps33thw->cfg.read_mode != LPS33THW_READ_STREAM) {
+        return SYS_EINVAL;
+    }
+
+    pdd = &lps33thw->pdd;
+
+    itf = SENSOR_GET_ITF(sensor);
+
+    /* Enable FIFO */
+    rc = lps33thw_set_value(itf, LPS33THW_FIFO_CTRL_MODE,
+			    LPS33THW_FIFO_CONTINUOUS);
+    if (rc) {
+        goto err;
+    }
+
+   if (pdd->interrupt) {
+        return SYS_EBUSY;
+    }
+
+    rc = lps33thw_enable_interrupt(sensor, lps33thw_int_irq_handler, sensor);
+    if (rc) {
+        goto err;
+    }
+
+    /* Calculate timeout */
+    if (time_ms > 0) {
+        rc = os_time_ms_to_ticks(time_ms, &time_ticks);
+        if (rc) {
+            goto err;
+        }
+        stop_ticks = os_time_get() + time_ticks;
+    }
+
+    for (;;) {
+	/* Force at least one read for cases when fifo is disabled */
+	rc = lps33thw_wait_interrupt(lps33thw->pdd.interrupt);
+	if (rc) {
+	    goto err;
+	}
+
+	rc = lps33thw_get_regs(itf, LPS33THW_FIFO_STATUS1, 1, &fifo_samples);
+	if (rc) {
+	    goto err;
+	}
+
+	if (fifo_samples == 0)
+	    continue;
+
+	do {
+	    /* Read fifo samples */
+	    rc = lps33thw_read_fifo(itf, &std, &spd);
+	    if (rc) {
+		goto err;
+	    }
+
+	    if (sensor_type & SENSOR_TYPE_PRESSURE) {
+		rc = read_func(sensor, data_arg, &spd, SENSOR_TYPE_PRESSURE);
+		if (rc) {
+		    goto err;
+		}
+	    }
+	    if (sensor_type & SENSOR_TYPE_TEMPERATURE) {
+		rc = read_func(sensor, data_arg, &std, SENSOR_TYPE_TEMPERATURE);
+		if (rc) {
+		    goto err;
+		}
+	    }
+	fifo_samples--;
+	} while (fifo_samples > 0);
+
+	if (time_ms > 0 && OS_TIME_TICK_GT(os_time_get(), stop_ticks)) {
+	    break;
+	}
+    }
+
+err:
+    /* Disable FIFO */
+    rc |= lps33thw_set_value(itf, LPS33THW_FIFO_CTRL_MODE,
+			    LPS33THW_FIFO_BYPASS);
+
+    lps33thw_disable_interrupt(sensor);
+
+    return rc;
+}
+
+/**
+ * Sensor data read
+ *
+ * @param sensor The sensor object
+ * @param type sensor type bitmask
+ * @param data_func callback register data function
+ * @param data_arg function arguments
+ * @param timeout in ms
+ *
+ * @return 0 on success, non-zero error on failure.
+ */
+static int
+lps33thw_sensor_read(struct sensor *sensor, sensor_type_t type,
+        sensor_data_func_t data_func, void *data_arg, uint32_t timeout)
+{
+    struct lps33thw *lps33thw  = (struct lps33thw *)SENSOR_GET_DEVICE(sensor);
+
+    if (lps33thw->cfg.read_mode == LPS33THW_READ_POLL) {
+        return lps33thw_sensor_read_poll(sensor, type, data_func, data_arg);
+    }
+
+    return lps33thw_stream_read(sensor, type, data_func, data_arg, timeout);
+}
+
 static int
 lps33thw_sensor_set_config(struct sensor *sensor, void *cfg)
 {
@@ -1167,7 +1415,10 @@ static int
 lps33thw_sensor_get_config(struct sensor *sensor, sensor_type_t type,
         struct sensor_cfg *cfg)
 {
-    /* If the read isn't looking for pressure, don't do anything. */
+    /*
+     * If the read isn't looking for pressure or temperature
+     * don't do anything.
+     */
     if (!(type & (SENSOR_TYPE_PRESSURE | SENSOR_TYPE_TEMPERATURE))) {
         return SYS_EINVAL;
     }
diff --git a/hw/drivers/sensors/lps33thw/src/lps33thw_priv.h b/hw/drivers/sensors/lps33thw/src/lps33thw_priv.h
index 7b9706e..71ab665 100644
--- a/hw/drivers/sensors/lps33thw/src/lps33thw_priv.h
+++ b/hw/drivers/sensors/lps33thw/src/lps33thw_priv.h
@@ -24,6 +24,9 @@
 extern "C" {
 #endif
 
+/* Max time to wait for interrupt */
+#define LPS33THW_MAX_INT_WAIT (4 * OS_TICKS_PER_SEC)
+
 enum lps33thw_registers {
     LPS33THW_INTERRUPT_CFG = 0x0b,
     LPS33THW_THS_P = 0x0c,
@@ -46,6 +49,11 @@ enum lps33thw_registers {
     LPS33THW_FIFO_SDATA_OUT_TEMP = 0x7b,
 };
 
+enum lps33thw_fifo_mode {
+    LPS33THW_FIFO_BYPASS = 0x00,
+    LPS33THW_FIFO_CONTINUOUS = 0x02,
+};
+
 /* registers */
 struct lps33thw_register_value {
     uint8_t reg;
@@ -86,8 +94,13 @@ LPS33THW_REGISTER_VALUE(LPS33THW_CTRL_REG3, LPS33THW_CTRL_REG3_F_FULL, 5, 0x20);
 LPS33THW_REGISTER_VALUE(LPS33THW_CTRL_REG3, LPS33THW_CTRL_REG3_F_FTH, 4, 0x10);
 LPS33THW_REGISTER_VALUE(LPS33THW_CTRL_REG3, LPS33THW_CTRL_REG3_F_OVR, 3, 0x08);
 LPS33THW_REGISTER_VALUE(LPS33THW_CTRL_REG3, LPS33THW_CTRL_REG3_DRDY, 2, 0x04);
+LPS33THW_REGISTER_VALUE(LPS33THW_CTRL_REG3, LPS33THW_CTRL_REG3_FIFO_WTM, 4, 0x10);
 LPS33THW_REGISTER_VALUE(LPS33THW_CTRL_REG3, LPS33THW_CTRL_REG3_INT_S, 0, 0x03);
 
+LPS33THW_REGISTER_VALUE(LPS33THW_FIFO_CTRL, LPS33THW_FIFO_CTRL_MODE, 0, 0x07);
+
+LPS33THW_REGISTER_VALUE(LPS33THW_FIFO_WTM, LPS33THW_FIFO_WTM_THR, 0, 0x7f);
+
 LPS33THW_REGISTER_VALUE(LPS33THW_INT_SOURCE, LPS33THW_INT_SOURCE_IA, 2, 0x04);
 LPS33THW_REGISTER_VALUE(LPS33THW_INT_SOURCE, LPS33THW_INT_SOURCE_PL, 1, 0x02);
 LPS33THW_REGISTER_VALUE(LPS33THW_INT_SOURCE, LPS33THW_INT_SOURCE_PH, 0, 0x01);
diff --git a/hw/drivers/sensors/lps33thw/syscfg.yml b/hw/drivers/sensors/lps33thw/syscfg.yml
index dd503cc..4948e11 100644
--- a/hw/drivers/sensors/lps33thw/syscfg.yml
+++ b/hw/drivers/sensors/lps33thw/syscfg.yml
@@ -36,7 +36,14 @@ syscfg.defs:
         description: 'Enables one shot mode on the sensor'
         value: 0
 
-syscfg.defs.!BUS_DRIVER_PRESENT:
+    LPS33THW_INT_CFG_ACTIVE:
+        description: 'Set 0 for active-low, 1 for active-high'
+        value: 1
+
+    LPS33THW_INT_PIN_HOST:
+        description: 'Interrupt pin number on host device connected to INT_DRDY on device'
+        value: 23
+
     LPS33THW_SHELL_ITF_NUM:
         description: 'Shell interface number for the LPS33THW'
         value: 0
@@ -50,7 +57,6 @@ syscfg.defs.!BUS_DRIVER_PRESENT:
         description: 'Slave address for LPS33THW'
         value : 0x5C
 
-syscfg.defs.BUS_DRIVER_PRESENT:
     LPS33THW_SHELL_NODE_NAME:
         description: 'Bus node name for the LPS33THW'
         value: '"lps33thw"'