Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use the st_imu68 IIO driver with a hrtimer? #1

Closed
deblauwetom opened this issue Feb 22, 2019 · 1 comment
Closed

How to use the st_imu68 IIO driver with a hrtimer? #1

deblauwetom opened this issue Feb 22, 2019 · 1 comment

Comments

@deblauwetom
Copy link

I compiled the st_imu68_i2c driver for use with a 4.14 linux kernel with the industrial IO subsystem successfully. And I could read values from the device using the files that provide the "raw" values. However, it is very slow when I just cat the raw values very fast. Normally, in IIO you can define a hrtimer with scan_elements, but the iio device you get from the linux driver does not contain such a 'scan_elements' subdir so it seems I can't attach a hrtimer trigger to it. However, there is a sample_frequency file, but not clear to me what this then does or how it is supposed to work. Is there maybe a high level overview documentation somewhere of how you can get the values faster?

@mariotesi
Copy link
Contributor

Hi deblauwetom,

Yes I confirm the raw value can be read using the

/sys/bus/iio/devices/iio:devicex/in_xxx_x_raw
/sys/bus/iio/devices/iio:devicex/in_xxx_y_raw
/sys/bus/iio/devices/iio:devicex/in_xxx_z_raw

but is very slow because is only for spare access

To read data in a standard way (using FIFO and iio channels) there is the generic_buffer iio utility in linux kernel documentation, otherwise you can use the Linux/Android HAL in this repository:
https://github.com/STMicroelectronics/STMems_Android_Sensor_HAL_IIO

Generic Buffer utility need the scan_elements directory but in st_imu68 there should be this entry path (please see in CONFIG_IIO_BUFFER is enabled in your .config)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants