I currently developing a gpio based kernel module for a custom protocol. As per requirements of protocol, I have to send data, clock and enable signal to output device throgh gpio. This data is 16-bit. For sending any new data the enable signal first goes high. Then, data is sent 1 by 1 bit, at every negative edge(High to low) of clock. After sending all 16-bits, the clock signal is stopped and enable signal goes low.
I have successfully developed this protocol with FriendlyARM mini2440. At that time I have used one of timers and setup its irq. In its service routine, I have sent the data 1 by 1 bit.
I am currently doing same thing in Raspberry pi. I have read the Datasheet of BCM2825 and it says it has 4 system timers. But, seaching through the Rpi-forums, I found that Rpi uses system timer 0,2 and 3. So, only one sytem timer 1 is remaining which I want to utilize. I could not figure out how to setup system timer on Rpi. Has any one used it in kernel module? Then please help.
Instead of writing kernel module, if I would patch linux kernel with xenomai patches, would it be easy task to setup a periodic timer and send data through it timer interrupt routine?
Any Suggestions?