Skip to content

Adds default Wire1 pins auto-setup #7034

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

Merged
merged 5 commits into from
Aug 1, 2022
Merged

Conversation

SuGlider
Copy link
Collaborator

Description of Change

Some boards define SDA1 and SCL1 pins for Wire1 peripheral.
This information isn't used in Wire1.begin() as pins default.
The PR adds this functionality and set default pins when they are correctly created in pins_arduino.h

These pins shall be set in variants/<board_name>/pins_arduino.h like this example:

#define WIRE1_PIN_DEFINED 1             // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
static const uint8_t SDA1 = 2;
static const uint8_t SCL1 = 4;

Tests scenarios

Tested with ESP32/S2/S3.

Note ESP32-C3 has just 1 I2C peripheral

Related links

Closes #6999

@SuGlider SuGlider added the Type: Feature request Feature request for Arduino ESP32 label Jul 25, 2022
@SuGlider SuGlider added this to the 2.0.5 milestone Jul 25, 2022
@SuGlider SuGlider self-assigned this Jul 25, 2022
Copy link
Member

@P-R-O-C-H-Y P-R-O-C-H-Y left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SuGlider Would be good to add to our official boards SDA1 and SCL1 defines too. (eg. esp32, esp32s2 and esp32s3 variants).

@ladyada
Copy link
Contributor

ladyada commented Aug 1, 2022

Tested a QT Py ESP32 (where the QT connector is Wire1) and it worked great :)

@SuGlider SuGlider merged commit 852ea39 into espressif:master Aug 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature request Feature request for Arduino ESP32
Projects
Development

Successfully merging this pull request may close these issues.

Have Wire1 pins autoset just like Wire
3 participants