binary Clock
|
Low level I2C definitions for the ATtiny4313. More...
Go to the source code of this file.
Macros | |
#define | I2C_START_RETRY 5 |
defines how many times we should retry to start communication More... | |
#define | I2C_BITBANG |
Don't use I2C hardware modules, but rather manual port manipulation. More... | |
Functions | |
retval_t | i2c_drvr_init (void) |
retval_t | i2c_drvr_start (uint8_t byte_to_tx) |
retval_t | i2c_drvr_end (void) |
retval_t | i2c_drvr_write_byte (uint8_t byte_to_tx) |
retval_t | i2c_drvr_read_byte (uint8_t *byte_read_ptr, uint8_t ack) |
void | toggle_scl (void) |
Low level I2C definitions for the ATtiny4313.
#define I2C_BITBANG |
Don't use I2C hardware modules, but rather manual port manipulation.
#define I2C_START_RETRY 5 |
defines how many times we should retry to start communication
retval_t i2c_drvr_end | ( | void | ) |
Creates an end condition and returns if it was successful.
[out] | retval | (retval_t): Returns if the end condition worked. |
retval_t i2c_drvr_init | ( | void | ) |
Initializes the I2C lines.
[out] | retval | (retval_t): Returns if the initialization worked. |
retval_t i2c_drvr_read_byte | ( | uint8_t * | byte_read_ptr, |
uint8_t | ack | ||
) |
Reads a byte of information to from the I2C line.
[in] | byte_read_ptr | (uint8_t *): Location to return the read back value. |
[in] | ack | (uint8_t): Whether or not to acknowledge the byte. |
[out] | retval | (retval_t): Returns if the read was successful. |
retval_t i2c_drvr_start | ( | uint8_t | addr_with_mode | ) |
Creates a start condition, addresses the chip and returns if it was successful.
[in] | addr_with_mode | (uint8_t): Address of the chip with mode set. |
[out] | retval | (retval_t): Returns if the start condition worked. |
retval_t i2c_drvr_write_byte | ( | uint8_t | byte_to_tx | ) |
Writes a byte of information to the I2C line.
[in] | byte_to_tx | (uint8_t): Byte to transmit. |
[out] | retval | (retval_t): Returns if the byte write was acknowledged. |
void toggle_scl | ( | void | ) |