adafruit / adafruit/Adafruit_nRF52_Arduino

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

Open
#792 0 comments 0 reactions 0 assignees View on GitHub
Feature
Dominant language
C
Stars
699
Forks
570
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

No contributing guide indexed for this repository

Research direction

Locate void TwoWire::onService() and inspect the EVENTS_READ path, especially rxBuffer._iHead and _p_twis->RXD.AMOUNT. Reproduce the I2C slave register-address-then-restart sequence and verify that the written register address is available to the end user in the read event handler.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c
Domain
embedded-iot
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.