On Sat, 12 Jun 2021 12:43:12 -0400 William Huang <whuang8933@xxxxxxxxx> wrote: > Hi everyone, > > I hope this is the right place to ask my noob question. > I'm trying to learn how to write an IIO driver and using a couple > books as my resource. I managed to write a simple one and perform > oneshot-based data reads (e.g. cat iio:device0/in_temp_raw). > > Now, I'm trying to set up a trigger-buffered data read. I believe I > set up the triggers correctly: > cat trigger0/name > iio:device0/trigger/current_trigger Sounds like you have a trigger which is not a sysfs trigger (probably dataready signal from some other sensor). > echo 1 > iio:device0/scan_elements/in_temp_en > echo 1 > iio:device0/buffer/enable > cat /dev/iio\:device0 | xxd - > > Now, I'm not understanding how I should actually perform the trigger. > From my books, there should be a trigger_now file where I can echo 1 > to trigger, but it's not available in my trigger0/ directory. Also, > the book references a add_trigger in /sys/devices/iio_sysfs_trigger/ > directory, but that's nowhere to be found as well. > > My .config also has CONFIG_IIO_SYSFS_TRIGGER=m. You will need to manually probe that module modprobe iio-sysfs-trig There is no simple way of autoloading that module as it's not associated with any actual hardware. Then you should find the /sys/devices/iio_sysfs_trigger/ directory and can create a new instance of the sysfs trigger which should work as you expect. Jonathan > > Any help/advice would be appreciated! > > Thanks, > William Huang