Struct alt_stm32f30x_hal::i2c::I2c [−][src]
pub struct I2c<I2C, PINS> { /* fields omitted */ }
I2C peripheral operating in master mode
Methods
impl<SCL, SDA> I2c<I2C1, (SCL, SDA)>
[src]
impl<SCL, SDA> I2c<I2C1, (SCL, SDA)>
pub fn i2c1<F>(
i2c: I2C1,
pins: (SCL, SDA),
freq: F,
clocks: Clocks,
apb1: &mut APB1
) -> Self where
F: Into<Hertz>,
SCL: SclPin<I2C1>,
SDA: SdaPin<I2C1>,
[src]
pub fn i2c1<F>(
i2c: I2C1,
pins: (SCL, SDA),
freq: F,
clocks: Clocks,
apb1: &mut APB1
) -> Self where
F: Into<Hertz>,
SCL: SclPin<I2C1>,
SDA: SdaPin<I2C1>,
Configures the I2C peripheral to work in master mode
pub fn free(self) -> (I2C1, (SCL, SDA))
[src]
pub fn free(self) -> (I2C1, (SCL, SDA))
Releases the I2C peripheral and associated pins
impl<SCL, SDA> I2c<I2C2, (SCL, SDA)>
[src]
impl<SCL, SDA> I2c<I2C2, (SCL, SDA)>
pub fn i2c2<F>(
i2c: I2C2,
pins: (SCL, SDA),
freq: F,
clocks: Clocks,
apb1: &mut APB1
) -> Self where
F: Into<Hertz>,
SCL: SclPin<I2C2>,
SDA: SdaPin<I2C2>,
[src]
pub fn i2c2<F>(
i2c: I2C2,
pins: (SCL, SDA),
freq: F,
clocks: Clocks,
apb1: &mut APB1
) -> Self where
F: Into<Hertz>,
SCL: SclPin<I2C2>,
SDA: SdaPin<I2C2>,
Configures the I2C peripheral to work in master mode
pub fn free(self) -> (I2C2, (SCL, SDA))
[src]
pub fn free(self) -> (I2C2, (SCL, SDA))
Releases the I2C peripheral and associated pins
Trait Implementations
impl<PINS> Write for I2c<I2C1, PINS>
[src]
impl<PINS> Write for I2c<I2C1, PINS>
type Error = Error
Error type
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>
[src]
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>
Sends bytes to slave with address addr
Read more
impl<PINS> WriteRead for I2c<I2C1, PINS>
[src]
impl<PINS> WriteRead for I2c<I2C1, PINS>
type Error = Error
Error type
fn write_read(
&mut self,
addr: u8,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Error>
[src]
fn write_read(
&mut self,
addr: u8,
bytes: &[u8],
buffer: &mut [u8]
) -> Result<(), Error>
Sends bytes to slave with address addr
and then reads enough bytes to fill buffer
in a single transaction Read more
impl<PINS> Write for I2c<I2C2, PINS>
[src]
impl<PINS> Write for I2c<I2C2, PINS>
type Error = Error
Error type
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>
[src]
fn write(&mut self, addr: u8, bytes: &[u8]) -> Result<(), Error>
Sends bytes to slave with address addr
Read more
impl<PINS> WriteRead for I2c<I2C2, PINS>
[src]
impl<PINS> WriteRead for I2c<I2C2, PINS>