LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to setup timer in writing device driver/user space program (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-setup-timer-in-writing-device-driver-user-space-program-4175559031/)

david_8274 11-16-2015 01:55 PM

how to setup timer in writing device driver/user space program
 
Hi all,

When developing bare-bone embedded system project, we usually need to use timers to trigger one-shot/periodic interrupt. In a bare-bone environment, this can be done by accessing registers.
Right now I need to develop code in embedded Linux environment, what are the appropriate ways to achieve the same purpose? I read about jiffies, is it usually used in device driver? What about user space then?

Thanks,
Wei Xu

berndbausch 11-17-2015 08:35 AM

http://linux.die.net/man/2/timer_create

Nanosecond resolution. Sample program included.

That's user space, no idea how to do it in the kernel. And I am sure there are other ways.


All times are GMT -5. The time now is 10:58 AM.