gpio_dir()

Get or set the GPIO direction of a pin

Synopsis:

#include <hw/gpio_hw.h>

int32_t (*gpio_dir)( gpio_header_t *gpio_hdr,
                     gpio_dir_t *dir,
                     uint8_t set );

Arguments:

gpio_hdr
A pointer to the GPIO header.
dir
A pointer to the GPIO direction; input for set and output for get.
set
The operation selector. The GPIO_CFG_SET flag sets the direction. Otherwise, the function returns the current direction.

Description:

The gpio_dir() function gets or sets the GPIO direction of a pin. Using this function is optional.

Returns:

EOK on success or errno if an error occurred.

Page updated: