|
| #define | LTC2983_STATUS_REG 0x0000 |
| |
| #define | LTC2983_TEMP_RES_START_REG 0x0010 |
| |
| #define | LTC2983_EEPROM_KEY_REG 0x00B0 |
| |
| #define | LTC2983_EEPROM_READ_STATUS_REG 0x00D0 |
| |
| #define | LTC2983_GLOBAL_CONFIG_REG 0x00F0 |
| |
| #define | LTC2986_EEPROM_STATUS_REG 0x00F9 |
| |
| #define | LTC2983_MUX_CONFIG_REG 0x00FF |
| |
| #define | LTC2983_CHAN_ASSIGN_START_REG 0x0200 |
| |
| #define | LTC2983_CUST_SENS_TBL_START_REG 0x0250 |
| |
| #define | LTC2983_CUST_SENS_TBL_END_REG 0x03CF |
| |
| #define | ADT7604_RES_RES_START_REG 0x0060 |
| |
| #define | ADT7604_RES_RES_ADDR(chan) |
| |
| #define | LTC2983_CUST_SENS_TBL_SIZE |
| |
| #define | LTC2983_SPI_READ_BYTE 0x3 |
| |
| #define | LTC2983_SPI_WRITE_BYTE 0x2 |
| |
| #define | LTC2983_EEPROM_KEY 0xA53C0F5A |
| |
| #define | LTC2983_EEPROM_WRITE_CMD 0x15 |
| |
| #define | LTC2983_EEPROM_READ_CMD 0x16 |
| |
| #define | LTC2983_EEPROM_STATUS_FAILURE_MASK NO_OS_GENMASK(3, 1) |
| |
| #define | LTC2983_EEPROM_READ_FAILURE_MASK NO_OS_GENMASK(7, 0) |
| |
| #define | LTC2983_EEPROM_WRITE_TIME_MS 2600 |
| |
| #define | LTC2983_EEPROM_READ_TIME_MS 20 |
| |
| #define | LTC2983_CHAN_START_ADDR(chan) |
| |
| #define | LTC2983_CHAN_RES_ADDR(chan) |
| |
| #define | LTC2983_COMMON_HARD_FAULT_MASK NO_OS_GENMASK(31, 30) |
| |
| #define | LTC2983_COMMON_SOFT_FAULT_MASK NO_OS_GENMASK(27, 25) |
| |
| #define | LTC2983_STATUS_START_MASK NO_OS_BIT(7) |
| |
| #define | LTC2983_STATUS_START(x) |
| |
| #define | LTC2983_STATUS_UP_MASK NO_OS_GENMASK(7, 6) |
| |
| #define | LTC2983_STATUS_UP(reg) |
| |
| #define | LTC2983_STATUS_CHAN_SEL_MASK NO_OS_GENMASK(4, 0) |
| |
| #define | LTC2983_STATUS_CHAN_SEL(x) |
| |
| #define | LTC2983_NOTCH_FREQ_MASK NO_OS_GENMASK(1, 0) |
| |
| #define | LTC2983_RES_VALID_MASK NO_OS_BIT(24) |
| |
| #define | LTC2983_DATA_SIGN_BIT 23 |
| |
| #define | LTC2983_DATA_MASK NO_OS_GENMASK(LTC2983_DATA_SIGN_BIT, 0) |
| |
| #define | LTC2983_CHAN_TYPE_MASK NO_OS_GENMASK(31, 27) |
| |
| #define | LTC2983_CHAN_TYPE(x) |
| |
| #define | LTC2983_CHAN_ASSIGN_MASK NO_OS_GENMASK(26, 22) |
| |
| #define | LTC2983_CHAN_ASSIGN(x) |
| |
| #define | LTC2983_CUSTOM_LEN_MASK NO_OS_GENMASK(5, 0) |
| |
| #define | LTC2983_CUSTOM_LEN(x) |
| |
| #define | LTC2983_CUSTOM_ADDR_MASK NO_OS_GENMASK(11, 6) |
| |
| #define | LTC2983_CUSTOM_ADDR(x) |
| |
| #define | LTC2983_THERMOCOUPLE_CFG_MASK NO_OS_GENMASK(21, 18) |
| |
| #define | LTC2983_THERMOCOUPLE_CFG(x) |
| |
| #define | LTC2983_THERMOCOUPLE_HARD_FAULT_MASK NO_OS_GENMASK(31, 29) |
| |
| #define | LTC2983_THERMOCOUPLE_SOFT_FAULT_MASK NO_OS_GENMASK(28, 25) |
| |
| #define | LTC2983_RTD_CFG_MASK NO_OS_GENMASK(21, 18) |
| |
| #define | LTC2983_RTD_CFG(x) |
| |
| #define | LTC2983_RTD_EXC_CURRENT_MASK NO_OS_GENMASK(17, 14) |
| |
| #define | LTC2983_RTD_EXC_CURRENT(x) |
| |
| #define | LTC2983_RTD_CURVE_MASK NO_OS_GENMASK(13, 12) |
| |
| #define | LTC2983_RTD_CURVE(x) |
| |
| #define | LTC2983_THERMISTOR_CFG_MASK NO_OS_GENMASK(21, 19) |
| |
| #define | LTC2983_THERMISTOR_CFG(x) |
| |
| #define | LTC2983_THERMISTOR_EXC_CURRENT_MASK NO_OS_GENMASK(18, 15) |
| |
| #define | LTC2983_THERMISTOR_EXC_CURRENT(x) |
| |
| #define | LTC2983_DIODE_CFG_MASK NO_OS_GENMASK(26, 24) |
| |
| #define | LTC2983_DIODE_CFG(x) |
| |
| #define | LTC2983_DIODE_EXC_CURRENT_MASK NO_OS_GENMASK(23, 22) |
| |
| #define | LTC2983_DIODE_EXC_CURRENT(x) |
| |
| #define | LTC2983_DIODE_IDEAL_FACTOR_MASK NO_OS_GENMASK(21, 0) |
| |
| #define | LTC2983_DIODE_IDEAL_FACTOR(x) |
| |
| #define | LTC2983_R_SENSE_VAL_MASK NO_OS_GENMASK(26, 0) |
| |
| #define | LTC2983_R_SENSE_VAL(x) |
| |
| #define | LTC2983_ADC_SINGLE_ENDED_MASK NO_OS_BIT(26) |
| |
| #define | LTC2983_ADC_SINGLE_ENDED(x) |
| |
| #define | to_thermocouple(_sensor) |
| |
| #define | to_rtd(_sensor) |
| |
| #define | to_thermistor(_sensor) |
| |
| #define | to_diode(_sensor) |
| |
| #define | to_rsense(_sensor) |
| |
| #define | to_adc(_sensor) |
| |
| #define | to_temp(_sensor) |
| |
|
| int | ltc2983_init (struct ltc2983_desc **, struct ltc2983_init_param *) |
| | Device and comm init function.
|
| |
| int | ltc2983_remove (struct ltc2983_desc *) |
| | Remove resources allocated by the init function.
|
| |
| int | ltc2983_reg_read (struct ltc2983_desc *, uint16_t, uint8_t *) |
| | Read raw register value.
|
| |
| int | ltc2983_reg_write (struct ltc2983_desc *, uint16_t, uint8_t) |
| | Write raw register value.
|
| |
| int | ltc2983_reg_update_bits (struct ltc2983_desc *, uint16_t, uint8_t, uint8_t) |
| | Update register value.
|
| |
| int | ltc2983_setup (struct ltc2983_desc *) |
| | Device setup.
|
| |
| int | ltc2983_chan_read (struct ltc2983_desc *, const int, int *) |
| | Read channel data / temperature.
|
| |
| int | ltc2983_chan_read_raw (struct ltc2983_desc *, const int, uint32_t *) |
| | Read raw channel data / temperature.
|
| |
| int | ltc2983_chan_read_scale (struct ltc2983_desc *, const int, uint32_t *, uint32_t *) |
| | Set scale of raw channel data / temperature.
|
| |
| int | ltc2983_chan_read_scale_resistance (struct ltc2983_desc *, const int, uint32_t *, uint32_t *) |
| | Get resistance scale for copper trace or leak detector channels.
|
| |
| int | ltc2983_thermocouple_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *) |
| | Channel assignment for thermocouple sensors.
|
| |
| int | ltc2983_rtd_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *) |
| | Channel assignment for RTD sensors.
|
| |
| int | ltc2983_thermistor_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *) |
| | Channel assignment for thermistor sensors.
|
| |
| int | ltc2983_diode_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *) |
| | Channel assignment for diode sensors.
|
| |
| int | ltc2983_r_sense_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *) |
| | Channel assignment for rsense.
|
| |
| int | ltc2983_adc_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *) |
| | Channel assignment for direct ADC.
|
| |
| int | ltc2983_temp_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *) |
| |
| int | ltc2983_chan_read_resistance (struct ltc2983_desc *, const int, uint32_t *) |
| | Read raw resistance from the ADT7604 resistance result bank (0x0060)
|
| |
| int | ltc2983_thermocouple_fault_handler (const uint32_t) |
| | Fault handling of thermocouple sensors.
|
| |
| int | ltc2983_common_fault_handler (const uint32_t) |
| | Fault handling of sensors other than thermocouple.
|
| |
| int ltc2983_chan_read |
( |
struct ltc2983_desc * | device, |
|
|
const int | chan, |
|
|
int * | val ) |
Read channel data / temperature.
Read channel data / temperature or coverage
- Parameters
-
| device | - LTC2983 descriptor |
| chan | - channel number |
| val | - channel data / temperature |
- Returns
- 0 in case of success, errno errors otherwise
For copper trace (LTC2983_RTD_CUSTOM) and leak detector (LTC2983_THERMISTOR_CUSTOM) channels, use ltc2983_chan_read_resistance() to read raw resistance from the ADT7604 resistance bank. The IIO resistance scales (1/1024000 Ohm/LSB for copper trace, 1/1024 Ohm/LSB for leak detector) cause precision loss in integer arithmetic.