From 9d58d46e0a28b7bd3344cae049e8085bcd75cb75 Mon Sep 17 00:00:00 2001 From: Andrew Leech Date: Tue, 28 Jul 2020 16:27:19 +1000 Subject: [PATCH] docs/library/pyb.Pin.rst: Update the arguments for Pin.init(). Add details for Pin.init() value and alt arguments. --- docs/library/pyb.Pin.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docs/library/pyb.Pin.rst b/docs/library/pyb.Pin.rst index 3d019cd8e0..6465653f74 100644 --- a/docs/library/pyb.Pin.rst +++ b/docs/library/pyb.Pin.rst @@ -98,11 +98,11 @@ Class methods Methods ------- -.. method:: Pin.init(mode, pull=Pin.PULL_NONE, af=-1) +.. method:: Pin.init(mode, pull=Pin.PULL_NONE, \*, value=None, alt=-1) Initialise the pin: - - ``mode`` can be one of: + - *mode* can be one of: - ``Pin.IN`` - configure the pin for input; - ``Pin.OUT_PP`` - configure the pin for output, with push-pull control; @@ -111,14 +111,17 @@ Methods - ``Pin.AF_OD`` - configure the pin for alternate function, open-drain; - ``Pin.ANALOG`` - configure the pin for analog. - - ``pull`` can be one of: + - *pull* can be one of: - ``Pin.PULL_NONE`` - no pull up or down resistors; - ``Pin.PULL_UP`` - enable the pull-up resistor; - ``Pin.PULL_DOWN`` - enable the pull-down resistor. - - when mode is ``Pin.AF_PP`` or ``Pin.AF_OD``, then af can be the index or name - of one of the alternate functions associated with a pin. + - *value* if not None will set the port output value before enabling the pin. + + - *alt* can be used when mode is ``Pin.AF_PP`` or ``Pin.AF_OD`` to set the + index or name of one of the alternate functions associated with a pin. + This arg was previously called *af* which can still be used if needed. Returns: ``None``.