8000 mimxrt: Update the Qencoder section. · micropython/micropython@97e2d46 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97e2d46

Browse files
committed
mimxrt: Update the Qencoder section.
1 parent 26f9a98 commit 97e2d46

File tree

1 file changed

+15
-17
lines changed

1 file changed

+15
-17
lines changed

docs/mimxrt/machine.QENCD.rst

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,21 @@ Example usage::
2727
Constructors
2828
------------
2929

30-
.. class:: Qencoder(id, input_a, input_b, \*, keyword_arguments)
30+
.. class:: Qencoder(input_a, input_b, \*, keyword_arguments)
3131

3232
Construct and return a new Qencoder object using the following parameters:
3333

34-
- *id* is the id of the encoder. Suitable values are 1 and 2 for the i.MXRT102x
35-
and 1 to 4 for i.MXRT105x. i.MXRT106x.
3634
- *input_a* and *input_b* are the Quadrature encoder inputs, which are usually
3735
:ref:`machine.Pin <machine.Pin>` objects, but a port may allow other values,
3836
like integers or strings, which designate a Pin in the machine.PIN class.
3937

4038
Keyword arguments:
4139

4240
- *index*\=value. A Pin specifier telling to which pin the index pulse is connected.
43-
At an rising slop of the index pulse the position counter is set to the init value
41+
At an rising slope of the index pulse the position counter is set to the init value
4442
and the revolution counter in increased by one.
4543
- *home*\=value. A Pin specifier telling to which pin the home pulse is connected.
46-
At an rising slop of the home pulse the position counter taken as the new init
44+
At an rising slope of the home pulse the position counter taken as the new init
4745
value.
4846
- *match*\=value. A Pin specifier telling to which pin the match output is connected.
4947
This output will have a high level as long as the position counter matches the
@@ -75,22 +73,24 @@ Methods
7573
Modify settings for the Qencoder object. See the above constructor for details
7674
about the parameters.
7775

78-
.. method:: Qencoder.deinit([mask])
76+
.. method:: Qencoder.deinit()
7977

8078
Stops the Qencoder, disables interrupts and releases the resources used by the encoder.
8179

82-
.. method:: Qencoder.value([value])
80+
.. method:: Qencoder.position([value])
8381

8482
Get or set the current counters of the Qencoder as unsigned integers, with the position
8583
counter being a 32 bit item, and the revolution and difference counters being 16 bit
8684
items.
8785

88-
With no arguments a tuple with the Qencoder counters is returned, consisting of the
89-
position counter, the revolution counter and the difference of the position counter since
90-
the previous reading.
86+
With no arguments the actual counter values are returned. If a cycles value is set,
87+
the values are returned as a tuple consisting of the position counter, the
88+
revolution counter and the difference of the position counter since
89+
the previous reading. If a cycles values not set, the position is returned as an
90+
48 bit unsigned integer of the total event count as **revolution \* 2\*\*32 + position**.
9191

92-
With a single *value* argument the position counter is set to that value and the revolution
93-
counter and difference counter are cleared.
92+
With a single *value* argument the position counter is set to that value. If a cycles value
93+
is set, the revolution counter and difference counter are cleared.
9494

9595
.. method:: Qencoder.compare([value])
9696

@@ -160,12 +160,10 @@ Example usage::
160160
Constructors
161161
------------
162162

163-
.. class:: Counter(id, input, \*, keyword_arguments)
163+
.. class:: Counter(input, \*, keyword_arguments)
164164

165165
Construct and return a new Counter object using the following parameters:
166166

167-
- *id* is the id of the counter. Suitable values are 1 and 2 for the i.MXRT102x
168-
and 1 to 4 for i.MXRT105x. i.MXRT106x.
169167
- *input* is the Counter input pin, which is usually a
170168
:ref:`machine.Pin <machine.Pin>` object, but a port may allow other values,
171169
like integers or strings, which designate a Pin in the machine.PIN class.
@@ -198,11 +196,11 @@ Methods
198196
Modify settings for the Counter object. See the above constructor for details
199197
about the parameters.
200198

201-
.. method:: Counter.deinit([mask])
199+
.. method:: Counter.deinit()
202200

203201
Stops the Counter, disables interrupts and releases the resources used by the encoder.
204202

205-
.. method:: Counter.value([value])
203+
.. method:: Counter.count([value])
206204

207205
Get or set the current counter value of the Counter. The value is returned as a unsigned 48 bit
208206
integer.

0 commit comments

Comments
 (0)
0