sysfs-bus-iio-timer-stm32 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. What: /sys/bus/iio/devices/triggerX/master_mode_available
  2. KernelVersion: 4.11
  3. Contact: benjamin.gaignard@st.com
  4. Description:
  5. Reading returns the list possible master modes which are:
  6. - "reset" : The UG bit from the TIMx_EGR register is
  7. used as trigger output (TRGO).
  8. - "enable" : The Counter Enable signal CNT_EN is used
  9. as trigger output.
  10. - "update" : The update event is selected as trigger output.
  11. For instance a master timer can then be used
  12. as a prescaler for a slave timer.
  13. - "compare_pulse" : The trigger output send a positive pulse
  14. when the CC1IF flag is to be set.
  15. - "OC1REF" : OC1REF signal is used as trigger output.
  16. - "OC2REF" : OC2REF signal is used as trigger output.
  17. - "OC3REF" : OC3REF signal is used as trigger output.
  18. - "OC4REF" : OC4REF signal is used as trigger output.
  19. Additional modes (on TRGO2 only):
  20. - "OC5REF" : OC5REF signal is used as trigger output.
  21. - "OC6REF" : OC6REF signal is used as trigger output.
  22. - "compare_pulse_OC4REF":
  23. OC4REF rising or falling edges generate pulses.
  24. - "compare_pulse_OC6REF":
  25. OC6REF rising or falling edges generate pulses.
  26. - "compare_pulse_OC4REF_r_or_OC6REF_r":
  27. OC4REF or OC6REF rising edges generate pulses.
  28. - "compare_pulse_OC4REF_r_or_OC6REF_f":
  29. OC4REF rising or OC6REF falling edges generate pulses.
  30. - "compare_pulse_OC5REF_r_or_OC6REF_r":
  31. OC5REF or OC6REF rising edges generate pulses.
  32. - "compare_pulse_OC5REF_r_or_OC6REF_f":
  33. OC5REF rising or OC6REF falling edges generate pulses.
  34. +-----------+ +-------------+ +---------+
  35. | Prescaler +-> | Counter | +-> | Master | TRGO(2)
  36. +-----------+ +--+--------+-+ |-> | Control +-->
  37. | | || +---------+
  38. +--v--------+-+ OCxREF || +---------+
  39. | Chx compare +----------> | Output | ChX
  40. +-----------+-+ | | Control +-->
  41. . | | +---------+
  42. . | | .
  43. +-----------v-+ OC6REF | .
  44. | Ch6 compare +---------+>
  45. +-------------+
  46. Example with: "compare_pulse_OC4REF_r_or_OC6REF_r":
  47. X
  48. X X
  49. X . . X
  50. X . . X
  51. X . . X
  52. count X . . . . X
  53. . . . .
  54. . . . .
  55. +---------------+
  56. OC4REF | . . |
  57. +-+ . . +-+
  58. . +---+ .
  59. OC6REF . | | .
  60. +-------+ +-------+
  61. +-+ +-+
  62. TRGO2 | | | |
  63. +-+ +---+ +---------+
  64. What: /sys/bus/iio/devices/triggerX/master_mode
  65. KernelVersion: 4.11
  66. Contact: benjamin.gaignard@st.com
  67. Description:
  68. Reading returns the current master modes.
  69. Writing set the master mode
  70. What: /sys/bus/iio/devices/triggerX/sampling_frequency
  71. KernelVersion: 4.11
  72. Contact: benjamin.gaignard@st.com
  73. Description:
  74. Reading returns the current sampling frequency.
  75. Writing an value different of 0 set and start sampling.
  76. Writing 0 stop sampling.
  77. What: /sys/bus/iio/devices/iio:deviceX/in_count0_preset
  78. KernelVersion: 4.12
  79. Contact: benjamin.gaignard@st.com
  80. Description:
  81. Reading returns the current preset value.
  82. Writing sets the preset value.
  83. When counting up the counter starts from 0 and fires an
  84. event when reach preset value.
  85. When counting down the counter start from preset value
  86. and fire event when reach 0.
  87. What: /sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available
  88. KernelVersion: 4.12
  89. Contact: benjamin.gaignard@st.com
  90. Description:
  91. Reading returns the list possible quadrature modes.
  92. What: /sys/bus/iio/devices/iio:deviceX/in_count0_quadrature_mode
  93. KernelVersion: 4.12
  94. Contact: benjamin.gaignard@st.com
  95. Description:
  96. Configure the device counter quadrature modes:
  97. channel_A:
  98. Encoder A input servers as the count input and B as
  99. the UP/DOWN direction control input.
  100. channel_B:
  101. Encoder B input serves as the count input and A as
  102. the UP/DOWN direction control input.
  103. quadrature:
  104. Encoder A and B inputs are mixed to get direction
  105. and count with a scale of 0.25.
  106. What: /sys/bus/iio/devices/iio:deviceX/in_count_enable_mode_available
  107. KernelVersion: 4.12
  108. Contact: benjamin.gaignard@st.com
  109. Description:
  110. Reading returns the list possible enable modes.
  111. What: /sys/bus/iio/devices/iio:deviceX/in_count0_enable_mode
  112. KernelVersion: 4.12
  113. Contact: benjamin.gaignard@st.com
  114. Description:
  115. Configure the device counter enable modes, in all case
  116. counting direction is set by in_count0_count_direction
  117. attribute and the counter is clocked by the internal clock.
  118. always:
  119. Counter is always ON.
  120. gated:
  121. Counting is enabled when connected trigger signal
  122. level is high else counting is disabled.
  123. triggered:
  124. Counting is enabled on rising edge of the connected
  125. trigger, and remains enabled for the duration of this
  126. selected mode.
  127. What: /sys/bus/iio/devices/iio:deviceX/in_count_trigger_mode_available
  128. KernelVersion: 4.13
  129. Contact: benjamin.gaignard@st.com
  130. Description:
  131. Reading returns the list possible trigger modes.
  132. What: /sys/bus/iio/devices/iio:deviceX/in_count0_trigger_mode
  133. KernelVersion: 4.13
  134. Contact: benjamin.gaignard@st.com
  135. Description:
  136. Configure the device counter trigger mode
  137. counting direction is set by in_count0_count_direction
  138. attribute and the counter is clocked by the connected trigger
  139. rising edges.