Skip to content

Commit 0e44587

Browse files
committed
docs/library/machine.Pin.rst: Make it clear which methods are not core.
Signed-off-by: Damien George <[email protected]>
1 parent 195e7df commit 0e44587

File tree

1 file changed

+37
-21
lines changed

1 file changed

+37
-21
lines changed

docs/library/machine.Pin.rst

Lines changed: 37 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ Usage Model::
3333
# read and print the pin value
3434
print(p2.value())
3535

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)
3838

3939
# configure an irq callback
4040
p0.irq(lambda p:print(p))
@@ -160,25 +160,6 @@ Methods
160160

161161
Set pin to "0" output level.
162162

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-
182163
.. method:: Pin.irq(handler=None, trigger=(Pin.IRQ_FALLING | Pin.IRQ_RISING), *, priority=1, wake=None, hard=False)
183164

184165
Configure an interrupt handler to be called when the trigger source of the
@@ -220,6 +201,41 @@ Methods
220201

221202
This method returns a callback object.
222203

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+
223239
Constants
224240
---------
225241

0 commit comments

Comments
 (0)