Skip to content

[RFC PATCH v5] iio: repeat channel support and dummy client example #43

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

Merged
merged 5 commits into from
Sep 21, 2016

Conversation

lucasrangit
Copy link
Contributor

iio_chan_type IIO_ROT uses the repeat channel iio_chan_spec.scan_type.repeat to store repeated elements in a channel without modifiers.

This patch series adds support to libiio and creates a new example tool that exercises the iio_dummy driver. For testing this series the iio_dummy can be patched to include the IIO_ROT channel. See lucasrangit/linux-iio#1 .

Signed-off-by: Lucas Magasweran [email protected]


Changes since v1:

  • tests: iio_info: compared format->repeat > 1 for consistent output and avoid duplicated printf
  • examples: dummy: remove debug print of scan channel size and repeat count
    and squashed commits since this is a new sample tool
  • added missing Signed-off-by to commits

Changes since v2:

  • iio: moved struct iio_data_format member repeat to the end of the struct to maintain forward ABI compatibility.
  • iio: added a note specifying that the member was added in version v0.8 (assuming this will be merged). this shows up in the doxygen documentation where users are more likely to see a potential version dependency.
  • docs: added note to main page about abi compatibility and recommended usage of iio_library_get_version().
  • examples: dummy: even though this is versioned with the latest source, it may be run against older library versions so it includes an example of checking the library for a feature and conditionally using that feature if supported.

Changes since v4:

  • iio: initialize repeat to 1 to simplify computations. a repeat of 1 is effectively no repeat.
  • examples: dummy: repeat is now 1 so code can be simplified

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 <[email protected]>
This matches the optional X%u repeat count in sysfs _type scan element
format attribute.

Signed-off-by: Lucas Magasweran <[email protected]>
@pcercuei
Copy link
Contributor

Merged. Thanks!

@lucasrangit
Copy link
Contributor Author

Thanks @pcercuei ! Sorry for not checking the Windows build. Wont happen again.

Looks like my commit 356420d snuck in as the 1000th commit! I hope this means I'll be invited to the libiio party ;)

@pcercuei
Copy link
Contributor

I'm sure you did set the commit date on purpose ;)

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

Successfully merging this pull request may close these issues.

2 participants