Skip to content

libraries/Wire: Add support for target mode. #169

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 3 commits into
base: main
Choose a base branch
from

Conversation

iabdalkader
Copy link

@iabdalkader iabdalkader commented Aug 5, 2025

Test sketch:

#include <Wire.h>

void onRequest() {
  Wire.write("HelloWorld!");
}

void onReceive(int howMany) {
  while (Wire.available()) {
    char c = Wire.read();
    Serial.print(c);
  }
  
  if (howMany) {
    Serial.println("");
  }
}

void setup() {
  Serial.begin(115200);
  Wire.begin(8);
  Wire.onRequest(onRequest);
  Wire.onReceive(onReceive);
}

void loop() {
  delay(1000);
}

Retested master mode with VL53L1X and target mode with bus pirate:

image

Used by Wire.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
- Add support for I2C target mode.
- Fix buffer overflows, bad return values etc..

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
Enable target support for Giga R1.

Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
@iabdalkader iabdalkader force-pushed the wire_slave_support branch 3 times, most recently from 9ce1ca5 to e4ed02a Compare August 5, 2025 13:47
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