pub struct BlockingI2c<Bus> { /* private fields */ }
Expand description
Implement the JrkG2
trait for Blocking I2C
Implementations§
Source§impl<Bus, I2cError> BlockingI2c<Bus>
impl<Bus, I2cError> BlockingI2c<Bus>
pub const fn new(i2c: Bus) -> Self
Sourcepub fn set_device(&mut self, device: u8)
pub fn set_device(&mut self, device: u8)
The controller have a default 0x0B I2C address, but this can be manually changed in the configuration utility.
Trait Implementations§
Source§impl<Bus, I2cError> JrkG2<I2cError> for BlockingI2c<Bus>
impl<Bus, I2cError> JrkG2<I2cError> for BlockingI2c<Bus>
fn write(&mut self, data: &[u8]) -> Result<(), I2cError>
fn read(&mut self, cmd: VarOffset) -> Result<u16, I2cError>
Source§fn set_target(&mut self, target: u16) -> Result<(), ComError>
fn set_target(&mut self, target: u16) -> Result<(), ComError>
Put the motor in motion Read more
Source§fn stop_motor(&mut self) -> Result<(), ComError>
fn stop_motor(&mut self) -> Result<(), ComError>
Stop the motor
Auto Trait Implementations§
impl<Bus> Freeze for BlockingI2c<Bus>where
Bus: Freeze,
impl<Bus> RefUnwindSafe for BlockingI2c<Bus>where
Bus: RefUnwindSafe,
impl<Bus> Send for BlockingI2c<Bus>where
Bus: Send,
impl<Bus> Sync for BlockingI2c<Bus>where
Bus: Sync,
impl<Bus> Unpin for BlockingI2c<Bus>where
Bus: Unpin,
impl<Bus> UnwindSafe for BlockingI2c<Bus>where
Bus: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more