pub struct I2cdev { /* private fields */ }
Expand description

Newtype around i2cdev::linux::LinuxI2CDevice that implements the embedded-hal traits

Implementations

Methods from Deref<Target = LinuxI2CDevice>

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.

Enable/Disable PEC support for this device

Used only for SMBus transactions. This request only has an effect if the the adapter has I2C_FUNC_SMBUS_PEC; it is still safe if not, it just doesn’t have any effect.

Trait Implementations

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Error type

Reads enough bytes from slave with address to fill buffer Read more

Writes bytes to slave with address address Read more

Writes bytes to slave with address address Read more

Writes bytes to slave with address address and then reads enough bytes to fill buffer in a single transaction Read more

Writes bytes to slave with address address and then reads enough bytes to fill buffer in a single transaction Read more

Execute the provided operations on the I2C bus. Read more

Execute the provided operations on the I2C bus (iterator version). Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.