This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO API and App Support

Hi,

I have an 814x EVM and looking to control some of the available GPIO lines inside my application.

My application is currently trying to call some functions such as:

gpio_request_array(gpio_controls, ARRAY_SIZE(gpio_controls));    and     gpio_set_value(GPIO_YELLOW_LED, 0);

I am having issues compiling as it cannot find various gpio header files including one in the ....asm/mach/ directory.  It also seems

that these function calls may not be available to the application as some appear to be stubbed-out  and/or require various kernel compilation switches.

I've also read infomation on accessing GPIO via sysfs using open , read , write , and close calls but  I do not think this is the direction to go and is probably

not very efficient. 

Does the 814x EVM Linux 2.6.37 support a GPIO user application driver and is there an available API ???

Should I create my own home grown driver that accesses the Set / Clr and other GPIO registers directly ???

I would appreciate any information and/or code examples on the best and most efficient way of handling the GPIO blocks in the 814x EVM.

 

Thanks

 

  • Hi Sid,

    We have only one option for controlling the GPIO lines from user space, i.e., through sysfs entries. We can find some application which will export the simillar API's as that of kernel but internally it is controlling through sysfs entries.

    Kernel APIs of GPIO are not exported to user space.

    This wiki will help you in controlling the GPIO through sysfs entries

    http://processors.wiki.ti.com/index.php/GPIO_Driver_Guide#Sysfs_control

    We have one more option, i.e., build the app as kernel module, then you can access the GPIO APIs.

    Details can be found at http://e2e.ti.com/support/embedded/linux/f/354/t/156496.aspx#567559

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!

  • Thanks for the information...

    What is the downfall or issues that I will have writting our own GPIO application driver that directly controls the

    GPIO module via its Set , Clr and data registers, and writing them to directly for efficiency/speed.  What problems

    or access issues would we have ?   Is this not advised ?

     

    Thanks 

  • Hi Sid,

    If the driver is already implemented, working one and tested by considering all the requirements. Then implementing the own driver in the application layer will be a overhead and debugging time will be more if the implemented application is buggy.

    Any have we have to relies on the kernel for doing the pinmux configuration and clock enable

    My point is kernel will provide all these facilities. Mostly accessing the hardware registers from the user space is not a recommended if the kernel is in place.

    I can say that accessing the sysfs entries is not a overhead, in the whole process it will take extra file read/write.

    Regards

    AnilKumar

    Please mark this Forum post as answered via the Verify Answer button below if it helps answer your question.  Thanks!