analogdevicesinc / pyadi-iio

Python interfaces for ADI hardware with IIO drivers (aka peyote)
https://analogdevicesinc.github.io/pyadi-iio
Other
134 stars 99 forks source link

hrtimer in pyadi? #508

Closed karu2003 closed 6 months ago

karu2003 commented 6 months ago

how to work with hrtimer in pyadi-iio?

tfcollins commented 6 months ago

You would need to enable the RTC trigger https://wiki.analog.com/software/linux/docs/iio/iio-trig-sysfs#adding_linux_driver_support and try to map it to your device first

karu2003 commented 6 months ago

Is there no support in PyAdi-iio.

tfcollins commented 6 months ago

The HR timer is no different than any other trigger. As long as you can verify you can use it to drive/trigger your device, you simply set it as a source in your init like so: https://github.com/analogdevicesinc/pyadi-iio/blob/15b7cb999cb5031dfc4f7c8dfa1801a418926fe5/adi/adis16507.py#L34

karu2003 commented 6 months ago

Thank you. I tried this right away. I made my own timer. https://github.com/karu2003/rpi_ad7476/blob/master/hrtimer.py

tfcollins commented 6 months ago

I think this can be closed now