summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware/main.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2008-10-18 23:47:05 +0200
committerMichael Buesch <mb@bu3sch.de>2008-10-18 23:47:05 +0200
commit4b0babc1b1daaece0d8de672f98adaf6cff5cdac (patch)
tree58c4bbac00ca8a76af06b006a392279ae6729907 /pressure_control/firmware/main.h
parent4a914e8c559cd48173bed088e2122d1d35c8de9b (diff)
downloadcnc-4b0babc1b1daaece0d8de672f98adaf6cff5cdac.tar.xz
cnc-4b0babc1b1daaece0d8de672f98adaf6cff5cdac.zip
Add a loooot of stuff to pressure_control
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control/firmware/main.h')
-rw-r--r--pressure_control/firmware/main.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/pressure_control/firmware/main.h b/pressure_control/firmware/main.h
new file mode 100644
index 0000000..abdfa8f
--- /dev/null
+++ b/pressure_control/firmware/main.h
@@ -0,0 +1,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_ */
bues.ch cgit interface