Skip to content
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

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

Closed

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]


Please let me know your feedback regarding how I added and tested support for this IIO feature to libiio. Thanks!

@lclausen-adi
Copy link

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.

  • Lars

@@ -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",

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.

Copy link
Contributor Author

@lucasrangit lucasrangit Sep 14, 2016

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.

@lucasrangit
Copy link
Contributor Author

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)
Copy link
Contributor Author

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);
Copy link
Contributor Author

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.

@lucasrangit
Copy link
Contributor Author

@lclausen-adi see #40 for v2 of this series. closing this pull request.

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