Skip to main content

Motor

Struct Motor 

Source
pub struct Motor<I: Read + Write> { /* private fields */ }

Implementations§

Source§

impl<I: Read + Write> Motor<I>

Source

pub async fn modbus_enabled(&mut self) -> Result<bool>

Source

pub async fn set_modbus_enabled(&mut self, value: bool) -> Result<()>

Source

pub async fn drive_enabled(&mut self) -> Result<bool>

Source

pub async fn set_drive_enabled(&mut self, value: bool) -> Result<()>

Source

pub async fn target_rpm(&mut self) -> Result<u16>

Gets the target speed in RPM

In speed mode, this is the target speed. In position mode, this is the maximum speed.

Source

pub async fn set_target_rpm(&mut self, value: u16) -> Result<()>

Sets the target speed in RPM

0-3000 RPM. In speed mode, this is the target speed. In position mode, this is the maximum speed.

Source

pub async fn acceleration(&mut self) -> Result<u16>

Source

pub async fn set_acceleration(&mut self, value: u16) -> Result<()>

Source

pub async fn weak_magnetic_angle(&mut self) -> Result<u16>

Source

pub async fn set_weak_magnetic_angle(&mut self, value: u16) -> Result<()>

Source

pub async fn speed_kp(&mut self) -> Result<u16>

Source

pub async fn set_speed_kp(&mut self, value: u16) -> Result<()>

Source

pub async fn speed_i_time(&mut self) -> Result<Duration>

Source

pub async fn set_speed_i_time(&mut self, value: Duration) -> Result<()>

Source

pub async fn position_kp(&mut self) -> Result<u16>

Source

pub async fn set_position_kp(&mut self, value: u16) -> Result<()>

Source

pub async fn speed_feed(&mut self) -> Result<f32>

Source

pub async fn set_speed_feed(&mut self, value: f32) -> Result<()>

Source

pub async fn dir_polarity(&mut self) -> Result<Direction>

Source

pub async fn set_dir_polarity(&mut self, value: Direction) -> Result<()>

Source

pub async fn electronic_gear_numerator(&mut self) -> Result<u16>

Source

pub async fn set_electronic_gear_numerator(&mut self, value: u16) -> Result<()>

Set numerator of electronic gear ratio

0-65535 0 enables special functions

Source

pub async fn electronic_gear_denominator(&mut self) -> Result<u16>

Source

pub async fn set_electronic_gear_denominator( &mut self, value: u16, ) -> Result<()>

Set denominator of electronic gear ratio

1-65535

Source

pub async fn target_position(&mut self) -> Result<u32>

Source

pub async fn set_target_position(&mut self, value: u32) -> Result<()>

Source

pub async fn alarm_code(&mut self) -> Result<Option<AlarmCode>>

Source

pub async fn current(&mut self) -> Result<f32>

Source

pub async fn speed(&mut self) -> Result<f32>

Source

pub async fn voltage(&mut self) -> Result<f32>

Source

pub async fn temperature(&mut self) -> Result<u16>

Source

pub async fn pwm(&mut self) -> Result<u16>

Source

pub async fn parameter_save_flag(&mut self) -> Result<bool>

Source

pub async fn set_parameter_save_flag(&mut self, value: bool) -> Result<()>

Source

pub async fn device_address(&mut self) -> Result<u16>

Source

pub async fn absolute_position(&mut self) -> Result<u32>

Source

pub async fn set_absolute_position(&mut self, value: u32) -> Result<()>

Source

pub async fn still_maximum_allowed_current(&mut self) -> Result<u16>

Source

pub async fn set_still_maximum_allowed_current( &mut self, value: u16, ) -> Result<()>

Source

pub async fn specific_function(&mut self) -> Result<u16>

Source

pub async fn set_specific_function(&mut self, value: u16) -> Result<()>

Source§

impl<I: Read + Write> Motor<I>

Source

pub fn new( comm: I, baud: RtuBaud, address: u8, response_timeout: Duration, ) -> Self

Source

pub async fn set_baud_rate(&mut self, baud: RtuBaud) -> Result<()>

Source

pub async fn set_target_position_custom(&mut self, value: u32) -> Result<()>

Source

pub async fn set_absolute_position_custom(&mut self, value: u32) -> Result<()>

Auto Trait Implementations§

§

impl<I> Freeze for Motor<I>
where I: Freeze,

§

impl<I> RefUnwindSafe for Motor<I>
where I: RefUnwindSafe,

§

impl<I> Send for Motor<I>
where I: Send,

§

impl<I> Sync for Motor<I>
where I: Sync,

§

impl<I> Unpin for Motor<I>
where I: Unpin,

§

impl<I> UnsafeUnpin for Motor<I>
where I: UnsafeUnpin,

§

impl<I> UnwindSafe for Motor<I>
where I: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.