|
1 #ifndef _BREWCO_H |
|
2 #define _BREWCO_H |
|
3 |
|
4 #define TRUE 1 |
|
5 #define FALSE 0 |
|
6 |
|
7 #include "../config.h" |
|
8 |
|
9 #include <stdlib.h> |
|
10 #include <stdio.h> |
|
11 #include <stdint.h> |
|
12 #include <stdarg.h> |
|
13 #include <string.h> |
|
14 #include <ctype.h> |
|
15 #include <sys/types.h> |
|
16 #include <sys/stat.h> |
|
17 #include <sys/time.h> |
|
18 #include <time.h> |
|
19 #include <fcntl.h> |
|
20 #include <syslog.h> |
|
21 #include <unistd.h> |
|
22 #include <errno.h> |
|
23 #include <signal.h> |
|
24 #include <getopt.h> |
|
25 |
|
26 #ifndef HAVE_WIRINGPI_H |
|
27 #include <pthread.h> |
|
28 #endif |
|
29 #include <libxml/xmlmemory.h> |
|
30 #include <libxml/parser.h> |
|
31 #include <libxml/encoding.h> |
|
32 #include <libxml/xmlwriter.h> |
|
33 |
|
34 #ifdef HAVE_WIRINGPI_H |
|
35 /* wiringPi */ |
|
36 #include <wiringPi.h> |
|
37 #include <pcf8574.h> |
|
38 #include <lcd.h> |
|
39 |
|
40 /* |
|
41 * Thread locks |
|
42 */ |
|
43 #define LOCK_DEVICES 0 |
|
44 #define LOCK_LCD 1 |
|
45 #define LOCK_MENU 2 |
|
46 #define LOCK_SPARE2 3 |
|
47 |
|
48 |
|
49 #endif |
|
50 |
|
51 /* |
|
52 * 1-Wire devices |
|
53 */ |
|
54 #define W1_FAMILY_DEFAULT 0 |
|
55 #define W1_FAMILY_SMEM_01 0x01 |
|
56 #define W1_FAMILY_SMEM_81 0x81 |
|
57 #define W1_THERM_DS18S20 0x10 |
|
58 #define W1_FAMILY_DS28E04 0x1C |
|
59 #define W1_COUNTER_DS2423 0x1D |
|
60 #define W1_THERM_DS1822 0x22 |
|
61 #define W1_EEPROM_DS2433 0x23 |
|
62 #define W1_THERM_DS18B20 0x28 |
|
63 #define W1_FAMILY_DS2408 0x29 |
|
64 #define W1_EEPROM_DS2431 0x2D |
|
65 #define W1_FAMILY_DS2760 0x30 |
|
66 #define W1_FAMILY_DS2780 0x32 |
|
67 #define W1_FAMILY_DS2413 0x3A |
|
68 #define W1_THERM_DS1825 0x3B |
|
69 #define W1_FAMILY_DS2781 0x3D |
|
70 #define W1_THERM_DS28EA00 0x42 |
|
71 |
|
72 |
|
73 #define MBSE_SS(x) (x)?(x):"(null)" |
|
74 |
|
75 |
|
76 typedef struct _sys_config { |
|
77 char *name; /* Configuration name */ |
|
78 unsigned char tempFormat; /* Temperature format, C or F */ |
|
79 char *hlt_sensor_address; /* HLT sensor address */ |
|
80 int hlt_sensor_state; /* HLT sensor state */ |
|
81 int hlt_sensor_value; /* HLT sensor value */ |
|
82 |
|
83 char *mlt_sensor_address; /* MLT sensor address */ |
|
84 int mlt_sensor_state; /* MLT sensor state */ |
|
85 int mlt_sensor_value; /* MLT sensor value */ |
|
86 |
|
87 #ifdef HAVE_WIRINGPI_H |
|
88 int lcd_cols; /* LCD display columns */ |
|
89 int lcd_rows; /* LCD display rows */ |
|
90 int lcd_address; /* LCD display i2c address */ |
|
91 #endif |
|
92 |
|
93 } sys_config; |
|
94 |
|
95 |
|
96 #endif |