thermferm/thermferm.h

changeset 158
f1b7e2ef90be
parent 157
259a018758f9
child 162
6fc9e3f7962f
equal deleted inserted replaced
157:259a018758f9 158:f1b7e2ef90be
133 #define PROFILE_OFF 0 /* Profile not active */ 133 #define PROFILE_OFF 0 /* Profile not active */
134 #define PROFILE_PAUSE 1 /* Profile pause */ 134 #define PROFILE_PAUSE 1 /* Profile pause */
135 #define PROFILE_RUN 2 /* Profile is running */ 135 #define PROFILE_RUN 2 /* Profile is running */
136 #define PROFILE_DONE 3 /* Profile is finished */ 136 #define PROFILE_DONE 3 /* Profile is finished */
137 137
138 /*
139 * External devices like sensors, relays.
140 */
141 typedef struct _dev_list {
142 struct _dev_list *next;
143 int version; /* Version 1 */
144 char *uuid; /* UUID of this device */
145 int type; /* Device type */
146 int direction; /* Device direction */
147 int value; /* Device value */
148 int present; /* Device present */
149 char *address; /* Device address */
150 int subdevice; /* Device sub address */
151 int gpiopin; /* Device GPIO pin or -1 */
152 char *description; /* Device description */
153 int inuse; /* In use counter */
154 char *comment; /* What we think it is */
155 time_t timestamp; /* Last updated */
156 } devices_list;
157
158 #define DEVTYPE_NA 0 /* Unknown device type */
159 #define DEVTYPE_W1 1 /* 1-Wire bus */
160 #define DEVTYPE_GPIO 2 /* GPIO I/O device */
161 #define DEVTYPE_RC433 3 /* 433 MHz device */
162 #define DEVTYPE_DHT 4 /* DHT type device on GPIO */
163 #define DEVTYPE_I2C 5 /* I2C bus device */
164 #define DEVTYPE_SPI 6 /* SPI bus device */
165
166 #define DEVPRESENT_UNDEF 0 /* Precence not testable */
167 #define DEVPRESENT_NO 1 /* Device is missing */
168 #define DEVPRESENT_YES 2 /* Device is detected */
169 #define DEVPRESENT_ERROR 3 /* Device is in error */
170
171 #define DEVDIR_UNDEF 0 /* Undefined */
172 #define DEVDIR_IN_BIN 1 /* Binary input */
173 #define DEVDIR_OUT_BIN 2 /* Binary output */
174 #define DEVDIR_IN_ANALOG 3 /* Temperature input etc. */
175 #define DEVDIR_OUT_ANALOG 4 /* Analog steering */
176 #define DEVDIR_OUT_PWM 5 /* PWM outout */
177
138 178
139 typedef struct _w1_therm { 179 typedef struct _w1_therm {
140 struct _w1_therm *next; 180 struct _w1_therm *next;
141 char *master; /* Master for this device */ 181 char *master; /* Master for this device */
142 int bus; /* Reserved for ds2482-800 */ 182 int bus; /* Reserved for ds2482-800 */
160 int lcd_rows; /* LCD display rows */ 200 int lcd_rows; /* LCD display rows */
161 int lcd_address; /* LCD display i2c address */ 201 int lcd_address; /* LCD display i2c address */
162 #endif 202 #endif
163 units_list *units; /* Fermenter units */ 203 units_list *units; /* Fermenter units */
164 profiles_list *profiles; /* Ferment profiles */ 204 profiles_list *profiles; /* Ferment profiles */
205 devices_list *devices; /* Sensors and switches */
165 } sys_config; 206 } sys_config;
166 207
167 208
168 209
169 #endif 210 #endif

mercurial