Struct tm4c123x_hal::i2c::I2c

source ·
pub struct I2c<I2C, PINS> {
    pub i2c: I2C,
    pub pins: PINS,
}
Expand description

I2C peripheral operating in master mode

Fields§

§i2c: I2C

Underlying I2C peripheral

§pins: PINS

Underlying GPIO pins used by peripheral

Implementations§

source§

impl<SCL, SDA> I2c<I2C0, (SCL, SDA)>

source

pub fn i2c0<F>( i2c: I2C0, pins: (SCL, SDA), freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCL: SclPin<I2C0>, SDA: SdaPin<I2C0>,

Configures the I2C peripheral to work in master mode

source

pub fn free(self) -> (I2C0, (SCL, SDA))

Releases the I2C peripheral and associated pins

source§

impl<SCL, SDA> I2c<I2C1, (SCL, SDA)>

source

pub fn i2c1<F>( i2c: I2C1, pins: (SCL, SDA), freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCL: SclPin<I2C1>, SDA: SdaPin<I2C1>,

Configures the I2C peripheral to work in master mode

source

pub fn free(self) -> (I2C1, (SCL, SDA))

Releases the I2C peripheral and associated pins

source§

impl<SCL, SDA> I2c<I2C2, (SCL, SDA)>

source

pub fn i2c2<F>( i2c: I2C2, pins: (SCL, SDA), freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCL: SclPin<I2C2>, SDA: SdaPin<I2C2>,

Configures the I2C peripheral to work in master mode

source

pub fn free(self) -> (I2C2, (SCL, SDA))

Releases the I2C peripheral and associated pins

source§

impl<SCL, SDA> I2c<I2C3, (SCL, SDA)>

source

pub fn i2c3<F>( i2c: I2C3, pins: (SCL, SDA), freq: F, clocks: &Clocks, pc: &PowerControl ) -> Selfwhere F: Into<Hertz>, SCL: SclPin<I2C3>, SDA: SdaPin<I2C3>,

Configures the I2C peripheral to work in master mode

source

pub fn free(self) -> (I2C3, (SCL, SDA))

Releases the I2C peripheral and associated pins

Trait Implementations§

source§

impl<PINS> Read<u8> for I2c<I2C0, PINS>

§

type Error = Error

Error type
source§

fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Error>

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

impl<PINS> Read<u8> for I2c<I2C1, PINS>

§

type Error = Error

Error type
source§

fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Error>

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

impl<PINS> Read<u8> for I2c<I2C2, PINS>

§

type Error = Error

Error type
source§

fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Error>

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

impl<PINS> Read<u8> for I2c<I2C3, PINS>

§

type Error = Error

Error type
source§

fn read(&mut self, addr: u8, buffer: &mut [u8]) -> Result<(), Error>

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

impl<PINS> Write<u8> for I2c<I2C0, PINS>

§

type Error = Error

Error type
source§

fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>

Writes bytes to slave with address address Read more
source§

impl<PINS> Write<u8> for I2c<I2C1, PINS>

§

type Error = Error

Error type
source§

fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>

Writes bytes to slave with address address Read more
source§

impl<PINS> Write<u8> for I2c<I2C2, PINS>

§

type Error = Error

Error type
source§

fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>

Writes bytes to slave with address address Read more
source§

impl<PINS> Write<u8> for I2c<I2C3, PINS>

§

type Error = Error

Error type
source§

fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>

Writes bytes to slave with address address Read more
source§

impl<PINS> WriteRead<u8> for I2c<I2C0, PINS>

§

type Error = Error

Error type
source§

fn write_read( &mut self, addr: u8, bytes: &[u8], buffer: &mut [u8] ) -> Result<(), Error>

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

impl<PINS> WriteRead<u8> for I2c<I2C1, PINS>

§

type Error = Error

Error type
source§

fn write_read( &mut self, addr: u8, bytes: &[u8], buffer: &mut [u8] ) -> Result<(), Error>

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

impl<PINS> WriteRead<u8> for I2c<I2C2, PINS>

§

type Error = Error

Error type
source§

fn write_read( &mut self, addr: u8, bytes: &[u8], buffer: &mut [u8] ) -> Result<(), Error>

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

impl<PINS> WriteRead<u8> for I2c<I2C3, PINS>

§

type Error = Error

Error type
source§

fn write_read( &mut self, addr: u8, bytes: &[u8], buffer: &mut [u8] ) -> Result<(), Error>

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

Auto Trait Implementations§

§

impl<I2C, PINS> RefUnwindSafe for I2c<I2C, PINS>where I2C: RefUnwindSafe, PINS: RefUnwindSafe,

§

impl<I2C, PINS> Send for I2c<I2C, PINS>where I2C: Send, PINS: Send,

§

impl<I2C, PINS> Sync for I2c<I2C, PINS>where I2C: Sync, PINS: Sync,

§

impl<I2C, PINS> Unpin for I2c<I2C, PINS>where I2C: Unpin, PINS: Unpin,

§

impl<I2C, PINS> UnwindSafe for I2c<I2C, PINS>where I2C: UnwindSafe, PINS: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.