Reputation: 23
I want to use DMtimer of beaglebone to set timer of 1 minute.Can anybody guide me with the procedure for the same?I have worked with Pic micro controller and it's timers so I know the working of timer,but in terms of programming and register handling in the beaglebone it seems to be work in different manner.can anybody please guide me through this? following are the details of my beaglebone green
uname -r
4.14.71-ti-r80
cat /etc/dogtag
BeagleBoard.org Debian Image 2018-10-07
cat /etc/debian_version
9.5
trying to write c code in linux ubuntu
Upvotes: 0
Views: 413
Reputation: 2858
The following answer assumes that you are trying to create a user space program (as opposed to kernel space code such as a typical driver).
On a full OS such as Linux you don't manipulate registers to program a timer. You rather make use of kernel APIs.
Depending on the structure of your program there are a number of options.
If you have an event loop (via poll or select) you might want to use the timerfd API. See http://man7.org/linux/man-pages/man2/timerfd_create.2.html.
If you want an asynchronous notification via a signal you can use setitimer. See: http://man7.org/linux/man-pages/man2/setitimer.2.html
In general I would try to avoid signals due to their asynchronous nature.
Upvotes: 1