From 187e1d59a90163b87c7f804c510f9423df879c51 Mon Sep 17 00:00:00 2001 From: polyfloyd Date: Thu, 23 May 2024 23:08:31 +0200 Subject: [PATCH] MPR121 gpio (#3845) Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com> --- components/binary_sensor/mpr121.rst | 31 +++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/components/binary_sensor/mpr121.rst b/components/binary_sensor/mpr121.rst index 030a5b75b..73fcd743b 100644 --- a/components/binary_sensor/mpr121.rst +++ b/components/binary_sensor/mpr121.rst @@ -77,6 +77,37 @@ Configuration variables: - **release_threshold** (*Optional*, int): A per-channel override of the global release_threshold value. If not specified, uses the global value. - All other options from :ref:`Binary Sensor `. +GPIO +---- + +The ``mpr121`` also supports configuring its touch electrodes as GPIO inputs and outputs. To do so, +specify an ``id`` in the configuration of the ``mpr121`` component. Then, configure a GPIO output or +input using this ID in the ``mpr121`` field. + +.. code-block:: yaml + + output: + - id: ext_5v_power + platform: gpio + pin: + mpr121: mpr121_component + number: 10 + mode: OUTPUT + inverted: true + + +The ``number`` refers to the ELEx pin number on the MPR121 chip. Only ELE4 up to including ELE11 are +available as GPIO. + +GPIO and touch functionality may be used at the same time, but not on the same pins. + +It is also not valid to configure a pin as GPIO when a pin with a higher number is used as touch +channel. This is because touch functionality is configured as a range, starting at ELE0. +For example: + +- Using channel 2 and 5 as touch and channel 6 as GPIO is okay +- Using channel 2 and 5 as touch and channel 4 as GPIO is not okay + See Also --------