Periodic IIO Trigger

I’m writing my own kernel-module for an ADC (LTC2414). Now I would like to have a periodic iio trigger to start the conversion. Can I enable hrtimer to get a trigger with low jitter? How? Or is there another iio trigger available for this purpose (e.g. RTC trigger)? The required period is very low (170ms).

Best regards,
Michael

Hi @michaelg

I think you can use hrtimer or flextimer for the periodic IIO Trigger. Please have a look at the Adc Driver Implementation on the Vybrid module, as it supports continuous sampling of Adc Channels.

Best regards,
Jaski

Hi @jaski.tx
Thank you for the answer. In the link you provided it says the following:

Currently only software triggers are
supported, they are accessible through
sysfs.

Doesn’t that mean that the hrtimer is not supported? I tried to trigger sysfs from a timer from my application but that is not reliable enough (regarding the jitter).

Can you give me some hints of how to use hrtimer or flextimer for doing the triggering?

Best regards,
Michael

It looks like the kernel module iio-trig-hrtimer.c that I was searching for is not yet included in my version of the kernel. I guess I will add a patch to add this module.

Hi Michael

For the HR Timer you can read the Documentation ( Documentation/timers/hrtimers.txt ).

It looks like the kernel module iio-trig-hrtimer.c that I was searching for is not yet included in my version of the kernel.

Or you can just use the 4.9.2.3 kernel which is part of Bsp 2.8.

Note: Bsp 2.7 is not supported any more. Please check our Bsp support Policy here.

Best regards,
Jaski