gpio_set_dir()

Set the GPIO direction

Synopsis:

#include <hw/gpio_api.h>

int32_t gpio_set_dir( int32_t gpio_fd,
                      gpio_header_t hdr,
                      gpio_dir_t dir );

Arguments:

gpio_fd
The file descriptor of a GPIO device.
hdr
The GPIO header identifying a GPIO pin.
dir
The GPIO direction value.

Description:

The gpio_set_dir() function sets the GPIO direction of a pin.

Returns:

0 on success, or -1 if an error occurs (errno is set).

Errors:

Any error value that MsgSend() can return, or:

EINVAL
The reply value is outside the int32_t range.
Page updated: