-
Notifications
You must be signed in to change notification settings - Fork 332
[RFC PATCH] iio: repeat channel support and dummy client example #39
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
Conversation
Linux struct iio_chan_spec supports a 'repeat' scan_type attribute that represents the number of times the element repeats. Note that a value of 0 and 1 signifies no repeat.
Hi, Thanks for the pull-request. Good stuff in this series. Just a formality we need sign-offs on each patch. I'll comment on the individual patches inline.
|
@@ -248,7 +248,15 @@ int main(int argc, char **argv) | |||
if (format->is_fully_defined) | |||
sign += 'A' - 'a'; | |||
|
|||
printf(", index: %lu, format: %ce:%c%u/%u>>%u)\n", | |||
if (format->repeat) | |||
printf(", index: %lu, format: %ce:%c%u/%uX%u>>%u)\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if this should this be format->repeat > 1 so we get consistent output if there is no repeat.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree. I will also make the snprintf
usage consistent with how channel.c::get_scan_element()
is done or whatever the best style is.
Thanks for the prompt feedback @larsclausen ! Sorry for the commit issues. I will fix them all in v2 and squash all the example tool commits into one for clarity. |
char processed = (chn->format.is_fully_defined ? 'A' - 'a' : 0); | ||
|
||
if (chn->format.repeat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compare to repeat > 1
for consistency since a value of 1 could be used.
struct iio_channel *chn = iio_device_get_channel(dev, i); | ||
const struct iio_data_format *fmt = iio_channel_get_data_format(chn); | ||
if (iio_channel_is_scan_element(chn)) { | ||
printf("%s bytes %d repeat %d\n", iio_channel_get_id(chn), fmt->length/8, fmt->repeat); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove this. it's not useful unless debugging repeat channel read code.
@lclausen-adi see #40 for v2 of this series. closing this pull request. |
iio_chan_type
IIO_ROT
uses the repeat channeliio_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 theiio_dummy
driver. For testing this series theiio_dummy
can be patched to include theIIO_ROT
channel. See lucasrangit/linux-iio#1 .Signed-off-by: Lucas Magasweran [email protected]
Please let me know your feedback regarding how I added and tested support for this IIO feature to
libiio
. Thanks!