blob: abdfa8f634dc69ce7c54b8981dfde73489b47a52 (
plain)
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
|
#ifndef MAIN_H_
#define MAIN_H_
#include "util.h"
#include <stdint.h>
struct pressure_config {
/* Desired pressure in mBar */
uint16_t desired;
/* Pressure hysteresis in mBar */
uint16_t hysteresis;
/* Auto-adjustment is enabled. */
bool autoadjust_enable;
};
struct pressure_state {
/* Current pressure in the tank (in mBar) */
uint16_t mbar;
/* True, if the current pressure value needs checking against
* the desired pressure config. */
bool needs_checking;
/* Trigger count:
* >0 = waiting
* 0 = trigger now
* -1 = triggered and running. */
int8_t sensor_trigger_cnt;
/* Current valves state (enum valves_global_state) */
uint8_t valves;
};
void get_pressure_config(struct pressure_config *cfg);
void get_pressure_state(struct pressure_state *state);
#endif /* MAIN_H_ */
|