@@ -27,12 +27,10 @@ Example usage::
27
27
Constructors
28
28
------------
29
29
30
- .. class :: Qencoder(id, input_a, input_b, \*, keyword_arguments)
30
+ .. class :: Qencoder(input_a, input_b, \*, keyword_arguments)
31
31
32
32
Construct and return a new Qencoder object using the following parameters:
33
33
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.
36
34
- *input_a * and *input_b * are the Quadrature encoder inputs, which are usually
37
35
:ref: `machine.Pin <machine.Pin >` objects, but a port may allow other values,
38
36
like integers or strings, which designate a Pin in the machine.PIN class.
@@ -75,22 +73,24 @@ Methods
75
73
Modify settings for the Qencoder object. See the above constructor for details
76
74
about the parameters.
77
75
78
- .. method :: Qencoder.deinit([mask] )
76
+ .. method :: Qencoder.deinit()
79
77
80
78
Stops the Qencoder, disables interrupts and releases the resources used by the encoder.
81
79
82
- .. method :: Qencoder.value ([value])
80
+ .. method :: Qencoder.position ([value])
83
81
84
82
Get or set the current counters of the Qencoder as unsigned integers, with the position
85
83
counter being a 32 bit item, and the revolution and difference counters being 16 bit
86
84
items.
87
85
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.
91
91
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.
94
94
95
95
.. method :: Qencoder.compare([value])
96
96
@@ -160,12 +160,10 @@ Example usage::
160
160
Constructors
161
161
------------
162
162
163
- .. class :: Counter(id, input, \*, keyword_arguments)
163
+ .. class :: Counter(input, \*, keyword_arguments)
164
164
165
165
Construct and return a new Counter object using the following parameters:
166
166
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.
169
167
- *input * is the Counter input pin, which is usually a
170
168
:ref: `machine.Pin <machine.Pin >` object, but a port may allow other values,
171
169
like integers or strings, which designate a Pin in the machine.PIN class.
@@ -198,11 +196,11 @@ Methods
198
196
Modify settings for the Counter object. See the above constructor for details
199
197
about the parameters.
200
198
201
- .. method :: Counter.deinit([mask] )
199
+ .. method :: Counter.deinit()
202
200
203
201
Stops the Counter, disables interrupts and releases the resources used by the encoder.
204
202
205
- .. method :: Counter.value ([value])
203
+ .. method :: Counter.count ([value])
206
204
207
205
Get or set the current counter value of the Counter. The value is returned as a unsigned 48 bit
208
206
integer.
0 commit comments