mirror of
https://github.com/espressif/esp-idf.git
synced 2026-10-03 03:31:41 +03:00
docs(pcnt): add gpio pull mode migration guide
Closes https://github.com/espressif/esp-idf/issues/18862
This commit is contained in:
@@ -33,25 +33,28 @@ B +-----+ +-----+ +-----+
|
||||
|
||||
* An ESP development board
|
||||
* EC11 rotary encoder (or other encoders which can produce quadrature waveforms)
|
||||
* Pull-up resistors for the A and B signal lines. It is recommended to provide external pull-up resistors on the PCB.
|
||||
|
||||
Connection :
|
||||
|
||||
```text
|
||||
+--------+ +---------------------------------+
|
||||
| | | |
|
||||
| A +--------------+ GPIO_A (internal pull up) |
|
||||
| A +--------------+ GPIO_A (external pull up) |
|
||||
| | | |
|
||||
+-------+ | | |
|
||||
| | | GND +--------------+ GND |
|
||||
+-------+ | | |
|
||||
| | | |
|
||||
| B +--------------+ GPIO_B (internal pull up) |
|
||||
| B +--------------+ GPIO_B (external pull up) |
|
||||
| | | |
|
||||
+--------+ +---------------------------------+
|
||||
```
|
||||
|
||||
The GPIO used by the example can be changed according to your board by `EXAMPLE_EC11_GPIO_A` and `EXAMPLE_EC11_GPIO_B` in [source file](main/rotary_encoder_example_main.c).
|
||||
|
||||
The PCNT driver does not configure internal pull-up or pull-down resistors for the input GPIOs. If your board does not have external pull-up resistors for the EC11 A/B signal lines, enable `EXAMPLE_ENABLE_INTERNAL_PULL_UPS` from `menuconfig`, or call GPIO APIs such as `gpio_pullup_en()` or `gpio_set_pull_mode()` in your application.
|
||||
|
||||
### Build and Flash
|
||||
|
||||
By configuring one of the EC11 GPIO (e.g. `EXAMPLE_EC11_GPIO_A`) as a wake up source, you can make the rotary encoder wake the system from light sleep. This example can illustrate this feature if you enable the `EXAMPLE_WAKE_UP_LIGHT_SLEEP` from the menuconfig.
|
||||
|
||||
Reference in New Issue
Block a user