1
0
mirror of https://github.com/xtacocorex/CHIP_IO synced 2025-07-20 04:43:21 +00:00

implementation and close #75 - enabling a timeout for the wait_for_edge function

This commit is contained in:
Robert Wolterman
2017-09-03 21:43:59 -05:00
parent a0b2ac12a6
commit e3a077bf82
8 changed files with 26 additions and 11 deletions

View File

@ -227,13 +227,14 @@ Add callback function to a pin that has been setup for edge detection. Refer to
GPIO.add_event_callback("XIO-P7", mycallback, 45)
```
### wait_for_edge(channel, edge)
### wait_for_edge(channel, edge, timeout=-1)
Wait for an edge to be detected. This is a blocking function. Refer to main table for which pins are able to use edge detection.
* Parameters
channel - GPIO Pin
edge - edge: RISING_EDGE, FALLING_EDGE, BOTH_EDGE
timeout - timeout in milliseconds to wait before exiting function (optional)
* Returns
@ -245,6 +246,7 @@ Wait for an edge to be detected. This is a blocking function. Refer to main tab
GPIO.wait_for_edge("XIO-P3", GPIO.RISING_EDGE)
GPIO.wait_for_edge("AP-EINT3", GPIO.BOTH_EDGE)
GPIO.wait_for_edge("I2S-DI", GPIO.FALLING_EDGE)
GPIO.wait_for_edge("XIO-P3", GPIO.RISING_EDGE, 40)
```
### gpio_function(channel)