@@ -33,8 +33,8 @@ Usage Model::
33
33
# read and print the pin value
34
34
print(p2.value())
35
35
36
- # reconfigure pin #0 in input mode
37
- p0.mode (p0.IN)
36
+ # reconfigure pin #0 in input mode with a pull down resistor
37
+ p0.init (p0.IN, p0.PULL_DOWN )
38
38
39
39
# configure an irq callback
40
40
p0.irq(lambda p:print(p))
@@ -160,25 +160,6 @@ Methods
160
160
161
161
Set pin to "0" output level.
162
162
163
- .. method :: Pin.mode([mode])
164
-
165
- Get or set the pin mode.
166
- See the constructor documentation for details of the ``mode `` argument.
167
-
168
- .. method :: Pin.pull([pull])
169
-
170
- Get or set the pin pull state.
171
- See the constructor documentation for details of the ``pull `` argument.
172
-
173
- .. method :: Pin.drive([drive])
174
-
175
- Get or set the pin drive strength.
176
- See the constructor documentation for details of the ``drive `` argument.
177
-
178
- Not all ports implement this method.
179
-
180
- Availability: WiPy.
181
-
182
163
.. method :: Pin.irq(handler=None, trigger=(Pin.IRQ_FALLING | Pin.IRQ_RISING), *, priority=1, wake=None, hard=False)
183
164
184
165
Configure an interrupt handler to be called when the trigger source of the
@@ -220,6 +201,41 @@ Methods
220
201
221
202
This method returns a callback object.
222
203
204
+ The following methods are not part of the core Pin API and only implemented on certain ports.
205
+
206
+ .. method :: Pin.low()
207
+
208
+ Set pin to "0" output level.
209
+
210
+ Availability: nrf, rp2, stm32 ports.
211
+
212
+ .. method :: Pin.high()
213
+
214
+ Set pin to "1" output level.
215
+
216
+ Availability: nrf, rp2, stm32 ports.
217
+
218
+ .. method :: Pin.mode([mode])
219
+
220
+ Get or set the pin mode.
221
+ See the constructor documentation for details of the ``mode `` argument.
222
+
223
+ Availability: cc3200, stm32 ports.
224
+
225
+ .. method :: Pin.pull([pull])
226
+
227
+ Get or set the pin pull state.
228
+ See the constructor documentation for details of the ``pull `` argument.
229
+
230
+ Availability: cc3200, stm32 ports.
231
+
232
+ .. method :: Pin.drive([drive])
233
+
234
+ Get or set the pin drive strength.
235
+ See the constructor documentation for details of the ``drive `` argument.
236
+
237
+ Availability: cc3200 port.
238
+
223
239
Constants
224
240
---------
225
241
0 commit comments