GPIO platform configuration module

I assume that you use Legato. Since Legato is running Linux you could use normal file operations for handling the different GPIO:s. Below you can find an example that export the GPIO6 and set direction to output. Note that if you use a the dev kit for WP7104 there is a mismatch between the labels for the pins on the board and the actual GPIO name.
GPIO6 of the WP7104 is actuallt labelled GPIO11 on the dev kit, see PTS for WP7104 and dev kit.

void init_gpio()
{
	LE_INFO("Enter init_gpio");
	if (le_dir_IsDir("/sys/class/gpio/gpio6"))
	{
		LE_DEBUG("Gpio already initialized");
		return;
	}
	int fd = open("/sys/class/gpio/export", O_WRONLY);
	if (fd < 0)
	{
		LE_DEBUG("Failed to open gpio export\n");
		return;
	}
	else
	{
		LE_DEBUG("gpio export opened\n");
	}
	write(fd, "6",1);
	close(fd);

	fd = open("/sys/class/gpio/gpio6/direction", O_WRONLY);
	if (fd < 0)
	{
		LE_DEBUG("Failed to open gpio6 direction\n");
		return;
	}
	else
	{
		LE_DEBUG("gpio6 direction opened\n");
	}
	write(fd, "out",3);
	close(fd);


}