From 4eaeb770ce41b491783096e4ba86942e6ee7819f Mon Sep 17 00:00:00 2001 From: vyeevani Date: Mon, 3 Jun 2024 16:17:37 -0700 Subject: [PATCH 1/3] adding support for xl430 --- src/device/xl430.rs | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 src/device/xl430.rs diff --git a/src/device/xl430.rs b/src/device/xl430.rs new file mode 100644 index 0000000..a29dcc1 --- /dev/null +++ b/src/device/xl430.rs @@ -0,0 +1,58 @@ +//! XL-430 robotis register (protocol v2) +//! +//! See for details. + +use crate::device::*; + +reg_read_only!(model_number, 0, u16); +reg_read_only!(model_information, 2, u32); +reg_read_only!(firmware_version, 6, u8); +reg_read_write!(id, 7, u8); +reg_read_write!(buad_rate, 8, u8); +reg_read_write!(return_delay_time, 9, u8); +reg_read_write!(drive_mode, 10, u8); +reg_read_write!(operating_mode, 11, u8); +reg_read_write!(secondary_id, 12, u8); +reg_read_write!(protocol_type, 13, u8); +reg_read_write!(homing_offset, 20, u32); +reg_read_write!(moving_threshold, 24, u32); +reg_read_write!(temperature_limit, 31, u8); +reg_read_write!(max_voltage_limit, 32, u16); +reg_read_write!(min_voltage_limit, 34, u16); +reg_read_write!(pwm_limit, 36, u16); +reg_read_write!(current_limit, 38, u16); +reg_read_write!(velocity_limit, 44, u32); +reg_read_write!(max_position_limit, 48, u32); +reg_read_write!(min_position_limit, 52, u32); +reg_read_write!(startup_configuration, 60, u8); +reg_read_write!(shutdown, 63, u8); + +reg_read_write!(torque_enable, 64, u8); +reg_read_write!(led, 65, u8); +reg_read_write!(status_return_level, 68, u8); +reg_read_only!(registered_instruction, 69, u8); +reg_read_only!(hardware_error_status, 70, u8); +reg_read_write!(velocity_i_gain, 76, u16); +reg_read_write!(velocity_p_gain, 78, u16); +reg_read_write!(position_d_gain, 80, u16); +reg_read_write!(position_i_gain, 82, u16); +reg_read_write!(feed_forward_gain_2, 88, u16); +reg_read_write!(feed_forward_gain_1, 90, u16); +reg_read_write!(bus_watchdog, 98, u8); +reg_read_write!(goal_pwm, 100, u16); +reg_read_write!(goal_current, 102, u16); +reg_read_write!(goal_velocity, 104, u32); +reg_read_write!(profile_acceleration, 108, u32); +reg_read_write!(profile_velocity, 112, u32); +reg_read_write!(goal_position, 116, u32); +reg_read_only!(realtime_tick, 120, u16); +reg_read_only!(moving, 122, u8); +reg_read_only!(moving_status, 123, u8); +reg_read_only!(present_pwm, 124, u16); +reg_read_only!(present_current, 128, u16); +reg_read_only!(present_position, 132, i32); +reg_read_only!(velocity_trajectory, 136, u32); +reg_read_only!(position_trajectory, 140, u32); +reg_read_only!(present_input_voltage, 144, u16); +reg_read_only!(present_temperature, 146, u8); +reg_read_only!(backup_ready, 147, u8); From 6bfc872759664e92dcc5c7c6d6ad90c795e605eb Mon Sep 17 00:00:00 2001 From: Steve Nguyen Date: Thu, 26 Sep 2024 12:31:12 +0000 Subject: [PATCH 2/3] Update xl430.rs --- src/device/xl430.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/device/xl430.rs b/src/device/xl430.rs index ab8af01..8b0ff7c 100644 --- a/src/device/xl430.rs +++ b/src/device/xl430.rs @@ -57,7 +57,6 @@ reg_read_only!(position_trajectory, 140, u32); reg_read_only!(present_input_voltage, 144, u16); reg_read_only!(present_temperature, 146, u8); reg_read_only!(backup_ready, 147, u8); - reg_read_write!(indirect_address_1, 168, u16); reg_read_write!(indirect_address_2, 170, u16); reg_read_write!(indirect_address_3, 172, u16); From 14a97163427d96004f9abf3c91391bb9751c8d37 Mon Sep 17 00:00:00 2001 From: Steve Nguyen Date: Thu, 26 Sep 2024 12:49:32 +0000 Subject: [PATCH 3/3] Trailling empty lines --- src/device/xl430.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/src/device/xl430.rs b/src/device/xl430.rs index 8b0ff7c..ec05ff1 100644 --- a/src/device/xl430.rs +++ b/src/device/xl430.rs @@ -69,4 +69,3 @@ reg_read_write!(indirect_data_3, 226, u8); reg_read_write!(indirect_data_4, 227, u8); reg_read_write!(indirect_data_5, 228, u8); reg_read_write!(indirect_data_6, 229, u8); -