diff options
Diffstat (limited to 'test/monniaux/tacle-bench-lift/liftlibcontrol.h')
-rw-r--r-- | test/monniaux/tacle-bench-lift/liftlibcontrol.h | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/test/monniaux/tacle-bench-lift/liftlibcontrol.h b/test/monniaux/tacle-bench-lift/liftlibcontrol.h new file mode 100644 index 00000000..2c6669e8 --- /dev/null +++ b/test/monniaux/tacle-bench-lift/liftlibcontrol.h @@ -0,0 +1,64 @@ +#ifndef LIFTLIBCONTROL_H +#define LIFTLIBCONTROL_H + +enum lift_Direction { + lift_GO_LOAD = 8, + lift_GO_TOP = 6, + lift_GO_BOTTOM = 7, + lift_GO_UP = 4, + lift_GO_DOWN = 5 +}; + +enum lift_Sensor { + lift_SENS_IMPULS = 0, + lift_SENS_TOP = 1, + lift_SENS_BOTTOM = 2, + lift_SENS_LOAD = 3 +}; + +enum lift_Motor { + lift_MOTOR_ON = 0, + lift_MOTOR_UP = 1 +}; + +enum lift_Command { + lift_CMD_NONE = 0, + lift_CMD_TOP = 1, + lift_CMD_BOTTOM = 2, + lift_CMD_UP = 3, + lift_CMD_DOWN = 4 +}; + +/* Global variables */ +extern int lift_levelPos[16]; +extern int lift_one_level; +extern int lift_cntValid; +extern int lift_cnt; +extern int lift_level; +extern int lift_loadLevel; +extern int lift_loadPending; +extern int lift_loadSensor; +extern int lift_cmd; +extern int lift_timMotor; +extern int lift_timImp; +extern int lift_directionUp; +extern int lift_lastImp; +extern int lift_dbgCnt; +extern int lift_endCnt; + +/* Checksum */ +extern int lift_checksum; + +/* prototypes */ +void lift_ctrl_init(void); /* DM prototype */ +void lift_ctrl_loop(void); /* DM prototype */ + +/* internal prototypes */ +int lift_check_run(void); +void lift_wait_for_motor_start(void); +void lift_do_cmd(void); +void lift_do_impulse( int val, int motor, int reset ); +void lift_check_cmd(void); +void lift_check_level(void); + +#endif |