Tuesday, March 16, 2010

GPIO update

It seems the gpio 156 can be used as an output. That was given in both mux.c and board-omap3beagle.c.

The board-omap3beagle.c has many init subfunction. One of them enable the gpio.

Try the following code.

#include
// at setup time
result = gpio_request(158, "gpiotest");
allocated = (result >= 0);
if(allocated) gpio_direction_output(158, 1);
// to change the output
if(allocated) gpio_set_value(158, i & 1);
// at cleanup time
if(allocated) gpio_free(158);

No comments:

Post a Comment