sysfs-bus-iio-timer-stm32 4.8 KB

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