lpcware

GPIO numbering on uclinux

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by bomellberg on Fri Apr 10 00:16:30 MST 2015
In uClinux, you can address GPIO in user space by enabling gpio like this:

echo 12 > /sys/class/gpio/export

which gives you a virtual directory named "gpio12" where you can set direction and high/low etc.

My question is: How do I find out the number to use in uClinux?

My LQFP144 version of LPC4337 has 6 GPIO Ports:

GPIO0[15:0]
GPIO1[15:0]
GPIO2[15:0]
GPIO3[15:0]
GPIO4[11]
GPIO5[16:0]
GPIO5[18]

I need to set pin P7_4 which is GPIO3[12]. What is the number to use in uClinux? (the number 12 in my example above).

Thanks!

/Bo

Outcomes