summaryrefslogtreecommitdiffstats
path: root/pressure_control/firmware/valves.h
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2009-04-10 16:56:51 +0200
committerMichael Buesch <mb@bu3sch.de>2009-04-10 16:56:51 +0200
commit75a29d4d986e32bd82bc6468bba11567932a5349 (patch)
treec0a426aa40bf7f44bf87353460d9230326f77fac /pressure_control/firmware/valves.h
parente54d84019bac17f0a7ac49e9147471ff5df85a02 (diff)
downloadcnc-75a29d4d986e32bd82bc6468bba11567932a5349.tar.xz
cnc-75a29d4d986e32bd82bc6468bba11567932a5349.zip
pressure_control: Fix automatic pressure control
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'pressure_control/firmware/valves.h')
-rw-r--r--pressure_control/firmware/valves.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/pressure_control/firmware/valves.h b/pressure_control/firmware/valves.h
index e7a5e74..320505d 100644
--- a/pressure_control/firmware/valves.h
+++ b/pressure_control/firmware/valves.h
@@ -1,6 +1,8 @@
#ifndef VALVES_H_
#define VALVES_H_
+#include "util.h"
+
#include <stdint.h>
@@ -13,12 +15,20 @@ enum valves_global_state {
/* State for one valve. */
enum valve_state {
+ VALVE_STATE_IDLE,
VALVE_STATE_12,
VALVE_STATE_14,
};
+/* Wait for the valve to toggle from one position to another. */
+static inline void valve_wait_toggle(void)
+{
+ mdelay(10);
+}
+
void valves_init(void);
void valves_global_switch(uint8_t global_state);
+uint8_t valves_get_global_state(void);
void valve0_switch(uint8_t state);
void valve1_switch(uint8_t state);
bues.ch cgit interface