1 /*
2  * Copyright (c) 2023 Würth Elektronik eiSos GmbH & Co. KG
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #ifndef ZEPHYR_DRIVERS_SENSOR_WSEN_PDUS_WSEN_PDUS_H_
8 #define ZEPHYR_DRIVERS_SENSOR_WSEN_PDUS_WSEN_PDUS_H_
9 
10 #include <zephyr/drivers/gpio.h>
11 #include <zephyr/drivers/sensor.h>
12 
13 #include <weplatform.h>
14 
15 #include "WSEN_PDUS_25131308XXX01.h"
16 
17 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(i2c)
18 #include <zephyr/drivers/i2c.h>
19 #endif /* DT_ANY_INST_ON_BUS_STATUS_OKAY(i2c) */
20 
21 struct pdus_data {
22 	/* WE sensor interface configuration */
23 	WE_sensorInterface_t sensor_interface;
24 
25 	/* Last pressure sample */
26 	float pressure_k_pa;
27 
28 	/* Last temperature sample */
29 	float temperature_deg_c;
30 };
31 
32 struct pdus_config {
33 	union {
34 #if DT_ANY_INST_ON_BUS_STATUS_OKAY(i2c)
35 		const struct i2c_dt_spec i2c;
36 #endif
37 	} bus_cfg;
38 
39 	PDUS_SensorType_t sensor_type;
40 };
41 
42 int pdus_i2c_init(const struct device *dev);
43 
44 #endif /* ZEPHYR_DRIVERS_SENSOR_WSEN_PDUS_WSEN_PDUS_H_ */
45