blob: c4a4497c249aa5e154c06d9cf6056e7c97418264 [file] [log] [blame]
Andrew Scullb4b6d4a2019-01-02 15:54:55 +00001What: /sys/bus/iio/devices/triggerX/master_mode_available
2KernelVersion: 4.11
3Contact: benjamin.gaignard@st.com
4Description:
5 Reading returns the list possible master modes which are:
Olivier Deprez157378f2022-04-04 15:47:50 +02006
7
8 - "reset"
9 The UG bit from the TIMx_EGR register is
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000010 used as trigger output (TRGO).
Olivier Deprez157378f2022-04-04 15:47:50 +020011 - "enable"
12 The Counter Enable signal CNT_EN is used
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000013 as trigger output.
Olivier Deprez157378f2022-04-04 15:47:50 +020014 - "update"
15 The update event is selected as trigger output.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000016 For instance a master timer can then be used
17 as a prescaler for a slave timer.
Olivier Deprez157378f2022-04-04 15:47:50 +020018 - "compare_pulse"
19 The trigger output send a positive pulse
20 when the CC1IF flag is to be set.
21 - "OC1REF"
22 OC1REF signal is used as trigger output.
23 - "OC2REF"
24 OC2REF signal is used as trigger output.
25 - "OC3REF"
26 OC3REF signal is used as trigger output.
27 - "OC4REF"
28 OC4REF signal is used as trigger output.
29
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000030 Additional modes (on TRGO2 only):
Olivier Deprez157378f2022-04-04 15:47:50 +020031
32 - "OC5REF"
33 OC5REF signal is used as trigger output.
34 - "OC6REF"
35 OC6REF signal is used as trigger output.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000036 - "compare_pulse_OC4REF":
Olivier Deprez157378f2022-04-04 15:47:50 +020037 OC4REF rising or falling edges generate pulses.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000038 - "compare_pulse_OC6REF":
Olivier Deprez157378f2022-04-04 15:47:50 +020039 OC6REF rising or falling edges generate pulses.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000040 - "compare_pulse_OC4REF_r_or_OC6REF_r":
Olivier Deprez157378f2022-04-04 15:47:50 +020041 OC4REF or OC6REF rising edges generate pulses.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000042 - "compare_pulse_OC4REF_r_or_OC6REF_f":
Olivier Deprez157378f2022-04-04 15:47:50 +020043 OC4REF rising or OC6REF falling edges generate
44 pulses.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000045 - "compare_pulse_OC5REF_r_or_OC6REF_r":
Olivier Deprez157378f2022-04-04 15:47:50 +020046 OC5REF or OC6REF rising edges generate pulses.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000047 - "compare_pulse_OC5REF_r_or_OC6REF_f":
Olivier Deprez157378f2022-04-04 15:47:50 +020048 OC5REF rising or OC6REF falling edges generate
49 pulses.
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000050
Olivier Deprez157378f2022-04-04 15:47:50 +020051 ::
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000052
Olivier Deprez157378f2022-04-04 15:47:50 +020053 +-----------+ +-------------+ +---------+
54 | Prescaler +-> | Counter | +-> | Master | TRGO(2)
55 +-----------+ +--+--------+-+ |-> | Control +-->
56 | | || +---------+
57 +--v--------+-+ OCxREF || +---------+
58 | Chx compare +----------> | Output | ChX
59 +-----------+-+ | | Control +-->
60 . | | +---------+
61 . | | .
62 +-----------v-+ OC6REF | .
63 | Ch6 compare +---------+>
64 +-------------+
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000065
Olivier Deprez157378f2022-04-04 15:47:50 +020066 Example with: "compare_pulse_OC4REF_r_or_OC6REF_r"::
67
68 X
69 X X
70 X . . X
71 X . . X
72 X . . X
73 count X . . . . X
74 . . . .
75 . . . .
76 +---------------+
77 OC4REF | . . |
78 +-+ . . +-+
79 . +---+ .
80 OC6REF . | | .
81 +-------+ +-------+
82 +-+ +-+
83 TRGO2 | | | |
84 +-+ +---+ +---------+
Andrew Scullb4b6d4a2019-01-02 15:54:55 +000085
86What: /sys/bus/iio/devices/triggerX/master_mode
87KernelVersion: 4.11
88Contact: benjamin.gaignard@st.com
89Description:
90 Reading returns the current master modes.
91 Writing set the master mode
92
93What: /sys/bus/iio/devices/triggerX/sampling_frequency
94KernelVersion: 4.11
95Contact: benjamin.gaignard@st.com
96Description:
97 Reading returns the current sampling frequency.
98 Writing an value different of 0 set and start sampling.
99 Writing 0 stop sampling.
100
101What: /sys/bus/iio/devices/iio:deviceX/in_count0_preset
102KernelVersion: 4.12
103Contact: benjamin.gaignard@st.com
104Description:
105 Reading returns the current preset value.
106 Writing sets the preset value.
107 When counting up the counter starts from 0 and fires an
108 event when reach preset value.
109 When counting down the counter start from preset value
110 and fire event when reach 0.
111
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000112What: /sys/bus/iio/devices/iio:deviceX/in_count_enable_mode_available
113KernelVersion: 4.12
114Contact: benjamin.gaignard@st.com
115Description:
116 Reading returns the list possible enable modes.
117
118What: /sys/bus/iio/devices/iio:deviceX/in_count0_enable_mode
119KernelVersion: 4.12
120Contact: benjamin.gaignard@st.com
121Description:
122 Configure the device counter enable modes, in all case
123 counting direction is set by in_count0_count_direction
124 attribute and the counter is clocked by the internal clock.
Olivier Deprez157378f2022-04-04 15:47:50 +0200125
Andrew Scullb4b6d4a2019-01-02 15:54:55 +0000126 always:
127 Counter is always ON.
128
129 gated:
130 Counting is enabled when connected trigger signal
131 level is high else counting is disabled.
132
133 triggered:
134 Counting is enabled on rising edge of the connected
135 trigger, and remains enabled for the duration of this
136 selected mode.
137
138What: /sys/bus/iio/devices/iio:deviceX/in_count_trigger_mode_available
139KernelVersion: 4.13
140Contact: benjamin.gaignard@st.com
141Description:
142 Reading returns the list possible trigger modes.
143
144What: /sys/bus/iio/devices/iio:deviceX/in_count0_trigger_mode
145KernelVersion: 4.13
146Contact: benjamin.gaignard@st.com
147Description:
148 Configure the device counter trigger mode
149 counting direction is set by in_count0_count_direction
150 attribute and the counter is clocked by the connected trigger
151 rising edges.