[RFC PATCH] iio: repeat channel support and dummy client example#39
[RFC PATCH] iio: repeat channel support and dummy client example#39lucasrangit wants to merge 9 commits intoanalogdevicesinc:masterfrom
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.
|
|
|
||
| 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.
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.
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 buf[1024], repeat[8] = "", *str; | ||
| char processed = (chn->format.is_fully_defined ? 'A' - 'a' : 0); | ||
|
|
||
| if (chn->format.repeat) |
There was a problem hiding this comment.
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.
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_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
Please let me know your feedback regarding how I added and tested support for this IIO feature to
libiio. Thanks!