This module provides functions to set and get values of a GPIO.
More...
This module provides functions to set and get values of a GPIO.
◆ mygpio_gpioblink()
| bool mygpio_gpioblink |
( |
struct t_mygpio_connection * | connection, |
|
|
unsigned | gpio, |
|
|
int | timeout_ms, |
|
|
int | interval_ms ) |
Toggles the value of a configured output GPIO at given timeout and interval.
- Parameters
-
| connection | Pointer to the connection struct returned by mygpio_connection_new. |
| gpio | GPIO number |
| timeout_ms | timeout in milliseconds |
| interval_ms | interval in milliseconds, set it 0 to blink only once. |
- Returns
- true on success, else false.
◆ mygpio_gpioget()
Returns the current value of a configured input or output GPIO.
- Parameters
-
| connection | Pointer to the connection struct returned by mygpio_connection_new. |
| gpio | GPIO number |
- Returns
- Value of the GPIO or MYGPIO_GPIO_VALUE_UNKNOWN on error.
◆ mygpio_gpioset()
Sets the value of a configured output GPIO.
- Parameters
-
| connection | Pointer to the connection struct returned by mygpio_connection_new. |
| gpio | GPIO number |
| value | Value to set: MYGPIO_GPIO_VALUE_INACTIVE or MYGPIO_GPIO_VALUE_ACTIVE |
- Returns
- true on success, else false.
◆ mygpio_gpiotoggle()
Toggles the value of a configured output GPIO.
- Parameters
-
| connection | Pointer to the connection struct returned by mygpio_connection_new. |
| gpio | GPIO number |
- Returns
- true on success, else false.