From db9e05c6c4a8ae17ad9c0426aad5cec3f3b6ecf2 Mon Sep 17 00:00:00 2001 From: Jérémy Dufour Date: Fri, 8 May 2009 21:40:03 +0200 Subject: * digital/io: - add functions to reset the arm or the elevator to the zero position. --- digital/io/src/asserv.c | 14 ++++++++++++++ digital/io/src/asserv.h | 15 +++++++++++++++ 2 files changed, 29 insertions(+) (limited to 'digital/io') diff --git a/digital/io/src/asserv.c b/digital/io/src/asserv.c index e6cbc1b4..c9594d3d 100644 --- a/digital/io/src/asserv.c +++ b/digital/io/src/asserv.c @@ -661,3 +661,17 @@ asserv_set_scale (uint32_t scale) asserv_scale_inv = fixed_div_f824 (1L << 24, scale); } +void +asserv_arm_zero_position (void) +{ + asserv_twi_buffer_param[0] = ASSERV_ARM_SPEED_DEFAULT; + asserv_twi_send_command ('B', 1); +} + +void +asserv_elevator_zero_position (void) +{ + asserv_twi_buffer_param[0] = ASSERV_ELVT_SPEED_DEFAULT; + asserv_twi_send_command ('C', 1); +} + diff --git a/digital/io/src/asserv.h b/digital/io/src/asserv.h index 07950244..52cd0440 100644 --- a/digital/io/src/asserv.h +++ b/digital/io/src/asserv.h @@ -38,6 +38,9 @@ * ignored. */ +#define ASSERV_ARM_SPEED_DEFAULT 0x16 +#define ASSERV_ELVT_SPEED_DEFAULT 0x30 + /** * Initialize the asserv control module. * This functions does not initialize the asserv board, but the underling @@ -346,4 +349,16 @@ asserv_arm_position_reached (void); void asserv_set_scale (uint32_t scale); +/** + * Reset the ARM to the zero position. + */ +void +asserv_arm_zero_position (void); + +/** + * Reset the elevator to the zero position. + */ +void +asserv_elevator_zero_position (void); + #endif /* asserv_h */ -- cgit v1.2.3