diff options
| author | Daniel Campora <daniel@wipy.io> | 2015-06-28 12:53:37 +0200 |
|---|---|---|
| committer | Daniel Campora <daniel@wipy.io> | 2015-06-28 14:14:22 +0200 |
| commit | 813b581127ee78217a08cbb35c23baf5941f6506 (patch) | |
| tree | 9089cf0cde365a6023a3ec332804134ecf6c9f3f /docs | |
| parent | 778413168b44ae606010b2439ae2f23c83df3935 (diff) | |
cc3200: Add `Pin.name()` method.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/library/pyb.Pin.rst | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/docs/library/pyb.Pin.rst b/docs/library/pyb.Pin.rst index 77a96494e..092af11c7 100644 --- a/docs/library/pyb.Pin.rst +++ b/docs/library/pyb.Pin.rst @@ -72,7 +72,7 @@ Usage Model: You can also configure the Pin to generate interrupts. For instance:: def pincb(pin): - print(pin.info().name) + print(pin.name()) pin_int = pyb.Pin('GPIO10', af=0, mode=Pin.IN, type=pyb.Pin.STD_PD, strength=pyb.Pin.S2MA) pin_int.callback (mode=pyb.Pin.INT_RISING, handler=pincb) @@ -229,10 +229,12 @@ Methods will match one of the allowed constants for the mode argument to the init function. - .. method:: pin.name() - - Get the pin name. - +.. method:: pin.name() + + Get the pin name. + +.. only:: port_pyboard + .. method:: pin.names() Returns the cpu and board names for this pin. @@ -262,6 +264,11 @@ Methods Return a 5-tuple with the configuration of the pin: ``(name, alternate-function, mode, type, strength)`` + .. warning:: + This method cannot be called within a callback (interrupt-context) + because it needs to allocate memory to return the tuple and memory + allocations are disabled while interrupts are being serviced. + .. method:: pin.callback(\*, mode, priority=1, handler=None, wakes=pyb.Sleep.ACTIVE) Create a callback to be triggered when the input level at the pin changes. |
