-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.h
128 lines (103 loc) · 2.74 KB
/
config.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
#include <stdint.h>
#include <math.h>
#include <string.h>
#ifndef CONFIG_H
#define CONFIG_H
#define USE_RFM69
//#define SERIALDEBUG
// FIXME: USE_GPS is not optional yet, code needs to be fixed.
#define USE_GPS
#define USE_DHT
#define USE_BME280
#define USE_ONEWIRE
/* TODO Config options */
extern char node_name[9]; // null-terminated string, max 8 bytes, A-z0-9
extern uint8_t node_name_len;
extern char hops; // '0'-'9'
extern uint16_t broadcast_interval;
struct rfm69_config_t {
bool enabled:1;
bool listen:1;
uint8_t txpower:5;
uint8_t txpower_low:5;
float frequency;
float frequency_trim;
};
extern rfm69_config_t rfm69_cfg;
extern float latitude;
extern float longitude;
extern float altitude;
const uint8_t PAYLOADSIZE = 64;
extern double vsense_offset;
extern double vsense_mult;
extern bool vbat_enabled;
extern int vbat_pin;
extern double vbat_offset;
extern double vbat_mult;
extern bool vpanel_enabled;
extern int vpanel_pin;
extern double vpanel_offset;
extern double vpanel_mult;
extern bool powersave;
extern double powersave_treshold;
struct bme280_config_t {
bool enabled:1;
struct {
bool enabled:1;
uint8_t oversampling:3;
uint8_t decimals:2;
} temperature, pressure, humidity;
};
extern bme280_config_t bme280_cfg;
struct dht_config_t {
bool enabled:1;
struct {
bool enabled:1;
uint8_t decimals:2;
} temperature, humidity;
};
extern dht_config_t dht_cfg;
const uint32_t ONEWIRE_SAMPLE_TIME = 750;
const uint8_t ONEWIRE_CONFIG_MAX_DEVICES = 8;
struct onewire_config_t {
bool enabled:1;
uint8_t pin:6;
bool initial:1; // initial search performed
uint8_t decimals:3; // decimal precission, 0-7
struct {
bool enabled:1;
bool present:1;
uint8_t address[8];
} ds[ONEWIRE_CONFIG_MAX_DEVICES];
};
extern onewire_config_t onewire_cfg;
// TODO:40 Implement configuration protocol.
/* EEPROM SETTINGS
ukhasnet_enabled bool
ukhasnet_interval int
onewire_enabled bool
onewire_pin int
dht_enabled bool
dht_pin int
rfm69_enabled bool
rfm69_chipselect_pin int
rfm69_reset_pin int
rfm69_interrupt_pin int
rfm69_frequency float
rfm69_frequency_offset float
nrf24_enabled bool
nrf24_chipselect_pin int
nrf24_channel int
vbatsense_enabled bool
vbatsense_pin int
vbatsense_multiplier float
vbatsense_offset float
photoresistor_enabled bool
photoresistor_pin int
gps_enabled bool
location_latitude float
location_longitude float
location_altitude float
cputemp_enabled bool
*/
#endif