main/task_ds18b20.h

changeset 2
c0184362d48c
parent 0
88d965579617
child 44
e52d11b8f252
--- a/main/task_ds18b20.h	Tue Oct 08 12:55:23 2019 +0200
+++ b/main/task_ds18b20.h	Tue Oct 08 15:47:34 2019 +0200
@@ -14,19 +14,29 @@
  * Error codes in this task
  */
 #define	DS18B20_ERR_NONE		0			///< No errors
-#define DS18B20_ERR_NOSENSOR		1			///< No sensor detected
-#define	DS18B20_ERR_TOOMANY		2			///< Too many sensors
-#define	DS18B20_ERR_CRC			3			///< CRC read error
-#define	DS18B20_ERR_READ		4			///< Generic read error
+#define	DS18B20_ERR_CRC			1			///< CRC read error
+#define	DS18B20_ERR_READ		2			///< Generic read error
+
+#define	DS18B20_MAX			4
+
+/**
+ * @brief Structure for a temperature sensor.
+ */
+typedef struct strTempsensor {
+    double      temperature;            	///< Current temperature.
+    char        rom_code[17];           	///< ROM code of this device.
+    int         error;                  	///< Error number.
+} tempsensor_t;
+
 
 
 /**
  * @brief Structure containing the variables for the DS18B20 task.
  */
 typedef struct {
-    bool   bottle_valid;		///< Bottle sensor valid reading.
-    double bottle_temperature;		///< Current bottle temperature.
-    int    bottle_error;		///< Bottle error number.
+    bool		valid;			///< Sensor valid reading.
+    int			num_sensors;		///< Number of sensors
+    tempsensor_t	sensor[DS18B20_MAX];	///< Temperature sensors
 } DS18B20_State;
 
 

mercurial