lkml.org 
[lkml]   [2022]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v3 9/9] iio: adc: mcp3911: add support to set PGA
On Mon, Jul 4, 2022 at 7:23 PM Marcus Folkesson
<marcus.folkesson@gmail.com> wrote:
>
> Add support for setting the Programmable Gain Amplifiers by adjust the
> scale value.

...

> +#define MCP3911_GAIN_MASK(ch) (0x7 << 3 * ch)

GENMASK()

...

> + /*
> + * For 24bit Conversion

24-bit

> + * Raw = ((Voltage)/(Vref) * 2^23 * Gain * 1.5
> + * Voltage = Raw * (Vref)/(2^23 * Gain * 1.5)
> + *
> + * ref = Reference voltage
> + * div = (2^23 * 1.5 * gain) = 12582912 * gain
> + */

...

> + /* Set gain to a known value (1) */

What is '(1)'? In parentheses we usually refer to something like a
formula somewhere.

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-07-05 00:04    [W:0.133 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site