[−][src]Struct linux_embedded_hal::I2cdev
Newtype around i2cdev::linux::LinuxI2CDevice
that implements the embedded-hal
traits
Methods
impl I2cdev
[src]
pub fn new<P>(path: P) -> Result<Self, LinuxI2CError> where
P: AsRef<Path>,
[src]
P: AsRef<Path>,
See i2cdev::linux::LinuxI2CDevice::new
for details.
Methods from Deref<Target = LinuxI2CDevice>
pub fn set_slave_address(
&mut self,
slave_address: u16
) -> Result<(), LinuxI2CError>
[src]
&mut self,
slave_address: u16
) -> Result<(), LinuxI2CError>
Set the slave address for this device
Typically the address is expected to be 7-bits but 10-bit addresses may be supported by the kernel driver in some cases. Little validation is done in Rust as the kernel is good at making sure things are valid.
Note that if you have created a device using
I2Device::new(...)
it is not necesasry to call this method
(it is done internally). Calling this method is only
necessary if you need to change the slave device and you do
not want to create a new device.
Trait Implementations
impl Deref for I2cdev
[src]
type Target = LinuxI2CDevice
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl DerefMut for I2cdev
[src]
impl Read for I2cdev
[src]
type Error = LinuxI2CError
Error type
fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error>
[src]
impl Write for I2cdev
[src]
type Error = LinuxI2CError
Error type
fn write(&mut self, address: u8, bytes: &[u8]) -> Result<(), Self::Error>
[src]
impl WriteRead for I2cdev
[src]
Auto Trait Implementations
impl Send for I2cdev
impl Sync for I2cdev
impl Unpin for I2cdev
impl UnwindSafe for I2cdev
impl RefUnwindSafe for I2cdev
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,