Add strapping: config for GPIO pins (#3146)

Co-authored-by: H. Árkosi Róbert <robreg@zsurob.hu>
This commit is contained in:
Clyde Stubbs 2023-10-19 09:04:56 +09:00 committed by GitHub
parent 33e2e752b2
commit dbee5b9399
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 0 deletions

View File

@ -117,6 +117,14 @@ Advanced options:
- **drive_strength** (*Optional*, string): On ESP32s with esp-idf framework the pad drive strength,
i.e. the maximum amount of current can additionally be set. Defaults to ``20mA``.
Options are ``5mA``, ``10mA``, ``20mA``, ``40mA``.
- **ignore_strapping_warning** (*Optional*, boolean): Certain pins on ESP32s are designated *strapping pins* and are read
by the chip on reset to configure initial operation, e.g. to enable bootstrap mode.
Using such pins for I/O should be avoided and ESPHome will warn if I/O is configured on a strapping pin.
For more detail see :ref:`strapping-warnings`.
If you are *absolutely* sure that you are using a strapping pin for I/O in a way that will not cause problems,
you can suppress the warning by setting this option to ``true`` in the pin configuration.
.. _config-time:

View File

@ -409,6 +409,8 @@ The top level ``name:`` field in your .yaml file defines the node name(/hostname
Important: follow these `instructions </components/esphome.html#changing-esphome-node-name>`_ to use the ``use_address`` parameter when renaming a live device, as the connection to an existing device will only work with the old name until the name change is complete.
.. _strapping-warnings:
Why am I getting a warning about strapping pins?
--------------------------------------------------
@ -419,6 +421,13 @@ It's recommended to avoid them unless you have a pressing need to use them and y
Some development boards connect GPIO 0 to a button, often labeled "boot". Holding this button while the ESP is turning on will cause it to go into bootloader mode. Once the ESP is fully booted up, this button can be used as a normal input safely.
Strapping pins should be safe to use as outputs if they are *only* connected to other devices that have hi-impedance inputs
with no pull-up or pull-down resistors. Note that I2C clock and data lines *do* have pull-up resistors and are not
safe on strapping pins.
If you are absolutely sure that your use of strapping pins is safe, and want to suppress the warning, you can
add ``ignore_strapping_warning: true`` to the relevant pin configurations.
How can I test a Pull Request?
------------------------------