Go to the documentation of this file.
58 #define TXADDRACK 0x18
61 #define TXDATAACK 0x28
64 #define RXADDRACK 0x40
109 volatile uint8_t twsr;
110 volatile uint8_t twbr;
111 volatile uint8_t twdr;
112 volatile uint8_t twcr;
116 void*
operator new(
size_t size);
157 bool readByte(
bool ack, uint8_t *data);
180 bool read(uint8_t slaveAddr, uint8_t regAddr, uint8_t numOfBytes, uint8_t *data);
199 bool start(uint8_t addr,
bool RW);
218 bool restart(uint8_t addr,
bool RW);
252 bool write(uint8_t slaveAddr, uint8_t regAddr, uint8_t numOfBytes, uint8_t *data);
292 void begin(
bool channel);
bool cmd(uint8_t cmd)
Sends commands over the I2C bus.
i2cMaster(void)
Constructor.
bool read(uint8_t slaveAddr, uint8_t regAddr, uint8_t numOfBytes, uint8_t *data)
sets up I2C connection to device, reads a number of data bytes and closes the connection
void begin(void)
Setup TWI (I2C) interface.
uint8_t getStatus(void)
Get current I2C status.
bool stop(void)
Closes the I2C connection.
bool write(uint8_t slaveAddr, uint8_t regAddr, uint8_t numOfBytes, uint8_t *data)
sets up I2C connection to device, writes a number of data bytes and closes the connection
bool restart(uint8_t addr, bool RW)
Restarts connection between arduino and I2C device.
Prototype of class for accessing the TWI (I2C) interface of the AVR (master mode only).
bool writeByte(uint8_t data)
Writes a byte to a device on the I2C bus.
bool readByte(bool ack, uint8_t *data)
Reads a byte from the I2C bus.
bool start(uint8_t addr, bool RW)
sets up connection between arduino and I2C device.