summaryrefslogtreecommitdiff
path: root/digital/ai/src/twi_master
diff options
context:
space:
mode:
Diffstat (limited to 'digital/ai/src/twi_master')
-rw-r--r--digital/ai/src/twi_master/mimot.c11
-rw-r--r--digital/ai/src/twi_master/mimot.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/digital/ai/src/twi_master/mimot.c b/digital/ai/src/twi_master/mimot.c
index cc66a280..6346f7b9 100644
--- a/digital/ai/src/twi_master/mimot.c
+++ b/digital/ai/src/twi_master/mimot.c
@@ -257,3 +257,14 @@ mimot_motor1_free (void)
twi_master_send_buffer (2);
}
+void
+mimot_motor_output_set (uint8_t motor, int16_t pwm)
+{
+ uint8_t *buffer = twi_master_get_buffer (MIMOT_SLAVE);
+ buffer[0] = 'W';
+ buffer[1] = motor;
+ buffer[2] = v16_to_v8 (pwm, 1);
+ buffer[3] = v16_to_v8 (pwm, 0);
+ twi_master_send_buffer (4);
+}
+
diff --git a/digital/ai/src/twi_master/mimot.h b/digital/ai/src/twi_master/mimot.h
index 35b2dfbe..157ab4e1 100644
--- a/digital/ai/src/twi_master/mimot.h
+++ b/digital/ai/src/twi_master/mimot.h
@@ -122,4 +122,8 @@ mimot_motor0_free (void);
void
mimot_motor1_free (void);
+/** Set raw output for motor. */
+void
+mimot_motor_output_set (uint8_t motor, int16_t pwm);
+
#endif /* mimot_h */