[−][src]Struct imxrt_hal::i2c::I2C
An I2C master
By default, the I2C master runs at 100KHz, Use set_clock_speed
to vary
the I2C bus speed.
Implementations
impl<M> I2C<M> where
M: Module,
[src]
M: Module,
pub fn set_clock_speed(
&mut self,
clock_speed: ClockSpeed
) -> Result<(), ClockSpeedError>
[src]
&mut self,
clock_speed: ClockSpeed
) -> Result<(), ClockSpeedError>
Set the I2C master clock speed
pub fn set_pin_low_timeout(
&mut self,
timeout: Duration
) -> Result<(), PinLowTimeoutError>
[src]
&mut self,
timeout: Duration
) -> Result<(), PinLowTimeoutError>
Set the pin low timeout
If SCL or, either SCL or SDA, is low for longer than the specified duration, then the
I2C hardware indicates an error. If the timeout is 0
, then the detection is disabled.
If the number of cycles required to represent the duration is too large, returns a
PinLowTimeoutError
. Try using a smaller duration.
pub fn set_bus_idle_timeout(
&mut self,
timeout: Duration
) -> Result<(), BusIdleTimeoutError>
[src]
&mut self,
timeout: Duration
) -> Result<(), BusIdleTimeoutError>
Set the bus idle timeout
If both SCL and SDA are high for longer than the timeout, then the I2C bus is assumed to be
idle and the master can generate a START condition. If the timeout is 0
, then the idle is
disabled.
If the number of cycles required to represent the duration is too large, returns a
BusIdleTimeoutError
. Try using a smaller timeout.
Trait Implementations
impl<M> Read for I2C<M> where
M: Module,
[src]
M: Module,
type Error = Error
Error type
fn read(&mut self, address: u8, buffer: &mut [u8]) -> Result<(), Self::Error>
[src]
impl<M> Write for I2C<M> where
M: Module,
[src]
M: Module,
type Error = Error
Error type
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Self::Error>
[src]
impl<M> WriteRead for I2C<M> where
M: Module,
[src]
M: Module,
Auto Trait Implementations
impl<M> Send for I2C<M> where
M: Send,
M: Send,
impl<M> !Sync for I2C<M>
impl<M> Unpin for I2C<M> where
M: Unpin,
M: Unpin,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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>,