IIO: New interfaces for 'interesting' channel types.
Jonathan Cameron
maintainerThis is a resend from earlier today as it never seems to have reached the list. Sorry to anyone who gets it twice...
Hi All
We have had a couple of new interface discussions buried in the reviews of drivers. Specifically the quaternion rotation interface and the pulse capture interface. In some ways as will become apparent below these are related.
I'm summarising the options here in an attempt to get some more discussion going.
Firstly, the quaternion interface. Quaternions require 4 components to be presented together in order for any meaning to be extracted. Thus it makes no sense to ever present their components separately. To this end a new interface is proposed in which all 4 components are presented as a space separated list. Whilst I welcome comments on this, the actual question I am raising here concerns not what is presented, but the way we indicate that this is what is to be expected.
Two obvious options exist as we have two places this type could be 'represented'. Either we introduce a new channel type - rotquaternion which is defined to be a rotation expressed as a quaternion, or we take the existing channel type rot and apply a modifier (similar to an axis modifier) to indicate that rather than being a rotation about a given axis, we have a rotation represented as a quaternion. This would be done with a new modifier. To illustrate the point, lets take a few example sysfs attributes.
Option 1. New channel type
in_rotquaternion1_rawin_rotquaternion1_scale
Option 2. New modifier.
in_rot1_quaternion_rawin_rot1_quaternion_scale
Next lets take the ecap driver and it's pulse characteristic measurement interface. Here we have a single underlying thing (the waveform) about which we wish to measure a number of elements. Again, we can either do this via new channel types, or via modifiers. Note there is precedence for using index numbers to indicate that multiple measurements are being taken via the same physical wire of different things.
Option 1. New Channel types (I'm making the naming up as a go along - the aim here is generality to other things we might measure and time intervals are more general than 'pulse' or similar types)
in_interval1_high_raw (time pulse is high)in_interval_scale
in_interval1_low_raw (time pulse is low)
in_interval_risingtorising_raw (period measured rising edge to rising edge) in_interval_fallingtofalling_raw (period measured falling to falling)
in_interval_rising_raw (rise time of waveform).in_interval_falling_raw (fall time of waveform).
in_voltage_peaktopeak_raw (peak to peak voltage). We actually have interfaces in place for this sort of stuff.
Option 2 - modifiers for everything. (this is what I suggested in -
http://www.spinics.net/lists/linux-omap/msg103204.html
in_waveformX_hightime_rawin_waveformX_lowtime_rawin_waveformX_period_rawin_waveformX_markspace_rawin_waveformX_peaktopeak_rawin_waveformX_risetime_rawin_waveformX_falltime_raw
Personally my thinking has changed since my ecap related email. I think we want to keep the channel types to be strictly what quantity is being measured and rely on shared index numbers to indicate that we are dealing with multiple measurements of a given 'channel'.
Hence I slightly favour option 1. However the reason I'm sending this RFC is I definitely want more input on this decision from other regular IIO developers (and anyone else!). I'm particularly interested in cases that people don't think are cleanly covered by the proposed options. I've picked a few people to poke via ccing them, but please do send this on to anyone else you think might contribute to the discussion.
It's going to tie us to a large body of ABI moving forwards. My apologies to Matt and Srinivas for the fact your drivers have gotten caught up in this, but we need to get it right.
Whilst we are talking interface reviews. Another one I proposed recently was spherical coordinates for position measurements. The main reason for this is that it gives a unified way of indicating distance from sensor as
in_position_r_raw
There are also magnetic position sensors that report in full spherical coordinates so we may want the other elements down the line. I'm kind of regretting letting the generic 'proximity' interface in now. Those are measuring something related to distance, but material dependent so I'm not too bothered if we introduced another similar interface. Anyone comments on this would be great as well as I'd like to get the lightning sensor merged sooner rather than later!
I hate my webmail, but then its better than doing it on my mobile phone..
Thanks
Jonathan
Hi Jonathan,
thanks for the very good presentation.
Quoted 19 lines
Firstly, the quaternion interface. Quaternions require 4 components to be presented together in order for any meaning to be extracted. Thus it makes no sense to ever present their components separately. To this end a new interface is proposed in which all 4 components are presented as a space separated list. Whilst I welcome comments on this, the actual question I am raising here concerns not what is presented, but the way we indicate that this is what is to be expected.
Two obvious options exist as we have two places this type could be 'represented'. Either we introduce a new channel type - rotquaternion which is defined to be a rotation expressed as a quaternion, or we take the existing channel type rot and apply a modifier (similar to an axis modifier) to indicate that rather than being a rotation about a given axis, we have a rotation represented as a quaternion. This would be done with a new modifier. To illustrate the point, lets take a few example sysfs attributes.
Option 1. New channel type
Quoted 7 lines
in_rotquaternion1_rawin_rotquaternion1_scaleOption 2. New modifier.
in_rot1_quaternion_rawin_rot1_quaternion_scale
I prefer option 2 since we still measure a rotation, but an axis makes no sense. I'd even propose to additionally have:
in_rot1_xyz_raw
to present x y and z in one single reading since a lot of sensor supply a measurement from the same point in time when reading out all values together.
Quoted 42 lines
Next lets take the ecap driver and it's pulse characteristic measurement interface. Here we have a single underlying thing (the waveform) about which we wish to measure a number of elements. Again, we can either do this via new channel types, or via modifiers. Note there is precedence for using index numbers to indicate that multiple measurements are being taken via the same physical wire of different things.
Option 1. New Channel types (I'm making the naming up as a go along - the aim here is generality to other things we might measure and time intervals are more general than 'pulse' or similar types)
in_interval1_high_raw(time pulse is high)in_interval_scale
in_interval1_low_raw(time pulse is low)
in_interval_risingtorising_raw(period measured rising edge to rising edge)in_interval_fallingtofalling_raw(period measured falling to falling)
in_interval_rising_raw(rise time of waveform).in_interval_falling_raw(fall time of waveform).
in_voltage_peaktopeak_raw(peak to peak voltage). We actually have interfaces in place for this sort of stuff.Option 2 - modifiers for everything. (this is what I suggested in -
http://www.spinics.net/lists/linux-omap/msg103204.html
in_waveformX_hightime_rawin_waveformX_lowtime_rawin_waveformX_period_rawin_waveformX_markspace_rawin_waveformX_peaktopeak_rawin_waveformX_risetime_rawin_waveformX_falltime_rawPersonally my thinking has changed since my ecap related email. I think we want to keep the channel types to be strictly what quantity is being measured and rely on shared index numbers to indicate that we are dealing with multiple measurements of a given 'channel'.
Quoted 6 lines
Hence I slightly favour option 1. However the reason I'm sending this RFC is I definitely want more input on this decision from other regular IIO developers (and anyone else!). I'm particularly interested in cases that people don't think are cleanly covered by the proposed options. I've picked a few people to poke via ccing them, but please do send this on to anyone else you think might contribute to the discussion.
Here I'm with you. Your arguments make perfectly sense for me.
Quoted 10 lines
It's going to tie us to a large body of ABI moving forwards. My apologies to Matt and Srinivas for the fact your drivers have gotten caught up in this, but we need to get it right.
Whilst we are talking interface reviews. Another one I proposed recently was spherical coordinates for position measurements. The main reason for this is that it gives a unified way of indicating distance from sensor as
in_position_r_raw
Why would this be a position when you actually measure distance? Can you give an example?
Quoted 7 lines
There are also magnetic position sensors that report in full spherical coordinates so we may want the other elements down the line. I'm kind of regretting letting the generic 'proximity' interface in now. Those are measuring something related to distance, but material dependent so I'm not too bothered if we introduced another similar interface. Anyone comments on this would be great as well as I'd like to get the lightning sensor merged sooner rather than later!
Regards,
Manuel
Jonathan Cameron
maintainerQuoted 38 lines · Manuel Stahl
Hi Jonathan,
thanks for the very good presentation.
Quoted 1 line
Firstly, the quaternion interface. Quaternions require 4 components
to
Quoted 1 line
be presented together in order for any meaning to be extracted. Thus
it
Quoted 1 line
makes no sense to ever present their components separately. To this
end
Quoted 1 line
a new interface is proposed in which all 4 components are presented
as
Quoted 1 line
a space separated list. Whilst I welcome comments on this, the
actual
Quoted 1 line
question I am raising here concerns not what is presented, but the
way we
Quoted 4 lines
indicate that this is what is to be expected.
Two obvious options exist as we have two places this type could be 'represented'. Either we introduce a new channel type -
rotquaternion
Quoted 1 line
which is defined to be a rotation expressed as a quaternion, or we
take
Quoted 1 line
the existing channel type rot and apply a modifier (similar to an
axis
Quoted 2 lines
modifier) to indicate that rather than being a rotation about a given axis, we have a rotation represented as a quaternion. This would be
done
Quoted 1 line
with a new modifier. To illustrate the point, lets take a few
example
Quoted 7 lines
sysfs attributes.
Option 1. New channel type
in_rotquaternion1_rawin_rotquaternion1_scale
Quoted 7 lines
Quoted 4 lines
Option 2. New modifier.
in_rot1_quaternion_rawin_rot1_quaternion_scaleI prefer option 2 since we still measure a rotation, but an axis makes no sense.
I suppose this also fits better against proposal of allowing spherical position coords below. There we have on distance and two angles. In conjunction they specify the position.
Quoted 7 lines
I'd even propose to additionally have:
in_rot1_xyz_rawto present x y and z in one single reading since a lot of sensor supply a measurement from the same point in time when reading out all values together.
Maybe... But there will be lots of combinations possible. Xz xy yz xyz
These would be sysfs only probably with the individual elements taking precedence for
buffered output.
Quoted 77 lines
Quoted 4 lines
Next lets take the ecap driver and it's pulse characteristic
measurement
Quoted 1 line
interface. Here we have a single underlying thing (the waveform)
about
Quoted 1 line
which we wish to measure a number of elements. Again, we can either
do
Quoted 1 line
this via new channel types, or via modifiers. Note there is
precedence for
Quoted 1 line
using index numbers to indicate that multiple measurements are being
taken
Quoted 3 lines
via the same physical wire of different things.
Option 1. New Channel types (I'm making the naming up as a go along -
the
Quoted 1 line
aim here is generality to other things we might measure and time
intervals
Quoted 8 lines
are more general than 'pulse' or similar types)
in_interval1_high_raw(time pulse is high)in_interval_scale
in_interval1_low_raw(time pulse is low)
in_interval_risingtorising_raw(period measured rising edge to risingedge)
Quoted 20 lines
in_interval_fallingtofalling_raw(period measured falling to falling)
in_interval_rising_raw(rise time of waveform).in_interval_falling_raw(fall time of waveform).
in_voltage_peaktopeak_raw(peak to peak voltage). We actually have interfaces in place for this sort of stuff.Option 2 - modifiers for everything. (this is what I suggested in -
http://www.spinics.net/lists/linux-omap/msg103204.html
in_waveformX_hightime_rawin_waveformX_lowtime_rawin_waveformX_period_rawin_waveformX_markspace_rawin_waveformX_peaktopeak_rawin_waveformX_risetime_rawin_waveformX_falltime_rawQuoted 2 lines
Personally my thinking has changed since my ecap related email. I think we want to keep the channel types to be strictly what
quantity
Quoted 4 lines
is being measured and rely on shared index numbers to indicate that we are dealing with multiple measurements of a given 'channel'.
Hence I slightly favour option 1. However the reason I'm sending
this
Quoted 1 line
RFC is I definitely want more input on this decision from other
regular
Quoted 2 lines
IIO developers (and anyone else!). I'm particularly interested in cases that people don't think are cleanly covered by the proposed
options.
Quoted 1 line
I've picked a few people to poke via ccing them, but please do send
this
Quoted 1 line
on to anyone else you think might contribute to the discussion.
Here I'm with you. Your arguments make perfectly sense for me.
Quoted 2 lines
It's going to tie us to a large body of ABI moving forwards. My apologies to Matt and Srinivas for the fact your drivers have
gotten
Quoted 3 lines
caught up in this, but we need to get it right.
Whilst we are talking interface reviews. Another one I proposed
recently
Quoted 2 lines
was spherical coordinates for position measurements. The main reason for this is that it gives a unified way of indicating distance from
Quoted 7 lines
sensor
Quoted 3 lines
as
in_position_r_rawWhy would this be a position when you actually measure distance? Can you give an example?
In spherical coordinates the r is merely the distance from the reference point. To do full position you would have two angle coordinates as well.
Thanks
J
Quoted 19 lines
Quoted 2 lines
There are also magnetic position sensors that report in full
spherical
Quoted 2 lines
coordinates so we may want the other elements down the line. I'm kind of regretting letting the generic 'proximity' interface in
now.
Quoted 1 line
Those are measuring something related to distance, but material
dependent
Quoted 3 lines
so I'm not too bothered if we introduced another similar interface. Anyone comments on this would be great as well as I'd like to get the lightning sensor merged sooner rather than later!
Regards,
Manuel--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 1 line
Sent from my Android phone with K-9 Mail. Please excuse my brevity.