-
Notifications
You must be signed in to change notification settings - Fork 1
/
mcu_command.h
48 lines (32 loc) · 965 Bytes
/
mcu_command.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
/*
* Library to describe commands that can be sent to the motor
*/
#ifndef _MOTOR_COMMAND_H_
#define _MOTOR_COMMAND_H_
/* valid functions */
/* set an actuator to HIGH state */
#define MC_SET_ACTUATOR 1
/* set an actuator to LOW state */
#define MC_CLR_ACTUATOR 2
/* using bitmask, set actuators to HIGH state */
#define MC_SET_ACTUATOR_MASK 3
/* using bitmask, set actuators to LOW state */
#define MC_CLR_ACTUATOR_MASK 4
/* set all actuators to bitmask states */
#define MC_SET_STATES 5
/* number of manometers */
#define MANOMETERS_NUM 4
/* actuators id numbers */
#define ACTUATORS_NUM 6
#define VALVE_A 0
#define VALVE_B 1
#define VALVE_C 2
#define VALVE_D 3
#define VALVE_E 4
#define PISTON 5
/* validation functions */
/* check if a motor command function is valid */
int mc_valid_function(int function);
/* check if a motor command argument to a function is valid */
int mc_valid_arg(int function, int arg);
#endif /* _MOTOR_COMMAND_H_ */