Go to the documentation of this file.
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;
107 void begin(uint8_t addr);
201 uint8_t
requestFrom(uint8_t addr, uint8_t size, uint8_t stop);
215 virtual size_t write(uint8_t data);
230 virtual size_t write(
const uint8_t *data,
size_t size);
254 virtual int read(
void);
267 virtual size_t readBytes(uint8_t *buffer,
size_t length);
281 virtual int peek(
void);
291 virtual void flush(
void);
virtual size_t write(uint8_t data)
Queue a byte for transmission from a master to slave device.
uint8_t endTransmission(void)
End a transmission to a I2C slave device.
void setClock(uint32_t clk)
Set the clock speed of the I2C device defined by ARDUINO_I2C_DEV.
virtual void flush(void)
Flush the RX and TX buffer.
void begin(void)
Initializes the I2C device defined by ARDUINO_I2C_DEV as master.
virtual int peek(void)
Peeks one byte transmitted from slave device to the master.
TwoWire(void)
Constructor.
uint8_t requestFrom(uint8_t addr, uint8_t size)
Request bytes from a I2C slave device.
void beginTransmission(uint8_t addr)
Begin a transmission to a I2C slave device.
Adds include for missing inttype definitions.
virtual int read(void)
Reads one byte transmitted from slave device to the master.
Class definition for the Arduino Wire library implementation.
virtual size_t readBytes(uint8_t *buffer, size_t length)
Read bytes transmitted from slave device to the master.
virtual int available(void)
Return the number of bytes available for retrieval.