62#ifndef ARDUINO_I2C_DEV
63#define ARDUINO_I2C_DEV (I2C_DEV(0))
67#define WIREPORT_BUFFER_LENGTH 32
74 static uint8_t rxBuffer[];
75 static uint8_t rxBufferIndex;
76 static uint8_t rxBufferLength;
78 static uint8_t txAddress;
79 static uint8_t txBuffer[];
80 static uint8_t txBufferIndex;
81 static uint8_t txBufferLength;
82 static uint8_t txError;
84 static uint8_t transmitting;
230 virtual size_t write(
const uint8_t *data,
size_t size);
267 virtual size_t readBytes(uint8_t *buffer,
size_t length);
Class definition for the Arduino Wire library implementation.
uint8_t requestFrom(uint8_t addr, uint8_t size)
Request bytes from a I2C slave device.
uint8_t endTransmission(uint8_t stop)
End a transmission to a I2C slave device.
virtual size_t write(const uint8_t *data, size_t size)
Queue bytes for transmission from a master to slave device.
uint8_t requestFrom(uint8_t addr, uint8_t size, uint8_t stop)
Request bytes from a I2C slave device.
void setClock(uint32_t clk)
Set the clock speed of the I2C device defined by ARDUINO_I2C_DEV.
virtual int available(void)
Return the number of bytes available for retrieval.
virtual int read(void)
Reads one byte transmitted from slave device to the master.
virtual size_t write(uint8_t data)
Queue a byte for transmission from a master to slave device.
void begin(void)
Initializes the I2C device defined by ARDUINO_I2C_DEV as master.
void beginTransmission(uint8_t addr)
Begin a transmission to a I2C slave device.
virtual int peek(void)
Peeks one byte transmitted from slave device to the master.
virtual size_t readBytes(uint8_t *buffer, size_t length)
Read bytes transmitted from slave device to the master.
void begin(uint8_t addr)
Initializes the I2C device defined by ARDUINO_I2C_DEV as slave.
virtual void flush(void)
Flush the RX and TX buffer.
TwoWire(void)
Constructor.
uint8_t endTransmission(void)
End a transmission to a I2C slave device.
Adds include for missing inttype definitions.