main/task_ds18b20.h

changeset 2
c0184362d48c
parent 0
88d965579617
child 44
e52d11b8f252
equal deleted inserted replaced
1:1082183cd6bb 2:c0184362d48c
12 12
13 /* 13 /*
14 * Error codes in this task 14 * Error codes in this task
15 */ 15 */
16 #define DS18B20_ERR_NONE 0 ///< No errors 16 #define DS18B20_ERR_NONE 0 ///< No errors
17 #define DS18B20_ERR_NOSENSOR 1 ///< No sensor detected 17 #define DS18B20_ERR_CRC 1 ///< CRC read error
18 #define DS18B20_ERR_TOOMANY 2 ///< Too many sensors 18 #define DS18B20_ERR_READ 2 ///< Generic read error
19 #define DS18B20_ERR_CRC 3 ///< CRC read error 19
20 #define DS18B20_ERR_READ 4 ///< Generic read error 20 #define DS18B20_MAX 4
21
22 /**
23 * @brief Structure for a temperature sensor.
24 */
25 typedef struct strTempsensor {
26 double temperature; ///< Current temperature.
27 char rom_code[17]; ///< ROM code of this device.
28 int error; ///< Error number.
29 } tempsensor_t;
30
21 31
22 32
23 /** 33 /**
24 * @brief Structure containing the variables for the DS18B20 task. 34 * @brief Structure containing the variables for the DS18B20 task.
25 */ 35 */
26 typedef struct { 36 typedef struct {
27 bool bottle_valid; ///< Bottle sensor valid reading. 37 bool valid; ///< Sensor valid reading.
28 double bottle_temperature; ///< Current bottle temperature. 38 int num_sensors; ///< Number of sensors
29 int bottle_error; ///< Bottle error number. 39 tempsensor_t sensor[DS18B20_MAX]; ///< Temperature sensors
30 } DS18B20_State; 40 } DS18B20_State;
31 41
32 42
33 43
34 /** 44 /**

mercurial