From 0c872ecd01d6782ae9d37b6eb721404a4a48f356 Mon Sep 17 00:00:00 2001 From: Tom Rix Date: Fri, 15 May 2009 23:48:36 +0200 Subject: OMAP3 Port kernel omap gpio interface. Port version 2.6.27 of the linux kernel's omap gpio interface to u-boot. The orignal source is in linux/arch/arm/plat-omap/gpio.c See doc/README.omap3 for instructions on use. Signed-off-by: Tom Rix --- doc/README.omap3 | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'doc') diff --git a/doc/README.omap3 b/doc/README.omap3 index 9ab09793e..e05e816df 100644 --- a/doc/README.omap3 +++ b/doc/README.omap3 @@ -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 ================ -- cgit v1.2.3