Access Allocated GPIO from Application

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Access Allocated GPIO from Application

692 次查看
anjalikkrishna
Contributor III

Hi ,

      I am using  a GPIO7_11 for the keypad backlight which is requested and made high in the machine file of the kernel source code. When the kernel boots up the keypad backlight is on and working fine. Now I need to implement a test application for the keypad in which two test cases are  1) Enable keypad backlight 2) Disable keypad backlight. I have used the gpio ioctls for requesting the gpio and set the value etc. But the gpio_request call from the application returns negative value. When I searched various articles, I could understand gpio_request allocates the memory for the gpio.

So in my case I believe gpio_request fails since I am trying to use already allocated gpio.Hope my understanding is correct.

  My question is ,is there any way we could handle such situations. I have to use/control the gpio from application at the same time in the source code too.

Thanks & Regards,

Anjali

标签 (3)
标记 (1)
0 项奖励
回复
1 回复

510 次查看
Carlos_Musich
NXP Employee
NXP Employee

Hi Anjalik,

In the following thread I shared a kernel module which handles a gpio.

Issue with configuring GPIO as an interrupt - i.MX6Q 

Attached you can find another which turns on and off a LED.


Regards,
Carlos

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 项奖励
回复