History

iio: Add IIO_DELTA_ANGL channel type

The delta angle is defined as a piece-wise integration of angular velocity data. The delta angle represents the amount of angular displacement between two consecutive measurements and it is measured in radians. In order to track the total angular displacement during a desired period of time, simply sum-up the delta angle samples acquired during that time. IIO currently does not offer a suitable channel type for this type of measurements hence this patch adds it.

Ramona Bolboaca committed 3 years ago

Commit 744f4991 parent 8c337434 files · +26 −0Browse files

Unified · Split

4 files
  1. Documentation/ABI/testing/sysfs-bus-iio +22 −0
  2. drivers/iio/industrialio-core.c +1 −0
  3. include/uapi/linux/iio/types.h +1 −0
  4. tools/iio/iio_event_monitor.c +2 −0
Documentation/ABI/testing/sysfs-bus-iio+22−0
@@ -279,6 +279,20 @@ Description: · 278 unmodified lines
279 but should match other such assignments on device).279 but should match other such assignments on device).
280 Units after application of scale and offset are m/s^2.280 Units after application of scale and offset are m/s^2.
281 281
282What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_x_raw
283What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_y_raw
284What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_z_raw
285KernelVersion: 6.5
286Contact: linux-iio@vger.kernel.org
287Description:
288 Angular displacement between two consecutive samples on x, y or
289 z (may be arbitrarily assigned but should match other such
290 assignments on device).
291 In order to compute the total angular displacement during a
292 desired period of time, the application should sum-up the delta
293 angle samples acquired during that time.
294 Units after application of scale and offset are radians.
295
282What: /sys/bus/iio/devices/iio:deviceX/in_angl_raw296What: /sys/bus/iio/devices/iio:deviceX/in_angl_raw
283What: /sys/bus/iio/devices/iio:deviceX/in_anglY_raw297What: /sys/bus/iio/devices/iio:deviceX/in_anglY_raw
284KernelVersion: 4.17298KernelVersion: 4.17
@@ -461,6 +475,7 @@ What: /sys/bus/iio/devices/iio:deviceX/in_humidityrelative_scale · 176 unmodified lines
461What: /sys/bus/iio/devices/iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_scale475What: /sys/bus/iio/devices/iio:deviceX/in_velocity_sqrt(x^2+y^2+z^2)_scale
462What: /sys/bus/iio/devices/iio:deviceX/in_illuminance_scale476What: /sys/bus/iio/devices/iio:deviceX/in_illuminance_scale
463What: /sys/bus/iio/devices/iio:deviceX/in_countY_scale477What: /sys/bus/iio/devices/iio:deviceX/in_countY_scale
478What: /sys/bus/iio/devices/iio:deviceX/in_deltaangl_scale
464What: /sys/bus/iio/devices/iio:deviceX/in_angl_scale479What: /sys/bus/iio/devices/iio:deviceX/in_angl_scale
465What: /sys/bus/iio/devices/iio:deviceX/in_intensity_x_scale480What: /sys/bus/iio/devices/iio:deviceX/in_intensity_x_scale
466What: /sys/bus/iio/devices/iio:deviceX/in_intensity_y_scale481What: /sys/bus/iio/devices/iio:deviceX/in_intensity_y_scale
@@ -1332,6 +1347,9 @@ Description: · 865 unmodified lines
1332What: /sys/.../iio:deviceX/bufferY/in_accel_x_en1347What: /sys/.../iio:deviceX/bufferY/in_accel_x_en
1333What: /sys/.../iio:deviceX/bufferY/in_accel_y_en1348What: /sys/.../iio:deviceX/bufferY/in_accel_y_en
1334What: /sys/.../iio:deviceX/bufferY/in_accel_z_en1349What: /sys/.../iio:deviceX/bufferY/in_accel_z_en
1350What: /sys/.../iio:deviceX/bufferY/in_deltaangl_x_en
1351What: /sys/.../iio:deviceX/bufferY/in_deltaangl_y_en
1352What: /sys/.../iio:deviceX/bufferY/in_deltaangl_z_en
1335What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_en1353What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_en
1336What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_en1354What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_en
1337What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_en1355What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_en
@@ -1362,6 +1380,7 @@ Description: · 24 unmodified lines
1362 Scan element control for triggered data capture.1380 Scan element control for triggered data capture.
1363 1381
1364What: /sys/.../iio:deviceX/bufferY/in_accel_type1382What: /sys/.../iio:deviceX/bufferY/in_accel_type
1383What: /sys/.../iio:deviceX/bufferY/in_deltaangl_type
1365What: /sys/.../iio:deviceX/bufferY/in_anglvel_type1384What: /sys/.../iio:deviceX/bufferY/in_anglvel_type
1366What: /sys/.../iio:deviceX/bufferY/in_magn_type1385What: /sys/.../iio:deviceX/bufferY/in_magn_type
1367What: /sys/.../iio:deviceX/bufferY/in_incli_type1386What: /sys/.../iio:deviceX/bufferY/in_incli_type
@@ -1416,6 +1435,9 @@ What: /sys/.../iio:deviceX/bufferY/in_voltage_q_index · 48 unmodified lines
1416What: /sys/.../iio:deviceX/bufferY/in_accel_x_index1435What: /sys/.../iio:deviceX/bufferY/in_accel_x_index
1417What: /sys/.../iio:deviceX/bufferY/in_accel_y_index1436What: /sys/.../iio:deviceX/bufferY/in_accel_y_index
1418What: /sys/.../iio:deviceX/bufferY/in_accel_z_index1437What: /sys/.../iio:deviceX/bufferY/in_accel_z_index
1438What: /sys/.../iio:deviceX/bufferY/in_deltaangl_x_index
1439What: /sys/.../iio:deviceX/bufferY/in_deltaangl_y_index
1440What: /sys/.../iio:deviceX/bufferY/in_deltaangl_z_index
1419What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_index1441What: /sys/.../iio:deviceX/bufferY/in_anglvel_x_index
1420What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_index1442What: /sys/.../iio:deviceX/bufferY/in_anglvel_y_index
1421What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_index1443What: /sys/.../iio:deviceX/bufferY/in_anglvel_z_index
drivers/iio/industrialio-core.c+1−0
@@ -90,6 +90,7 @@ static const char * const iio_chan_type_name_spec[] = { · 89 unmodified lines
90 [IIO_POSITIONRELATIVE] = "positionrelative",90 [IIO_POSITIONRELATIVE] = "positionrelative",
91 [IIO_PHASE] = "phase",91 [IIO_PHASE] = "phase",
92 [IIO_MASSCONCENTRATION] = "massconcentration",92 [IIO_MASSCONCENTRATION] = "massconcentration",
93 [IIO_DELTA_ANGL] = "deltaangl",
93};94};
94 95
95static const char * const iio_modifier_names[] = {96static const char * const iio_modifier_names[] = {
include/uapi/linux/iio/types.h+1−0
@@ -47,6 +47,7 @@ enum iio_chan_type { · 46 unmodified lines
47 IIO_POSITIONRELATIVE,47 IIO_POSITIONRELATIVE,
48 IIO_PHASE,48 IIO_PHASE,
49 IIO_MASSCONCENTRATION,49 IIO_MASSCONCENTRATION,
50 IIO_DELTA_ANGL,
50};51};
51 52
52enum iio_modifier {53enum iio_modifier {
tools/iio/iio_event_monitor.c+2−0
@@ -59,6 +59,7 @@ static const char * const iio_chan_type_name_spec[] = { · 58 unmodified lines
59 [IIO_POSITIONRELATIVE] = "positionrelative",59 [IIO_POSITIONRELATIVE] = "positionrelative",
60 [IIO_PHASE] = "phase",60 [IIO_PHASE] = "phase",
61 [IIO_MASSCONCENTRATION] = "massconcentration",61 [IIO_MASSCONCENTRATION] = "massconcentration",
62 [IIO_DELTA_ANGL] = "deltaangl",
62};63};
63 64
64static const char * const iio_ev_type_text[] = {65static const char * const iio_ev_type_text[] = {
@@ -173,6 +174,7 @@ static bool event_is_known(struct iio_event_data *event) · 108 unmodified lines
173 case IIO_POSITIONRELATIVE:174 case IIO_POSITIONRELATIVE:
174 case IIO_PHASE:175 case IIO_PHASE:
175 case IIO_MASSCONCENTRATION:176 case IIO_MASSCONCENTRATION:
177 case IIO_DELTA_ANGL:
176 break;178 break;
177 default:179 default:
178 return false;180 return false;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t