thermferm/thermferm.h

changeset 66
805f1d285acd
parent 54
c06190a58f22
child 71
a09c5cdc4022
equal deleted inserted replaced
65:a08a1fce439e 66:805f1d285acd
62 int present; /* 1=present, 0=absent */ 62 int present; /* 1=present, 0=absent */
63 int lastval; /* Last valid value */ 63 int lastval; /* Last valid value */
64 int update; /* Value updated */ 64 int update; /* Value updated */
65 } w1_therm; 65 } w1_therm;
66 66
67 #ifdef HAVE_WIRINGPI_H
67 typedef struct _rc_switch { 68 typedef struct _rc_switch {
68 struct _rc_switch *next; 69 struct _rc_switch *next;
69 char *address; /* Address code */ 70 char *address; /* Address code */
70 char *alias; /* Friendly name */ 71 char *alias; /* Friendly name */
71 } rc_switch; 72 } rc_switch;
73 #endif
72 74
73 typedef struct _sys_config { 75 typedef struct _sys_config {
74 char *name; /* Configuration name */ 76 char *name; /* Configuration name */
75 int my_port; /* my client/server port */ 77 int my_port; /* my client/server port */
76 w1_therm *w1therms; /* 1-wire temp sensors */ 78 w1_therm *w1therms; /* 1-wire temp sensors */
79 #ifdef HAVE_WIRINGPI_H
77 int lcd_cols; /* LCD display columns */ 80 int lcd_cols; /* LCD display columns */
78 int lcd_rows; /* LCD display rows */ 81 int lcd_rows; /* LCD display rows */
79 int tx433; /* 433 MHz transmitter pin */ 82 int tx433; /* 433 MHz transmitter pin */
80 rc_switch *rcswitch; /* 433 MHz RC Power switches */ 83 rc_switch *rcswitch; /* 433 MHz RC Power switches */
84 #endif
81 /* ControlSettings: */ 85 /* ControlSettings: */
82 unsigned char cs_mode; /* mode */ 86 unsigned char cs_mode; /* mode */
83 float cs_beerSet; /* beer temperature */ 87 float cs_beerSet; /* beer temperature */
84 float cs_fridgeSet; /* fridge temperature */ 88 float cs_fridgeSet; /* fridge temperature */
85 float cs_heatEstimator; 89 float cs_heatEstimator;
128 int initLCD (int, int); 132 int initLCD (int, int);
129 void mb_lcdPutchar(const int, unsigned char); 133 void mb_lcdPutchar(const int, unsigned char);
130 void mb_lcdPuts(const int, const char *); 134 void mb_lcdPuts(const int, const char *);
131 void mb_lcdClear(const int); 135 void mb_lcdClear(const int);
132 136
137 #endif
133 138
134 /* logger.c */ 139 /* logger.c */
135 void logger(char *, char *, char *); 140 void logger(char *, char *, char *);
136 141
137 142
138 /* rc-switch.c */ 143 /* rc-switch.c */
144 #ifdef HAVE_WIRINGPI_H
139 int toggleSwitch(char *); 145 int toggleSwitch(char *);
140 int toggleTypeA(char *, char *, bool); 146 int toggleTypeA(char *, char *, bool);
141 int toggleTypeB(int, int, bool); 147 int toggleTypeB(int, int, bool);
142 int toggleTypeC(char, int, int, bool); 148 int toggleTypeC(char, int, int, bool);
143 int toggleTypeE(char, int, bool); 149 int toggleTypeE(char, int, bool);
156 162
157 void enableTransmit(int); 163 void enableTransmit(int);
158 void disableTransmit(void); 164 void disableTransmit(void);
159 165
160 char *dec2binWzerofill(unsigned long, unsigned int); 166 char *dec2binWzerofill(unsigned long, unsigned int);
161 167 #endif
162 168
163 /* dht11.c */ 169 /* dht11.c */
164 void dht11Read(void); 170 void dht11Read(void);
165 void dht11Init(int, int, int); 171 void dht11Init(int, int, int);
166 172
167 173 #ifdef HAVE_WIRINGPI_H
168 PI_THREAD (my_sensors_loop); 174 PI_THREAD (my_sensors_loop);
175 #else
176 int my_sensors_loop(void);
177 #endif
169 178
170 /* server.c */ 179 /* server.c */
171 void defaultControlSettings(void); 180 void defaultControlSettings(void);
172 void defaultControlConstants(void); 181 void defaultControlConstants(void);
182 #ifdef HAVE_WIRINGPI_H
173 PI_THREAD (my_server_loop); 183 PI_THREAD (my_server_loop);
174 184 #else
185 int my_server_loop(void);
175 #endif 186 #endif
176 187
177 188
178 #endif 189 #endif
179 190

mercurial