Skip to content

raspberrypi/I2CTarget: Fixed bug where I2C starts were seen as restarts. #10474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

AmaarEbrahim
Copy link

@AmaarEbrahim AmaarEbrahim commented Jul 11, 2025

The Rasperry Pi Pico, based on the RP2040, has a register that maintains the status of I2C interrupt flags called IC_INTR_STAT. The bits of this register are set by hardware and cleared by software. Before this commit, the I2CTarget library did not clear the restart bit (R_RESTART_DET) in this register after an I2C transaction ended, causing the is_restart field of the i2ctarget_i2c_target_request_obj_t struct to always be true after the first I2C transaction that involved a restart. This commit causes the restart and stop bits to get cleared when the I2C transaction ends.

The Rasperry Pi Pico, based on the RP2040, has a register that maintains
the status of I2C interrupt flags called IC_INTR_STAT. The bits of this
register are set by hardware and cleared by software. Before this commit,
the I2CTarget library did not clear the restart bit (R_RESTART_DET) in
this register after an I2C transaction ended, causing the is_restart
field of the i2ctarget_i2c_target_request_obj_t struct to always be true
after the first I2C transaction. This commit causes the restart and stop
bits to get cleared when the I2C transaction ends.

Signed-off-by: Amaar Ebrahim <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant