pcnt.rst 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. Pulse Counter
  2. ========
  3. Overview
  4. --------
  5. The PCNT (Pulse Counter) module is designed to count the number of rising and/or falling edges of an input signal. Each pulse counter unit has a 16-bit signed counter register and two channels that can be configured to either increment or decrement the counter. Each channel has a signal input that accepts signal edges to be detected, as well as a control input that can be used to enable or disable the signal input. The inputs have optional filters that can be used to discard unwanted glitches in the signal.
  6. Application Example
  7. -------------------
  8. Pulse counter with control signal and event interrupt example: `examples/16_pcnt <https://github.com/espressif/esp-idf/tree/master/examples/16_pcnt>`_.
  9. API Reference
  10. -------------
  11. Header Files
  12. ^^^^^^^^^^^^
  13. * `driver/pcnt.h <https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/pcnt.h>`_
  14. Macros
  15. ^^^^^^
  16. Type Definitions
  17. ^^^^^^^^^^^^^^^^
  18. Enumerations
  19. ^^^^^^^^^^^^
  20. .. doxygenenum:: pcnt_ctrl_mode_t
  21. .. doxygenenum:: pcnt_count_mode_t
  22. .. doxygenenum:: pcnt_unit_t
  23. .. doxygenenum:: pcnt_channel_t
  24. .. doxygenenum:: pcnt_evt_type_t
  25. Structures
  26. ^^^^^^^^^^
  27. .. doxygenstruct:: pcnt_config_t
  28. Functions
  29. ^^^^^^^^^
  30. .. doxygenfunction:: pcnt_unit_config
  31. .. doxygenfunction:: pcnt_get_counter_value
  32. .. doxygenfunction:: pcnt_counter_pause
  33. .. doxygenfunction:: pcnt_counter_resume
  34. .. doxygenfunction:: pcnt_counter_clear
  35. .. doxygenfunction:: pcnt_intr_enable
  36. .. doxygenfunction:: pcnt_intr_disable
  37. .. doxygenfunction:: pcnt_event_enable
  38. .. doxygenfunction:: pcnt_event_disable
  39. .. doxygenfunction:: pcnt_set_event_value
  40. .. doxygenfunction:: pcnt_get_event_value
  41. .. doxygenfunction:: pcnt_isr_register
  42. .. doxygenfunction:: pcnt_set_pin
  43. .. doxygenfunction:: pcnt_filter_enable
  44. .. doxygenfunction:: pcnt_filter_disable
  45. .. doxygenfunction:: pcnt_set_filter_value
  46. .. doxygenfunction:: pcnt_get_filter_value
  47. .. doxygenfunction:: pcnt_set_mode