]> git.karo-electronics.de Git - karo-tx-uboot.git/blobdiff - doc/README.omap3
OMAP3 Port kernel omap gpio interface.
[karo-tx-uboot.git] / doc / README.omap3
index 9ab09793ec8026229c43019003ab1b036c924ded..e05e816df4b0a2a495775799f504b7138e26dbbc 100644 (file)
@@ -84,6 +84,38 @@ For all other commands see
 
 help
 
+Interfaces
+==========
+
+gpio
+
+To set a bit :
+
+       if (!omap_request_gpio(N)) {
+               omap_set_gpio_direction(N, 0);
+               omap_set_gpio_dataout(N, 1);
+       }
+
+To clear a bit :
+
+       if (!omap_request_gpio(N)) {
+               omap_set_gpio_direction(N, 0);
+               omap_set_gpio_dataout(N, 0);
+       }
+
+To read a bit :
+
+       if (!omap_request_gpio(N)) {
+               omap_set_gpio_direction(NULL, 1);
+               val = omap_get_gpio_datain(N);
+               omap_free_gpio(N);
+       }
+       if (val)
+               printf("GPIO N is set\n");
+       else
+               printf("GPIO N is clear\n");
+
+
 Acknowledgements
 ================