cobboard updated
[aversive.git] / projects / microb2010 / common / i2c_commands.h
index 49cdb8e..87f98c7 100644 (file)
 #define I2C_COBBOARD_ADDR    2
 #define I2C_BALLBOARD_ADDR   3
 
-#define I2C_LEFT_SIDE   0
-#define I2C_RIGHT_SIDE  1
-#define I2C_AUTO_SIDE   2
-#define I2C_CENTER_SIDE 3
+#define I2C_LEFT_SIDE    0
+#define I2C_RIGHT_SIDE   1
+#define I2C_AUTO_SIDE    2
+#define I2C_CENTER_SIDE  3
 
-#define I2C_COLOR_RED   0
-#define I2C_COLOR_GREEN 1
+#define I2C_COLOR_YELLOW 0
+#define I2C_COLOR_BLUE   1
 
 #define I2C_COB_BLACK   0
 #define I2C_COB_WHITE   1
@@ -80,6 +80,22 @@ struct i2c_cmd_cobboard_set_mode {
        uint8_t mode;
 };
 
+#define I2C_CMD_BALLBOARD_SET_MODE 0x10
+
+struct i2c_cmd_ballboard_set_mode {
+       struct i2c_cmd_hdr hdr;
+
+#define I2C_BALLBOARD_MODE_INIT        0x00
+#define I2C_BALLBOARD_MODE_OFF         0x01
+#define I2C_BALLBOARD_MODE_HARVEST     0x02
+#define I2C_BALLBOARD_MODE_EJECT       0x03
+#define I2C_BALLBOARD_MODE_PREP_L_FORK 0x04
+#define I2C_BALLBOARD_MODE_TAKE_L_FORK 0x05
+#define I2C_BALLBOARD_MODE_PREP_R_FORK 0x06
+#define I2C_BALLBOARD_MODE_TAKE_R_FORK 0x07
+       uint8_t mode;
+};
+
 /****/
 /* requests and their answers */
 /****/
@@ -121,6 +137,7 @@ struct i2c_req_ballboard_status {
 struct i2c_ans_ballboard_status {
        struct i2c_cmd_hdr hdr;
 
+       uint8_t mode;
 
 #define I2C_BALLBOARD_STATUS_F_READY         0x00
 #define I2C_BALLBOARD_STATUS_F_BUSY          0x01