Struct stm32g0xx_hal::i2c::I2c

source ·
pub struct I2c<I2C, SDA, SCL> { /* private fields */ }
Expand description

I2C abstraction

Implementations§

Trait Implementations§

Enable/Disable Slave Byte Control. Default SBC is switched on. For master write/read the transaction should start with sbc disabled. So ACK will be send on the last received byte. Before the send phase SBC should be enabled again.
An optional tuple is returned with the address as sent by the master. The address is for 7 bit in range of 0..127
Wait until this slave is addressed by the master. A tuple is returned with the address as sent by the master. The address is for 7 bit in range of 0..127
Start writing the bytes, the master want to receive. If OK returned, all bytes are transferred If the master wants more data than bytes.len() the master will run into a timeout, This function will return Ok(()) If the master wants less data than bytes.len(), the function will return IncorrectFrameSize(bytes.len() + 1)
Start reading the bytes, send by the master . If OK returned, all bytes are transferred If the master want to send more bytes than the slave can recieve the slave will NACK the n+1 byte In this case the function will return IncorrectFrameSize(bytes.len() + 1) If the master did send a STOP before all bytes are recieve, the slave will return IncorrectFrameSize(actual nr of bytes send)
Enable/Disable Slave Byte Control. Default SBC is switched on. For master write/read the transaction should start with sbc disabled. So ACK will be send on the last received byte. Before the send phase SBC should be enabled again.
An optional tuple is returned with the address as sent by the master. The address is for 7 bit in range of 0..127
Wait until this slave is addressed by the master. A tuple is returned with the address as sent by the master. The address is for 7 bit in range of 0..127
Start writing the bytes, the master want to receive. If OK returned, all bytes are transferred If the master wants more data than bytes.len() the master will run into a timeout, This function will return Ok(()) If the master wants less data than bytes.len(), the function will return IncorrectFrameSize(bytes.len() + 1)
Start reading the bytes, send by the master . If OK returned, all bytes are transferred If the master want to send more bytes than the slave can recieve the slave will NACK the n+1 byte In this case the function will return IncorrectFrameSize(bytes.len() + 1) If the master did send a STOP before all bytes are recieve, the slave will return IncorrectFrameSize(actual nr of bytes send)
Error type
Reads enough bytes from slave with address to fill buffer Read more
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 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
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.

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.