read_raw endianess
Hi,
I'm wondering which endianess read_raw shall be returned? E.g. when calling
Quoted 1 line
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?
Best regards,
Alexander
Quoted 6 lines · Alexander Stein
Hi,
I'm wondering which endianess
read_rawshall be returned? E.g. when callingQuoted 1 line
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