/* Read all registers */ for (i = 0; i < ARRAY_SIZE(data->regs); i++) {
val = i2c_smbus_read_byte_data(client, i); if (unlikely(val < 0))
data->regs[i] = 0; else
data->regs[i] = val;
}
/* Return the voltage from the given register in millivolts */ staticint ltc4215_get_voltage(struct device *dev, u8 reg)
{ struct ltc4215_data *data = ltc4215_update_device(dev); const u8 regval = data->regs[reg];
u32 voltage = 0;
switch (reg) { case LTC4215_SENSE: /* 151 uV per increment */
voltage = regval * 151 / 1000; break; case LTC4215_SOURCE: /* 60.5 mV per increment */
voltage = regval * 605 / 10; break; case LTC4215_ADIN: /* *TheADINinputisdividedby12.5,andhas4.82mV *perincrement,sowehavetheadditionalmultiply
*/
voltage = regval * 482 * 125 / 1000; break; default: /* If we get here, the developer messed up */
WARN_ON_ONCE(1); break;
}
return voltage;
}
/* Return the current from the sense resistor in mA */ staticunsignedint ltc4215_get_current(struct device *dev)
{ struct ltc4215_data *data = ltc4215_update_device(dev);
/* This is the driver that will be inserted */ staticstruct i2c_driver ltc4215_driver = {
.driver = {
.name = "ltc4215",
},
.probe = ltc4215_probe,
.id_table = ltc4215_id,
};
module_i2c_driver(ltc4215_driver);
MODULE_AUTHOR("Ira W. Snyder <iws@ovro.caltech.edu>");
MODULE_DESCRIPTION("LTC4215 driver");
MODULE_LICENSE("GPL");
Messung V0.5 in Prozent
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.1Bemerkung:
(vorverarbeitet am 2026-09-27)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.