RE: [PATCH 1/1] iio: ak8975: Add Ak8975 magnetometer sensor

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

 



> if I understand your comment correctly userspace needs to know that
> number to convert from the magn_raw values to standard units.
> Hence it must be exported.  My point is that the calib attributes
> are used for devices that do their calibration offsets and scales
> internally.  If it is a value userspace needs to apply then the
> correct parameters are scale and offset. In the majority of devices
> see so far these are fixed for all instances of the same part. That
> isn't true here.
> > 
> > And if we were to emit non-raw values (or provide the scale
> > attributes), what's theexact name of the attributes?  And 
> what units are we expecting?  Gauss?  Tesla?  I don't see 
> that documented anywhere.
> That is documented.  Gauss is the chosen standard for 
> magnetometers.  I'll assume the
> conversion factors are channel dependent in which case you need
> 
> magn_x_raw, magn_x_scale, magn_x_offset
> 
> note again, we have documented everything for some device types.
> At the time, repeating for all of them was considered redundant, but
> perhaps we do need to do this for the added clarity.
> 
> The value in Gauss = (magn_x_raw + magn_x_offset)*magn_x_scale

The conversion formula doesn't have an offset, actually, so the order in which the offset and scale are applied don't really matter to me.

In any case, I think I got it now.  I'm going to report the raw sensor value, and the scale factor for each axis to convert to gauss.

I assume when you say magn_x_scale, you really mean magn_x_gain?  Because I don't see magn_x_scale defined in magnet.h.  Or should I call the attribute magn_x_scale anyway, and not use the IIO_DEV_ATTR macro for gain?
-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain
confidential information.  Any unauthorized review, use, disclosure or distribution
is prohibited.  If you are not the intended recipient, please contact the sender by
reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------
--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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