Skip to content

Commit

Permalink
docs/esp32/quickref: Document GPIO drive strength.
Browse files Browse the repository at this point in the history
Add brief documentation of the new `drive` keyword argument.
  • Loading branch information
jonathanhogg authored and dpgeorge committed Mar 7, 2022
1 parent 33083bf commit 4c7c80d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/esp32/quickref.rst
Expand Up @@ -160,13 +160,23 @@ Use the :ref:`machine.Pin <machine.Pin>` class::

p4 = Pin(4, Pin.IN, Pin.PULL_UP) # enable internal pull-up resistor
p5 = Pin(5, Pin.OUT, value=1) # set pin high on creation
p6 = Pin(6, Pin.OUT, drive=Pin.DRIVE_3) # set maximum drive strength

Available Pins are from the following ranges (inclusive): 0-19, 21-23, 25-27, 32-39.
These correspond to the actual GPIO pin numbers of ESP32 chip. Note that many
end-user boards use their own adhoc pin numbering (marked e.g. D0, D1, ...).
For mapping between board logical pins and physical chip pins consult your board
documentation.

Four drive strengths are supported, using the ``drive`` keyword argument to the
``Pin()`` constructor or ``Pin.init()`` method, with different corresponding
safe maximum source/sink currents and approximate internal driver resistances:

- ``Pin.DRIVE_0``: 5mA / 130 ohm
- ``Pin.DRIVE_1``: 10mA / 60 ohm
- ``Pin.DRIVE_2``: 20mA / 30 ohm (default strength if not configured)
- ``Pin.DRIVE_3``: 40mA / 15 ohm

Notes:

* Pins 1 and 3 are REPL UART TX and RX respectively
Expand Down

0 comments on commit 4c7c80d

Please sign in to comment.