diff options
author | Andrew Leech <andrew@alelec.net> | 2020-07-28 16:27:19 +1000 |
---|---|---|
committer | Damien George <damien@micropython.org> | 2021-05-20 23:08:43 +1000 |
commit | 9d58d46e0a28b7bd3344cae049e8085bcd75cb75 (patch) | |
tree | 4c6120c2b6ea00707c747d126d524bed14f46998 | |
parent | 7408ca1d7857df5ea348da35c9ee12f70a024478 (diff) |
docs/library/pyb.Pin.rst: Update the arguments for Pin.init().
Add details for Pin.init() value and alt arguments.
-rw-r--r-- | docs/library/pyb.Pin.rst | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/docs/library/pyb.Pin.rst b/docs/library/pyb.Pin.rst index 3d019cd8e..6465653f7 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``. |