espressif/knob
uploaded 11 months ago

Knob driver implemented through software pcnt

readme

## Component Knob

`Knob` is the component that provides the software PCNT, it can be used on chips(esp32c2, esp32c3) that do not have PCNT hardware capabilities. By using this component, you can quickly use a physical encoder, such as the EC11 encoder.

Features:

1. Support multiple knobs
2. Support each event can register its own callback
3. Support setting the upper and lower count limits

List of supported events:

 * Knob left
 * Knob right
 * Knob high limit
 * Knob low limit
 * Knob back to zero

### Examples

[USB Surface Dial](https://github.com/espressif/esp-iot-solution/tree/master/examples/usb/device/usb_surface_dial)

changelog

# ChangeLog

## v0.1.2 - 2023-3-9

### Enhancements:

* Use cu_pkg_define_version to define the version of this component.

## v0.1.1 - 2023-1-18

### Bug Fixes:

* Knob:
  * Fix callback return usr_data root pointer, the usr_data of the relevant callback will now be returned.

## v0.1.0 - 2023-1-5

### Enhancements:

* Initial version

* The following types of events are supported

|   EVENT    |                  描述                  |
| ---------- | -------------------------------------- |
| KNOB_LEFT  | EVENT: Rotate to the left              |
| KNOB_RIGHT | EVENT: Rotate to the right             |
| KNOB_H_LIM | EVENT: Count reaches maximum limit     |
| KNOB_L_LIM | EVENT: Count reaches the minimum limit |
| KNOB_ZERO  | EVENT: Count back to 0                 |

* Support for defining multiple knobs

* Support binding callback functions for each event and adding user-data

Links

Supports all targets

License: Apache-2.0

To add this component to your project, run:

idf.py add-dependency "espressif/knob^0.1.2"

or download archive

Dependencies

  • espressif/cmake_utilities 0.*
  • ESP-IDF >=4.4.1
  • Stats

    • Downloaded in total
      Downloaded in total 1.3k times
    • Downloaded this version
      This version: 43 times

    Badge

    espressif/knob version: 0.1.2 |