8000 docs/library/machine.I2C: Fix I2C constructor docs to match impl. · micropython/micropython@d377c83 · GitHub
[go: up one dir, main page]

Skip to content

Commit d377c83

Browse files
committed
docs/library/machine.I2C: Fix I2C constructor docs to match impl.
1 parent 71ff0b5 commit d377c83

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

docs/library/machine.I2C.rst

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,23 @@ Constructors
4949
Construct an I2C object on the given bus. `bus` can only be 0.
5050
If the bus is not given, the default one will be selected (0).
5151

52-
.. only:: port_esp8266
53-
54-
.. class:: I2C(scl, sda, \*, freq=400000)
55-
56-
Construct and return a new I2C object.
57-
See the init method below for a description of the arguments.
52+
.. only:: not port_wipy
53+
54+
.. class:: I2C(id=-1, \*, scl, sda, freq=400000)
55+
56+
Construct and return a new I2C object using the following parameters:
57+
58+
- `id` identifies the particular I2C peripheral. The default
59+
value of -1 selects a software implementation of I2C which can
60+
work (in most cases) with arbitrary pins for SCL and SDA.
61+
If `id` is -1 then `scl` and `sda` must be specified. Other
62+
allowed values for `id` depend on the particular port/board,
63+
and specifying `scl` and `sda` may or may not be required or
64+
allowed in this case.
65+
- `scl` should be a pin object specifying the pin to use for SCL.
66+
- `sda` should be a pin object specifying the pin to use for SDA.
67+
- `freq` should be an integer which sets the maximum frequency
68+
for SCL.
5869

5970
General Methods
6071
---------------

0 commit comments

Comments
 (0)
0