pcnt_periph.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. // Copyright 2020 Espressif Systems (Shanghai) PTE LTD
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #include "soc/pcnt_periph.h"
  15. #include "soc/gpio_sig_map.h"
  16. const pcnt_signal_conn_t pcnt_periph_signals = {
  17. .groups = {
  18. [0] = {
  19. .module = PERIPH_PCNT_MODULE,
  20. .irq = ETS_PCNT_INTR_SOURCE,
  21. .units = {
  22. [0] = {
  23. .channels = {
  24. [0] = {
  25. .control_sig = PCNT_CTRL_CH0_IN0_IDX,
  26. .pulse_sig = PCNT_SIG_CH0_IN0_IDX
  27. },
  28. [1] = {
  29. .control_sig = PCNT_CTRL_CH1_IN0_IDX,
  30. .pulse_sig = PCNT_SIG_CH1_IN0_IDX
  31. }
  32. }
  33. },
  34. [1] = {
  35. .channels = {
  36. [0] = {
  37. .control_sig = PCNT_CTRL_CH0_IN1_IDX,
  38. .pulse_sig = PCNT_SIG_CH0_IN1_IDX
  39. },
  40. [1] = {
  41. .control_sig = PCNT_CTRL_CH1_IN1_IDX,
  42. .pulse_sig = PCNT_SIG_CH1_IN1_IDX
  43. }
  44. }
  45. },
  46. [2] = {
  47. .channels = {
  48. [0] = {
  49. .control_sig = PCNT_CTRL_CH0_IN2_IDX,
  50. .pulse_sig = PCNT_SIG_CH0_IN2_IDX
  51. },
  52. [1] = {
  53. .control_sig = PCNT_CTRL_CH1_IN2_IDX,
  54. .pulse_sig = PCNT_SIG_CH1_IN2_IDX
  55. }
  56. }
  57. },
  58. [3] = {
  59. .channels = {
  60. [0] = {
  61. .control_sig = PCNT_CTRL_CH0_IN3_IDX,
  62. .pulse_sig = PCNT_SIG_CH0_IN3_IDX
  63. },
  64. [1] = {
  65. .control_sig = PCNT_CTRL_CH1_IN3_IDX,
  66. .pulse_sig = PCNT_SIG_CH1_IN3_IDX
  67. }
  68. }
  69. }
  70. }
  71. }
  72. }
  73. };