Dave,
 
    Here is an interesting question.  Suppose you wrote the same program 
but one in user space and another in kernel space.   And lets say all the 
program did was like a toggling of some gpios.  Which version would achieve 
the higher toggle speed and why and what would be the limit?
 
Best regards,
 
rocketRod
 

On Friday, November 22, 2013 1:10:47 PM UTC-8, Dave Hylands wrote:

> Hi dinesh,
>
>
> On Thu, Nov 21, 2013 at 9:04 PM, dinesh naga 
> <[email protected]<javascript:>> 
> wrote:
> >
> > Hello ,
> >
> > #include <stdio.h>
> > #include <linux/gpio.h>
> > int main()
> > {
> >     const int is17Valid = !!gpio_is_valid(17);
> >     if (is17Valid)
> >     {
> >        printf("17 is valid!");
> >     }
> >     else
> >     {
> >         printf("17 is not valid!");
> >     }
> >
> >     return 0;
> > }
> >
> > i am trying to compile this program and getting this error 
> >
> > gpio.h No such file or directory 
> >
> > tried this in beaglebone black as well as with cross compiler getting 
> same error 
> >
> > pls help me how to resolve this probelm.
>
>
> You can't use kernel mode headers like this from userspace, only from 
> kernel space.
>
> To access the GPIOs from userspace you either need to use something like 
> libsoc (which Jack previsouly mentioned), or use the method described in 
> the kernel documentation, described here:
> http://lxr.linux.no/#linux+v3.12.1/Documentation/gpio.txt#L621<http://www.google.com/url?q=http%3A%2F%2Flxr.linux.no%2F%23linux%2Bv3.12.1%2FDocumentation%2Fgpio.txt%2523L621&sa=D&sntz=1&usg=AFQjCNFkbDWzPsxGqVFX7QqA8Dcv1WRzGQ>
>
> --
> Dave Hylands
> Shuswap, BC, Canada
> http://www.davehylands.com<http://www.google.com/url?q=http%3A%2F%2Fwww.davehylands.com&sa=D&sntz=1&usg=AFQjCNHSGUoS2S6Y5zFpZjhUvpxTPDIeHg>
>

-- 
For more options, visit http://beagleboard.org/discuss
--- 
You received this message because you are subscribed to the Google Groups 
"BeagleBoard" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to