LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer
User Name
Password
Linux - Embedded & Single-board computer This forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.

Notices


Reply
  Search this Thread
Old 01-07-2012, 06:52 AM   #1
bayoulinux
Member
 
Registered: Oct 2011
Posts: 34

Rep: Reputation: Disabled
Blink LED from user or kernel space?


Hello:

I have an LED hanging off a GPIO device (via I2C) that is capable of turning ON/OFF an LED. I use ioctl() commands from user space to kernel space to control the LED state, using the kernel's SMBUS APIs to communicate over I2C to program the GPIO device.

Now I want to blink the LED. Is it better/less intrusive to control the LED blink state (ON/OFF) from user space or kernel space? If I have a high blink rate, do I want to be repeatedly be sending LED change state commands from user kernel via ioctl, or can I somehow use kernel work queues to invoke the desired blink rate behavior (send a single ioctl from user space to kernel that contains blink rate information, then let the kernel handle the rest... with the ioctl() returning and not blocking)?

Note I'm somewhat of a embedded Linux newbie, be gentle... ;-)

Thanks folks!
 
Old 01-10-2012, 03:34 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,839

Rep: Reputation: 160Reputation: 160
If you want to save CPU power, a small code that flip LED blink state in kernel space is better than the code in user space. The ioctl from user space to kernel space is expensive.
 
Old 01-12-2012, 10:11 PM   #3
icemetal
LQ Newbie
 
Registered: Oct 2011
Posts: 8

Rep: Reputation: Disabled
I did that using the mini2440 here is a video of it, is this is what you mean?
http://www.youtube.com/watch?v=CpjgujlyQJQ
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Free user space pages of different user processes from inside kernel space trueskyte Linux - Kernel 1 10-22-2010 05:37 PM
Division of Logical Memory Space in to User Space and Kernel Space shreshtha Linux - Newbie 2 01-14-2010 10:59 AM
Direct Rendering : Yes - FPS: blink, blink, blink... giz2z Linux - Software 1 12-14-2006 02:54 AM
POWERCOLOR ATI9600 crash , HDD led blink intmail Linux - Hardware 2 08-26-2005 05:35 AM
Post-install: machine won't boot w/ Vector ...blink blink blink goes the cursor nethbar VectorLinux 3 03-17-2004 03:32 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware > Linux - Embedded & Single-board computer

All times are GMT -5. The time now is 09:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration