Check if the GPIO is exported.
- gpio_num: the GPIO pin number.
- 1 for true, the GPIO is exported.
- 0 for false, the GPIO is not exported.
Export the GPIO.
- gpio_num: the GPIO pin number.
- 0 on success.
- negative numbers on error.
Unexport the GPIO.
- gpio_num: the GPIO pin number.
- 0 on success.
- negative numbers on error.
Set the direction of the GPIO.
- gpio_num: the GPIO pin number.
- direction:
- 0: in
- 1: out
- 0 on success.
- negative numbers on error.
Get the direction of the GPIO.
- gpio_num: the GPIO pin number.
- direction: where the output value will be set.
- 0 on success.
- negative numbers on error.
Set the value of the GPIO.
- gpio_num: the GPIO pin number.
- value:
- 0: low
- 1: high
- 0 on success.
- negative numbers on error.
Get the value of the GPIO.
- gpio_num: the GPIO pin number.
- value: where the output value will be set.
- 0 on success.
- negative numbers on error.