[RFC PATCH v4] iio: repeat channel support and dummy client example#42
[RFC PATCH v4] iio: repeat channel support and dummy client example#42lucasrangit wants to merge 5 commits into
Conversation
Signed-off-by: Lucas Magasweran <lucas.magasweran@daqri.com>
Linux struct iio_chan_spec supports a 'repeat' scan_type attribute that represents the number of times the element repeats. A value of 0 and 1 signifies no repeat. In order maintain backwards and forwards compatibility, the repeat field was added to the end of the struct. This means applications compiled against an older version will work fine with the newer dynamically linked library. Applications compiled against a newer version will work fine with the older dynamically linked library so long as they don't access this new feature. Applications using this new feature should ensure the libiio version is compatible by using iio_library_get_version() to avoid undefined behavior. Signed-off-by: Lucas Magasweran <lucas.magasweran@daqri.com>
…-hrtimer Signed-off-by: Lucas Magasweran <lucas.magasweran@daqri.com>
This matches the optional X%u repeat count in sysfs _type scan element format attribute. Signed-off-by: Lucas Magasweran <lucas.magasweran@daqri.com>
Signed-off-by: Lucas Magasweran <lucas.magasweran@daqri.com>
| /** @brief Contains the scale to apply if with_scale is set */ | ||
| double scale; | ||
|
|
||
| /** @brief Number of times length repeats (added in v0.8) */ |
There was a problem hiding this comment.
I am assuming this will be merged and released with v0.8.
| printf("Library version: %u.%u (git tag: %s)\n", major, minor, git_tag); | ||
|
|
||
| /* check for struct iio_data_format.repeat support */ | ||
| has_repeat = major >= 0 && minor >= 8 ? true : false; |
There was a problem hiding this comment.
I am assuming this will be merged and released with v0.8.
|
I don't like how you use "(chn->format.repeat ? chn->format.repeat : 1)" everywhere. |
|
I did that so that the libiio repeat field matched the value in the kernel, Thanks for the feedback! On Tue, Sep 20, 2016, 05:52 Paul Cercueil notifications@github.com wrote:
|
|
Thanks :) |
|
Changed the initial value of repeat in pull request #43. |
iio_chan_typeIIO_ROTuses the repeat channeliio_chan_spec.scan_type.repeatto store repeated elements in a channel without modifiers.This patch series adds support to
libiioand creates a new example tool that exercises theiio_dummydriver. For testing this series theiio_dummycan be patched to include theIIO_ROTchannel. See lucasrangit/linux-iio#1 .Signed-off-by: Lucas Magasweran lucas.magasweran@daqri.com
Changes since v1:
format->repeat > 1for consistent output and avoid duplicatedprintfand squashed commits since this is a new sample tool
Changes since v2:
struct iio_data_formatmemberrepeatto the end of the struct to maintain forward ABI compatibility.iio_library_get_version().