docs/library/pyb.Pin: Fix out-of-context paragraphs, and AF_PP typo.

Remove out of context callback paragraph, it was part of the wipy docs.
And move the paragraph about PULL_UP/PULL_DOWN resistor values to within
the init() method docs.  Also fix pull-pull -> push-pull.

Signed-off-by: Chris Mason <c.mason@inchipdesign.com.au>
This commit is contained in:
chrismas9 2022-06-26 22:59:09 +10:00 committed by Damien George
parent fe5598452d
commit e168d47424

View File

@ -58,16 +58,6 @@ an ordinal pin number:
You can set ``pyb.Pin.debug(True)`` to get some debug information about You can set ``pyb.Pin.debug(True)`` to get some debug information about
how a particular object gets mapped to a pin. how a particular object gets mapped to a pin.
When a pin has the ``Pin.PULL_UP`` or ``Pin.PULL_DOWN`` pull-mode enabled,
that pin has an effective 40k Ohm resistor pulling it to 3V3 or GND
respectively (except pin Y5 which has 11k Ohm resistors).
Now every time a falling edge is seen on the gpio pin, the callback will be
executed. Caution: mechanical push buttons have "bounce" and pushing or
releasing a switch will often generate multiple edges.
See: http://www.eng.utah.edu/~cs5780/debouncing.pdf for a detailed
explanation, along with various techniques for debouncing.
All pin objects go through the pin mapper to come up with one of the All pin objects go through the pin mapper to come up with one of the
gpio pins. gpio pins.
@ -107,7 +97,7 @@ Methods
- ``Pin.IN`` - configure the pin for input; - ``Pin.IN`` - configure the pin for input;
- ``Pin.OUT_PP`` - configure the pin for output, with push-pull control; - ``Pin.OUT_PP`` - configure the pin for output, with push-pull control;
- ``Pin.OUT_OD`` - configure the pin for output, with open-drain control; - ``Pin.OUT_OD`` - configure the pin for output, with open-drain control;
- ``Pin.AF_PP`` - configure the pin for alternate function, pull-pull; - ``Pin.AF_PP`` - configure the pin for alternate function, push-pull;
- ``Pin.AF_OD`` - configure the pin for alternate function, open-drain; - ``Pin.AF_OD`` - configure the pin for alternate function, open-drain;
- ``Pin.ANALOG`` - configure the pin for analog. - ``Pin.ANALOG`` - configure the pin for analog.
@ -117,6 +107,10 @@ Methods
- ``Pin.PULL_UP`` - enable the pull-up resistor; - ``Pin.PULL_UP`` - enable the pull-up resistor;
- ``Pin.PULL_DOWN`` - enable the pull-down resistor. - ``Pin.PULL_DOWN`` - enable the pull-down resistor.
When a pin has the ``Pin.PULL_UP`` or ``Pin.PULL_DOWN`` pull-mode enabled,
that pin has an effective 40k Ohm resistor pulling it to 3V3 or GND
respectively (except pin Y5 which has 11k Ohm resistors).
- *value* if not None will set the port output value before enabling the 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 - *alt* can be used when mode is ``Pin.AF_PP`` or ``Pin.AF_OD`` to set the