From: Lars-Peter Clausen <lars@metafoo.de>
To: Guillaume Ballet <gballetwork@gmail.com>
Cc: Jonathan Cameron <jic23@jic23.retrosnub.co.uk>,
linux-iio@vger.kernel.org
Subject: Re: Why is only one int returned in iio_read_channel_processed?
Date: Wed, 22 May 2013 13:43:19 +0200 [thread overview]
Message-ID: <519CAF57.5030301@metafoo.de> (raw)
In-Reply-To: <CAGi_vricp+o35GiycEeO=eXg4gwpiP3x1ZvU2JCP0-_vMwrwWw@mail.gmail.com>
On 05/22/2013 11:37 AM, Guillaume Ballet wrote:
>>>
>>>>
>>>>> functions' signature only has one integer
>>>>> in/out parameter. That makes sense in the context of _raw because the
>>>>> value isn't yet processed.
>>>>>
>>>>> However, as the scale is a number encoded over two ints, the
>>>>> _processed value should also span two ints. Is there a reason why it's
>>>>> still only one int?
>>>>
>>>> No it certainly should not be one int for exactly the reasons you have
>>>> stated.
>>>>>
>>>>>
>>>
>>> I'm not to sure about that. I'd rather add a scale parameter to the
>>> iio_read_channel_processed, just in the same way the
>>> convert_raw_to_processed function takes a scale parameter.
>>
>> That may be tricky to do given we often have nasty non linear functions
>> that are the reason we are using processed in the first place. Hmm.
>> Not sure which way works better.
>
> I agree, this is the whole point of using processed. Lars, is there a
> specific reason why you want to keep reading the value and the scale
> in different function calls?
I don't want to keep reading scale and value in different function calls.
What's you use case and how do you want to split the data between the two
integers?
- Lars
next prev parent reply other threads:[~2013-05-22 11:43 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-22 7:49 Why is only one int returned in iio_read_channel_processed? Guillaume Ballet
2013-05-22 8:04 ` Jonathan Cameron
2013-05-22 8:19 ` Lars-Peter Clausen
2013-05-22 9:00 ` Jonathan Cameron
2013-05-22 9:37 ` Guillaume Ballet
2013-05-22 11:43 ` Lars-Peter Clausen [this message]
2013-05-22 13:29 ` Guillaume Ballet
2013-05-22 13:39 ` Lars-Peter Clausen
2013-05-22 14:00 ` Guillaume Ballet
2013-05-22 14:15 ` Lars-Peter Clausen
2013-05-22 15:24 ` Guillaume Ballet
2013-05-22 17:14 ` Lars-Peter Clausen
2013-05-23 9:52 ` Guillaume Ballet
2013-05-23 10:39 ` Lars-Peter Clausen
2013-05-23 13:18 ` Guillaume Ballet
2013-05-23 13:28 ` Lars-Peter Clausen
2013-06-02 16:00 ` Jonathan Cameron
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=519CAF57.5030301@metafoo.de \
--to=lars@metafoo.de \
--cc=gballetwork@gmail.com \
--cc=jic23@jic23.retrosnub.co.uk \
--cc=linux-iio@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.