Re: read_raw endianess

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 8/29/19 6:30 PM, Alexander Stein wrote:
> Hi,
> 
> I'm wondering which endianess read_raw shall be returned? E.g. when calling
>> cat /sys/bus/iio/devices/iio\:device2/in_voltage0_raw
> How much 'rawness' shall be returned? How shall i return my 14 Bit
> big-endian left-adjusted value stored in 16bits?

Hi,

The sysfs attributes always return data in host system endianess and
usually shifted so that the data is right-justified. So that the largest
value that you'll get is 2**N_BITS-1.

raw in this case only means that the data has not been converted to e.g.
a standard SI unit (like volt) since that will typically cause a loss of
precision and/or quantization errors.

- Lars




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux