I2C
Twi represents a struct containing registers for TWI.
Function Definition#
Sets DDRC to write direction.
Sets DDRC to write direction.
Trait implementation#
Impl new for Twi#
Returns pointer to TWBR.
Impl wait_to_complete for Twi#
Waits for the process to be complete.
Returns if process was successful.
Impl init for Twi#
Initiates the Twi bus.
Impl start for Twi#
Sends a start signal.
Impl rep_start for Twi#
Sends a Repeat Start Signal
Impl stop for Twi`#
Stops the Twi bus.
Impl set_address for Twi#
Sets address of Slave.
Returns true if process is successful
Impl address_read for Twi#
Checks if slave is acknowledged.
Returns true if process is successful
Impl write for Twi#
Writes one byte of data to the Slave. Need to set address first.
Returns true if process is successful
Impl write_burstfor Twi#
Writes consecutive bytes of data to the Slave. Need to set address first.
Returns number of bytes written
Impl write_to_slave for Twi#
Writes consecutive Data bytes to slave.
Returns true if process is completed and aborts if any of the steps.
Impl start for Twi#
Reads consecutive Data bytes from slave.
Returns true if process is completed and aborts if any of the steps.