diff --git a/depthai-core b/depthai-core index 7471b2d3e..d846a0b68 160000 --- a/depthai-core +++ b/depthai-core @@ -1 +1 @@ -Subproject commit 7471b2d3e4f11027a5a7b1d40564738d407d7c79 +Subproject commit d846a0b68323104a0fc658720be2bf913bbff3c4 diff --git a/docs/source/components/nodes/script.rst b/docs/source/components/nodes/script.rst index 1e8bc1f0a..a5b5123e2 100644 --- a/docs/source/components/nodes/script.rst +++ b/docs/source/components/nodes/script.rst @@ -91,15 +91,34 @@ Usage Interfacing with GPIOs ###################### -In the script node you can interface with GPIOs of the VPU. Currently supported functions are: +In the script node you can interface with GPIOs of the VPU using module GPIO. Currently supported functions are: .. code-block:: python - import GPIO # module - GPIO.read(pin) - GPIO.write(pin, value) - GPIO.setPwm(pin, highCount, lowCount, repeat=0) # repeat == 0 means indefinite - GPIO.enablePwm(pin, enable) + # Module + import GPIO + + # General + GPIO.setup(gpio, dir, pud, exclusive) + GPIO.release(gpio) + GPIO.write(gpio, value) + GPIO.read(gpio) + + # Interrupts + GPIO.waitInterruptEvent(gpio = -1) # blocks until any interrupt or interrupt by specified gpio is fired. Interrupts with callbacks are ignored here + GPIO.hasInterruptEvent(gpio = -1) # returns whether interrupt happened on any or specfied gpio. Interrupts with callbacks are ignored here + GPIO.setInterrupt(gpio, edge, priority, callback = None) # adds interrupt to specified pin + GPIO.clearInterrupt(gpio) # clears interrupt of specified pin + + # PWM + GPIO.setPwm(gpio, highCount, lowCount, repeat=0) # repeat == 0 means indefinite + GPIO.enablePwm(gpio, enable) + + # Enumerations + GPIO.Direction: GPIO.IN, GPIO.OUT + GPIO.State: GPIO.LOW, GPIO.HIGH + GPIO.PullDownUp: GPIO.PULL_NONE, GPIO.PULL_DOWN, GPIO.PULL_UP + GPIO.Edge: GPIO.RISING, GPIO.FALLING, GPIO.LEVEL_HIGH, GPIO.LEVEL_LOW Using DepthAI :ref:`Messages ` ###################################################