hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/Documentation/ABI/testing/sysfs-bus-iio-timer-stm32
....@@ -3,67 +3,85 @@
33 Contact: benjamin.gaignard@st.com
44 Description:
55 Reading returns the list possible master modes which are:
6
- - "reset" : The UG bit from the TIMx_EGR register is
6
+
7
+
8
+ - "reset"
9
+ The UG bit from the TIMx_EGR register is
710 used as trigger output (TRGO).
8
- - "enable" : The Counter Enable signal CNT_EN is used
11
+ - "enable"
12
+ The Counter Enable signal CNT_EN is used
913 as trigger output.
10
- - "update" : The update event is selected as trigger output.
14
+ - "update"
15
+ The update event is selected as trigger output.
1116 For instance a master timer can then be used
1217 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.
18
+ - "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
+
1930 Additional modes (on TRGO2 only):
20
- - "OC5REF" : OC5REF signal is used as trigger output.
21
- - "OC6REF" : OC6REF signal is used as trigger output.
31
+
32
+ - "OC5REF"
33
+ OC5REF signal is used as trigger output.
34
+ - "OC6REF"
35
+ OC6REF signal is used as trigger output.
2236 - "compare_pulse_OC4REF":
23
- OC4REF rising or falling edges generate pulses.
37
+ OC4REF rising or falling edges generate pulses.
2438 - "compare_pulse_OC6REF":
25
- OC6REF rising or falling edges generate pulses.
39
+ OC6REF rising or falling edges generate pulses.
2640 - "compare_pulse_OC4REF_r_or_OC6REF_r":
27
- OC4REF or OC6REF rising edges generate pulses.
41
+ OC4REF or OC6REF rising edges generate pulses.
2842 - "compare_pulse_OC4REF_r_or_OC6REF_f":
29
- OC4REF rising or OC6REF falling edges generate pulses.
43
+ OC4REF rising or OC6REF falling edges generate
44
+ pulses.
3045 - "compare_pulse_OC5REF_r_or_OC6REF_r":
31
- OC5REF or OC6REF rising edges generate pulses.
46
+ OC5REF or OC6REF rising edges generate pulses.
3247 - "compare_pulse_OC5REF_r_or_OC6REF_f":
33
- OC5REF rising or OC6REF falling edges generate pulses.
48
+ OC5REF rising or OC6REF falling edges generate
49
+ pulses.
3450
35
- +-----------+ +-------------+ +---------+
36
- | Prescaler +-> | Counter | +-> | Master | TRGO(2)
37
- +-----------+ +--+--------+-+ |-> | Control +-->
38
- | | || +---------+
39
- +--v--------+-+ OCxREF || +---------+
40
- | Chx compare +----------> | Output | ChX
41
- +-----------+-+ | | Control +-->
42
- . | | +---------+
43
- . | | .
44
- +-----------v-+ OC6REF | .
45
- | Ch6 compare +---------+>
46
- +-------------+
51
+ ::
4752
48
- Example with: "compare_pulse_OC4REF_r_or_OC6REF_r":
53
+ +-----------+ +-------------+ +---------+
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
+ +-------------+
4965
50
- X
51
- X X
52
- X . . X
53
- X . . X
54
- X . . X
55
- count X . . . . X
56
- . . . .
57
- . . . .
58
- +---------------+
59
- OC4REF | . . |
60
- +-+ . . +-+
61
- . +---+ .
62
- OC6REF . | | .
63
- +-------+ +-------+
64
- +-+ +-+
65
- TRGO2 | | | |
66
- +-+ +---+ +---------+
66
+ 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
+ +-+ +---+ +---------+
6785
6886 What: /sys/bus/iio/devices/triggerX/master_mode
6987 KernelVersion: 4.11
....@@ -91,29 +109,6 @@
91109 When counting down the counter start from preset value
92110 and fire event when reach 0.
93111
94
-What: /sys/bus/iio/devices/iio:deviceX/in_count_quadrature_mode_available
95
-KernelVersion: 4.12
96
-Contact: benjamin.gaignard@st.com
97
-Description:
98
- Reading returns the list possible quadrature modes.
99
-
100
-What: /sys/bus/iio/devices/iio:deviceX/in_count0_quadrature_mode
101
-KernelVersion: 4.12
102
-Contact: benjamin.gaignard@st.com
103
-Description:
104
- Configure the device counter quadrature modes:
105
- channel_A:
106
- Encoder A input servers as the count input and B as
107
- the UP/DOWN direction control input.
108
-
109
- channel_B:
110
- Encoder B input serves as the count input and A as
111
- the UP/DOWN direction control input.
112
-
113
- quadrature:
114
- Encoder A and B inputs are mixed to get direction
115
- and count with a scale of 0.25.
116
-
117112 What: /sys/bus/iio/devices/iio:deviceX/in_count_enable_mode_available
118113 KernelVersion: 4.12
119114 Contact: benjamin.gaignard@st.com
....@@ -127,6 +122,7 @@
127122 Configure the device counter enable modes, in all case
128123 counting direction is set by in_count0_count_direction
129124 attribute and the counter is clocked by the internal clock.
125
+
130126 always:
131127 Counter is always ON.
132128