1 /*
2  * Copyright (c) 2023 Wuerth Elektronik eiSos GmbH & Co. KG
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 /**
8  * @file
9  * @brief Header file for the WSEN-HIDS-2525020210002 sensor driver.
10  */
11 
12 #ifndef _WSEN_HIDS_2525020210002_H
13 #define _WSEN_HIDS_2525020210002_H
14 
15 /*         Includes         */
16 
17 #include <stdint.h>
18 #include "../WeSensorsSDK.h"
19 
20 /*         Register address definitions         */
21 #define CRC8_INIT 0xFF
22 #define CRC8_POLYNOMIAL 0x31
23 #define CRC8_LEN 1
24 #define HIDS_WORD_SIZE 2
25 
26 typedef enum
27 {
28 	HIDS_ADDRESS = 0x44,  /**< Sensor Address */
29 	HIDS_MEASURE_HPM = 0xFD,  /**< High precision measurement for T & RH */
30 	HIDS_MEASURE_MPM = 0xF6,  /**< Medium precision measurement for T & RH */
31 	HIDS_MEASURE_LPM = 0xE0,  /**< Low precision measurement for T & RH */
32 	HIDS_SOFT_RESET = 0x94,  /**< Soft reset */
33 	HIDS_HEATER_200_MW_01_S = 0x39,  /**< activate heater with 200mW for 1s, including a high precision measurement just before deactivation */
34 	HIDS_HEATER_200_MW_100_MS = 0x32,  /**< activate heater with 200mW for 0.1s, including a high precision measurement just before deactivation */
35 	HIDS_HEATER_110_MW_01_S = 0x2F,  /**< activate heater with 110mW for 1s, including a high precision measurement just before deactivation */
36 	HIDS_HEATER_110_MW_100_MS = 0x24,  /**< activate heater with 110mW for 0.1s, including a high precision measurement just before deactivation */
37 	HIDS_HEATER_20_MW_01_S = 0x1E,  /**< activate heater with 20mW for 01s, including a high precision measurement just before deactivation */
38 	HIDS_HEATER_20_MW_100_MS = 0x15,  /**< activate heater with 20mW for 0.1s, including a high precision measurement just before deactivation */
39 	HIDS_MEASURE_SERIAL_NUMBER = 0x89 /**< Device */
40 } hids_measureCmd_t;
41 
42 #ifdef __cplusplus
43 extern "C"
44 {
45 #endif
46 int8_t HIDS_Set_Measurement_Type(WE_sensorInterface_t* sensorInterface, hids_measureCmd_t precision);
47 int8_t HIDS_Sensor_Read_SlNo(WE_sensorInterface_t* sensorInterface, uint32_t* serialNo);
48 int8_t HIDS_Sensor_Init(WE_sensorInterface_t* sensorInterface);
49 int8_t HIDS_Reset(WE_sensorInterface_t* sensorInterface);
50 int8_t HIDS_Sensor_Measure_Raw(WE_sensorInterface_t* sensorInterface, hids_measureCmd_t meausureCmd, int32_t* temperatureRaw, int32_t* humidityRaw);
51 int8_t HIDS_Get_Default_Interface(WE_sensorInterface_t* sensorInterface);
52 #ifdef __cplusplus
53 }
54 #endif
55 
56 #endif /* _WSEN_HIDSNEW_H */
57