Lines Matching full:gain
33 /* gain to pulse and scale conversion */
37 int gain; member
57 static int hx711_get_gain_to_pulse(int gain) in hx711_get_gain_to_pulse() argument
62 if (hx711_gain_to_scale[i].gain == gain) in hx711_get_gain_to_pulse()
67 static int hx711_get_gain_to_scale(int gain) in hx711_get_gain_to_scale() argument
72 if (hx711_gain_to_scale[i].gain == gain) in hx711_get_gain_to_scale()
83 return hx711_gain_to_scale[i].gain; in hx711_get_scale_to_gain()
92 int gain_set; /* gain set on device */
93 int gain_chan_a; /* gain for channel A */
218 * after a reset the gain is 128 so we do a dummy read in hx711_reset()
219 * to set the gain for the next read in hx711_reset()
227 * for not mixing gain pulses with the clock in hx711_reset()
330 int gain; in hx711_write_raw() local
343 gain = hx711_get_scale_to_gain(val2); in hx711_write_raw()
344 if (gain < 0) { in hx711_write_raw()
346 return gain; in hx711_write_raw()
349 if (gain != hx711_data->gain_set) { in hx711_write_raw()
350 hx711_data->gain_set = gain; in hx711_write_raw()
351 if (gain != 32) in hx711_write_raw()
352 hx711_data->gain_chan_a = gain; in hx711_write_raw()
532 * full scale differential input range: AVDD / GAIN in hx711_probe()
535 * AVDD / GAIN = 2^24 in hx711_probe()
537 * 1 LSB = AVDD / GAIN / 2^24 in hx711_probe()
540 * 1 LSB = (AVDD * 100) / GAIN / 1678 [10^-9 mV] in hx711_probe()
551 ret / hx711_gain_to_scale[i].gain / 1678; in hx711_probe()