adafruit / Adafruit_nRF52_Arduino

Adafruit code for the Nordic nRF52 BLE SoC on Arduino
Other
598 stars 488 forks source link

I2C slave library : Restart sequence when a register address writes is done before reading #792

Open fchaxel opened 9 months ago

fchaxel commented 9 months ago

Hi,

Using Wire for I2C slave implementation one can see that when a master is using the classical register Write adress followed by a restart and a write sequence, we cannot get back the writen adress !

In void TwoWire::onService(void)

if (_p_twis->EVENTS_READ)

if the amount of receive data is copied into the rx RingBuffer header it will be available for the end user to get back theise data in it's read event handler

**rxBuffer._iHead = _p_twis->RXD.AMOUNT;**

I don't see any side effect of this small addition.

Bye.