From: Lars-Peter Clausen <lars@metafoo.de>
To: Gregor Boirie <gregor.boirie@parrot.com>,
"linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>
Subject: Re: generic_buffer and 24 bits samples
Date: Thu, 14 Apr 2016 18:00:07 +0200 [thread overview]
Message-ID: <570FBE87.9050006@metafoo.de> (raw)
In-Reply-To: <570FB712.5070903@parrot.com>
On 04/14/2016 05:28 PM, Gregor Boirie wrote:
> Greetings,
>
> I'm trying to use an st_pressure based sensor to sample pressure
> data using generic_buffer tool. However it seems that it does not
> support data packed onto 24 bits samples.
> st_pressure driver defines scan_type for my device as:
> <code>
> /* ... */
> .scan_type = {
> .sign = 'u',
> .realbits = 24,
> .storagebits = 24,
> .endianness = IIO_LE,
> },
> </code>
>
> What is the proper way to make this work ? Using 32 bits storagebits
> field ? Enhance generic_buffer to support 24 bits samples ? Anything
> else ??
>
> It seems iio_compute_scan_bytes consider sample data as a simple byte
> stream. So I'm wondering what are the alignment constraints for sample
> start address ? Should they be aligned onto their natural "word"
> boundaries, i.e. 16 bits for u16, 32 bits for u32, etc... ? And for
> 24 bits samples ?
IIO really only supports powers of two >= 8 for the storagebits size.
Everything else is undefined.
Samples are aligned to their storage size.
next prev parent reply other threads:[~2016-04-14 16:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-14 15:28 generic_buffer and 24 bits samples Gregor Boirie
2016-04-14 16:00 ` Lars-Peter Clausen [this message]
2016-04-15 9:56 ` Crestez Dan Leonard
2016-04-15 10:31 ` Lars-Peter Clausen
2016-04-15 13:06 ` Crestez Dan Leonard
2016-04-15 14:35 ` Gregor Boirie
2016-04-15 14:44 ` Lars-Peter Clausen
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=570FBE87.9050006@metafoo.de \
--to=lars@metafoo.de \
--cc=gregor.boirie@parrot.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).