Re: [PATCH v2 4/4] iio: accel: adxl345: add sampling frequency support

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

 



On Mon, Jun 18, 2018 at 6:59 PM, Akinobu Mita <akinobu.mita@xxxxxxxxx> wrote:
> The ADXL345 provides selectable output data rate.  This adds the iio
> channel information for the sampling frequency with that feature.

> +static const struct {
> +       int val;
> +       int val2;
> +} adxl345_samp_freq_table[] = {
> +       { 0, 97656 },
> +       { 0, 195313 },
> +       { 0, 390625 },
> +       { 0, 781250 },
> +       { 1, 562500 },
> +       { 3, 125000 },
> +       { 6, 250000 },
> +       { 12, 500000 },
> +       { 25, 0 },
> +       { 50, 0 },
> +       { 100, 0 },
> +       { 200, 0 },
> +       { 400, 0 },
> +       { 800, 0 },
> +       { 1600, 0 },
> +       { 3200, 0 },
> +};

So, this is effectively a just formula with a bit shifts (index is an
exponent) and point of origin.
Why to keep ugly table?

-- 
With Best Regards,
Andy Shevchenko
--
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