AVR-GCC Libraries
Macros | Functions
i2cmaster.h File Reference
#include <avr/io.h>

Go to the source code of this file.

Macros

#define I2C_READ   1
 
#define I2C_WRITE   0
 
#define i2c_read(ack)   (ack) ? i2c_readAck() : i2c_readNak();
 

Functions

void i2c_init (void)
 initialize the I2C master interace. Need to be called only once More...
 
void i2c_stop (void)
 Terminates the data transfer and releases the I2C bus. More...
 
unsigned char i2c_start (unsigned char addr)
 Issues a start condition and sends address and transfer direction. More...
 
unsigned char i2c_rep_start (unsigned char addr)
 Issues a repeated start condition and sends address and transfer direction. More...
 
void i2c_start_wait (unsigned char addr)
 Issues a start condition and sends address and transfer direction. More...
 
unsigned char i2c_write (unsigned char data)
 Send one byte to I2C device. More...
 
unsigned char i2c_readAck (void)
 read one byte from the I2C device, request more data from device More...
 
unsigned char i2c_readNak (void)
 read one byte from the I2C device, read is followed by a stop condition More...
 
unsigned char i2c_read (unsigned char ack)
 read one byte from the I2C device More...