1 Userspace access to IIO
3 Example, ST Microelectronics LIS3L02DQ accelerometer.
5 Typical sysfs entries (pruned for clarity)
8 device0 - iio_dev related elements
9 name - driver specific identifier (here lis3l02dq)
10 accel_x - polled (or from ring) raw readout of acceleration
11 accel_x_gain - hardware gain (calibration)
12 accel_x_offset - hardware offset (calibration)
13 available_sampling_frequency
15 available_sampling_frequency - what options are there
16 sampling_frequency - control of internal sampling frequency
17 scan_elements - controls which channels will be stored in the ring buffer
21 device - link to underlying hardware device
22 uevent - udev related element
24 thresh - unified threshold used for detection on all axis
25 event_line0_sources - which events are enabled
26 accel_x_high - enable x axis high threshold event
27 accel_x_low - enable x axis low threshold event
29 event_line0 - event interface
30 dev - major:minor for the chrdev (note major allocation dynamic)
31 trigger - consumer attachement
32 current_trigger - name based association with a trigger
33 ring_buffer0 - ring buffer interface
34 bps - byptes per sample (read only), dependant on scan element selection
35 length - (rw) specificy length fo software ring buffer (typically ro in hw case)
36 ring_enable - turn the ring on. If its the first to be enabled attached to this
37 trigger will also enable the trigger.
39 dev - major:minor for ring buffer access chrdev
41 dev - major:minor for ring buffer event chrdev
43 trigger0 - data ready trigger elements
44 name - unqiue name of trigger
46 Udev will create the following entries under /dev by default:
48 ring_access0 - ring access chrdev
49 ring_event0 - ring event chrdev
50 event_line0 - general event chrdev.
52 For the example code we assume the following rules have been used to ensure
53 unique and consistent naming of these for the lis3l02dq in question:
55 KERNEL="ring_event_line*", ID="spi1.0", DRIVER="lis3l02dq", NAME="iio/lis3l02dq_ring_event"
56 KERNEL="event_line*", ID="spi1.0", DRIVER="lis3l02dq", NAME="iio/lis3l02dq_event"
57 KERNEL="ring_access*", ID="spi1.0", DRIVER="lis3l02dq", NAME="iio/lis3l02dq_ring_access"
59 The files, lis3l02dqbuffersimple.c and iio_util.h in this directory provide an example
60 of how to use the ring buffer and event interfaces.