Add modals for Pin modes.

master
Paul Sokolovsky 2015-11-03 19:55:57 +02:00
rodzic 41d3e3a9ad
commit 1dfcd7cffb
1 zmienionych plików z 4 dodań i 4 usunięć

@ -132,14 +132,14 @@ Creates and initilizes a pin.
- `mode`: is mandatory and positional (can be kw). Specifies pin mode:
- `Pin.IN` - Pin configured for input; there's additional requirement that, if viewed as output, pin was in high-impedance state. This requirement is almost universally satisfied by any MCU.
- `Pin.OUT` - Pin configured for (normal) output.
- `Pin.OPEN_DRAIN` - Pin configured for open-drain output, with special requirements for input handling. Open-drain output works in following way: if output value is set to 0, pin is low level; if output value is 1, pin is in high impedance state. Some MCUs don't support open-drain outputs directly, but it's almost always possible to emulate it (by outputting low level, in case of 0 value, or setting pin as input in case of 1 value). It is recommended that software implemented such emulation (see below for additional requirements for input handling).
- `Pin.ALT` - Pin is configured to perform alternative function, which is MCU-specific. For pin configured in such way, any other Pin methods (except .init()) are not applicable (calling them will lead to undefined, or hardware-specific, result)
- `Pin.ALT_OPEN_DRAIN` - Same as `Pin.ALT`, but pin is set as open-drain.
- `Pin.OPEN_DRAIN` RECOMMENDED - Pin configured for open-drain output, with special requirements for input handling. Open-drain output works in following way: if output value is set to 0, pin is low level; if output value is 1, pin is in high impedance state. Some MCUs don't support open-drain outputs directly, but it's almost always possible to emulate it (by outputting low level, in case of 0 value, or setting pin as input in case of 1 value). It is recommended that software implemented such emulation (see below for additional requirements for input handling).
- `Pin.ALT` OPTIONAL - Pin is configured to perform alternative function, which is MCU-specific. For pin configured in such way, any other Pin methods (except .init()) are not applicable (calling them will lead to undefined, or hardware-specific, result)
- `Pin.ALT_OPEN_DRAIN` OPTIONAL - Same as `Pin.ALT`, but pin is set as open-drain.
- `pull` is optional and positional (also can be named).
- The rest of args are kwonly.
- `value` is required for a software to implement; it is valid only for `Pin.OUT` and `Pin.OPEN_DRAIN` modes and specifies initial output pin value if given.
- The rest are optional for software to implement, and a software can define them and also define others.
- `alt` specifies an alternate function, it is optional and the values it takes vary per MCU. Exists to allow advanced pin operations for software that support it. This argument is valid only for `Pin.ALT` and `Pin.ALT_OPEN_DRAIN` modes. It may be used when a pin supports more than one alternate function. If only one pin alternate function is support for particular MCU, it is not required.
- `alt` specifies an alternate function, it is optional and the values it takes vary per MCU. It exists to allow advanced pin operations for software that support it. This argument is valid only for `Pin.ALT` and `Pin.ALT_OPEN_DRAIN` modes. It may be used when a pin supports more than one alternate function. If only one pin alternate function is support for particular MCU, it is not required.
### Pins with alternate function(s)