pub struct I2c<C: AnyConfig> { /* private fields */ }
Expand description

Abstraction over a I2C peripheral, allowing to perform I2C transactions.

Implementations

Obtain a pointer to the DATA register. Necessary for DMA transfers.

Read the interrupt flags

Clear interrupt status flags

Enable interrupts for the specified flags.

Disable interrupts for the specified flags.

Read the status flags

Clear the status flags

Reconfigure the I2C peripheral.

Calling this method will temporarily disable the SERCOM peripheral, as some registers are enable-protected. This may interrupt any ongoing transactions.

use atsamd_hal::sercom::i2c::I2c;
i2c.reconfigure(|c| c.set_run_in_standby(false));

Disable the I2C peripheral and return the underlying Config

Trait Implementations

Converts this type into a shared reference of the (usually inferred) input type.

Error type

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

Error type

Writes bytes to slave with address address Read more

Error type

Writes bytes to slave with address address and then reads enough bytes to fill buffer in a single transaction 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.

Should always be Self

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.