[][src]Trait jrk_g2_rs::JrkG2

pub trait JrkG2<ComError> {
    pub const HEADER: &'static str;

    pub fn write(&mut self, data: &[u8]) -> Result<(), ComError>;
pub fn read(&mut self, cmd: VarOffset) -> Result<u16, ComError>; pub fn set_target(&mut self, target: u16) -> Result<(), ComError> { ... }
pub fn stop_motor(&mut self) -> Result<(), ComError> { ... }
pub fn show_var<W: Write>(
        &mut self,
        f: &mut W,
        var: VarOffset
    ) -> Result<(), ComError> { ... }
pub fn show_vars<W: Write>(&mut self, f: &mut W) -> Result<(), ComError> { ... }
pub fn ushow_var<W: uWrite>(
        &mut self,
        f: &mut W,
        var: VarOffset
    ) -> Result<(), ComError> { ... }
pub fn ushow_vars<W: uWrite>(&mut self, f: &mut W) -> Result<(), ComError> { ... } }

Trait that defines common operations for the Jrk G2, and has to be implemented for any particular communication bus (currently available: Serial / I2C / Blocking I2C).

Associated Constants

pub const HEADER: &'static str[src]

Loading content...

Required methods

pub fn write(&mut self, data: &[u8]) -> Result<(), ComError>[src]

pub fn read(&mut self, cmd: VarOffset) -> Result<u16, ComError>[src]

Loading content...

Provided methods

pub fn set_target(&mut self, target: u16) -> Result<(), ComError>[src]

Put the motor in motion

the target should be between 0 and 4095, and its meaning depends on the configurtion on the controller, usually made by USB

pub fn stop_motor(&mut self) -> Result<(), ComError>[src]

Stop the motor

pub fn show_var<W: Write>(
    &mut self,
    f: &mut W,
    var: VarOffset
) -> Result<(), ComError>
[src]

Print one of the internal variables of the controller to a fmt::Write implementor

pub fn show_vars<W: Write>(&mut self, f: &mut W) -> Result<(), ComError>[src]

Print main internal variables of the controller to a fmt::Write implementor

pub fn ushow_var<W: uWrite>(
    &mut self,
    f: &mut W,
    var: VarOffset
) -> Result<(), ComError>
[src]

Print one of the internal variables of the controller to a uWrite

pub fn ushow_vars<W: uWrite>(&mut self, f: &mut W) -> Result<(), ComError>[src]

Print main internal variables of the controller to a uWrite implementor

Loading content...

Implementors

impl<I2c, I2cError> JrkG2<I2cError> for JrkG2BlockingI2c<I2c> where
    I2c: Write<Error = Error<I2cError>> + Read<Error = Error<I2cError>>, 
[src]

impl<I2c, I2cError> JrkG2<I2cError> for JrkG2I2c<I2c> where
    I2c: Write<Error = I2cError> + Read<Error = I2cError>, 
[src]

impl<Serial> JrkG2<<Serial as Read<u8>>::Error> for JrkG2Serial<Serial> where
    Serial: Read<u8> + Write<u8>, 
[src]

Loading content...