Skip to content

Commit 799e3a0

Browse files
authored
Docs: larify pin assignments for i2c (#173)
1 parent 6d11ec6 commit 799e3a0

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/wire.rst

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
Wire (I2C Master and Slave)
22
===========================
33

4-
The RP2040 has two I2C devices, ``i2c0 (Wire)`` and ``i2c1 (Wire1)``
4+
The RP2040 has two I2C devices, ``i2c0 (Wire)`` and ``i2c1 (Wire1)``.
55

6-
The current implementation is compatible with the Arduino standard
7-
with the addition of two calls to allof the `SDA` and `SCL` pins
8-
to be set **before calling Wire.begin()**
6+
The default pins for `Wire` and `Wire1` vary depending on which board you're using.
7+
(Here are the pinout diagrams for `Pico <https://datasheets.raspberrypi.org/pico/Pico-R3-A4-Pinout.pdf>`_
8+
and `Adafruit Feather <https://learn.adafruit.com/assets/100740>`_.)
9+
10+
You may change these pins **before calling Wire.begin() or Wire1.begin()** using:
911

1012
.. code:: cpp
1113
1214
bool setSDA(pin_size_t sda);
1315
bool setSCL(pin_size_t scl);
1416
15-
Both master and slave operation is supported.
17+
Be sure to use pins labeled ``I2C0`` for Wire and ``I2C1`` for Wire1 on the pinout
18+
diagram for your board, or it won't work.
19+
20+
Other than that, the API is compatible with the Arduino standard.
21+
Both master and slave operation are supported.
1622

1723
Master transmissions are buffered (up to 128 bytes) and only performed
1824
on ``endTransmission``, as is standard with modern Arduino Wire implementations.

0 commit comments

Comments
 (0)