1 What: /sys/bus/iio/devices/triggerX/master_mode_available
3 Contact: benjamin.gaignard@st.com
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
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.
35 +-----------+ +-------------+ +---------+
36 | Prescaler +-> | Counter | +-> | Master | TRGO(2)
37 +-----------+ +--+--------+-+ |-> | Control +-->
39 +--v--------+-+ OCxREF || +---------+
40 | Chx compare +----------> | Output | ChX
41 +-----------+-+ | | Control +-->
44 +-----------v-+ OC6REF | .
45 | Ch6 compare +---------+>
48 Example with: "compare_pulse_OC4REF_r_or_OC6REF_r":
68 What: /sys/bus/iio/devices/triggerX/master_mode
70 Contact: benjamin.gaignard@st.com
72 Reading returns the current master modes.
73 Writing set the master mode
75 What: /sys/bus/iio/devices/triggerX/sampling_frequency
77 Contact: benjamin.gaignard@st.com
79 Reading returns the current sampling frequency.
80 Writing an value different of 0 set and start sampling.
81 Writing 0 stop sampling.
83 What: /sys/bus/iio/devices/iio:deviceX/in_count0_preset
85 Contact: benjamin.gaignard@st.com
87 Reading returns the current preset value.
88 Writing sets the preset value.
89 When counting up the counter starts from 0 and fires an
90 event when reach preset value.
91 When counting down the counter start from preset value
92 and fire event when reach 0.
94 What: /sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available
96 Contact: benjamin.gaignard@st.com
98 Reading returns the list possible quadrature modes.
100 What: /sys/bus/iio/devices/iio:deviceX/in_count0_quadrature_mode
102 Contact: benjamin.gaignard@st.com
104 Configure the device counter quadrature modes:
106 Encoder A input servers as the count input and B as
107 the UP/DOWN direction control input.
110 Encoder B input serves as the count input and A as
111 the UP/DOWN direction control input.
114 Encoder A and B inputs are mixed to get direction
115 and count with a scale of 0.25.
117 What: /sys/bus/iio/devices/iio:deviceX/in_count_enable_mode_available
119 Contact: benjamin.gaignard@st.com
121 Reading returns the list possible enable modes.
123 What: /sys/bus/iio/devices/iio:deviceX/in_count0_enable_mode
125 Contact: benjamin.gaignard@st.com
127 Configure the device counter enable modes, in all case
128 counting direction is set by in_count0_count_direction
129 attribute and the counter is clocked by the internal clock.
131 Counter is always ON.
134 Counting is enabled when connected trigger signal
135 level is high else counting is disabled.
138 Counting is enabled on rising edge of the connected
139 trigger, and remains enabled for the duration of this
142 What: /sys/bus/iio/devices/iio:deviceX/in_count_trigger_mode_available
144 Contact: benjamin.gaignard@st.com
146 Reading returns the list possible trigger modes.
148 What: /sys/bus/iio/devices/iio:deviceX/in_count0_trigger_mode
150 Contact: benjamin.gaignard@st.com
152 Configure the device counter trigger mode
153 counting direction is set by in_count0_count_direction
154 attribute and the counter is clocked by the connected trigger