|
TinyGPU
|
#include <EmulationIDF.h>
Public Member Functions | |
| TwoWire ()=default | |
| TwoWire (i2c_port_t port) | |
| bool | begin (int sdaPin, int sclPin, uint32_t freqHz=100000) |
| void | beginTransmission (uint8_t address) |
| void | write (uint8_t value) |
| uint8_t | endTransmission (bool sendStop=true) |
| size_t | requestFrom (int address, int length) |
| int | available () const |
| int | read () |
Legacy driver/i2c.h-backed stand-in for Arduino's TwoWire, covering exactly what this library's I2C touch drivers call: beginTransmission/ write/endTransmission/requestFrom/available/read. endTransmission(false) defers the actual bus write so a following requestFrom() can chain it into one repeated-start transaction (write register address, repeated start, read data) instead of two separate stop/start transactions - several of this library's touch controllers document that this matters for reliable register reads.
|
default |
|
inlineexplicit |
|
inline |
Bytes still unread from the last requestFrom() - matches TwoWire::available().
|
inline |
Initializes the I2C bus pins/speed. Matches arduino-esp32's TwoWire::begin(sda, scl, freq). Safe to call more than once.
|
inline |
Starts buffering a write to address - matches TwoWire::beginTransmission().
|
inline |
Sends the buffered write. sendStop = false defers the actual I2C transaction to the following requestFrom() call, so it becomes a single repeated-start write-then-read - see class comment. Returns 0 on success, matching Arduino's TwoWire::endTransmission() (which also uses 0 for success).
|
inline |
Reads one byte from the last requestFrom(), or -1 if none remain - matches TwoWire::read().
|
inline |
Reads up to length bytes from address into the internal receive buffer - matches TwoWire::requestFrom(). If a prior endTransmission(false) is pending, folds it into this call as one repeated-start write-then-read transaction; otherwise this is a plain read. Returns the number of bytes actually read (0 on error).
|
inline |
Buffers one byte for the next endTransmission() - matches TwoWire::write(uint8_t). Silently drops bytes past the small fixed buffer (this library's own drivers write at most a few register- address bytes per transaction).