no-OS
Classes | Macros | Enumerations | Functions
ltc2983.h File Reference
#include <stdbool.h>
#include "no_os_gpio.h"
#include "no_os_spi.h"
#include "no_os_util.h"
Include dependency graph for ltc2983.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  ltc2983_init_param
 LTC2983 init param. More...
 
struct  ltc2983_desc
 LTC2983 descriptor. More...
 
struct  ltc2983_sensor
 common LTC2983 sensor struct More...
 
struct  ltc2983_custom_sensor
 custom LTC2983 sensor struct More...
 
struct  ltc2983_thermocouple
 thermocouple sensor descriptor for LTC2983 More...
 
struct  ltc2983_rtd
 RTD sensor descriptor for LTC2983. More...
 
struct  ltc2983_thermistor
 thermistor sensor descriptor for LTC2983 More...
 
struct  ideal_factor_value
 LTC2983 diode ideal factor value. More...
 
struct  ltc2983_diode
 diode sensor descriptor for LTC2983 More...
 
struct  r_sense_value
 LTC2983 sense resistance value. More...
 
struct  ltc2983_rsense
 sense resistor descriptor for LTC2983 More...
 
struct  ltc2983_adc
 direct ADC descriptor for LTC2983 More...
 
struct  ltc2983_temp
 analog temperature sensor descriptor for LTC2983 More...
 

Macros

#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 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)   (((chan - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG)
 
#define LTC2983_CHAN_RES_ADDR(chan)   (((chan - 1) * 4) + LTC2983_TEMP_RES_START_REG)
 
#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)   no_os_field_prep(LTC2983_STATUS_START_MASK, x)
 
#define LTC2983_STATUS_UP_MASK   NO_OS_GENMASK(7, 6)
 
#define LTC2983_STATUS_UP(reg)   no_os_field_get(LTC2983_STATUS_UP_MASK, reg)
 
#define LTC2983_STATUS_CHAN_SEL_MASK   NO_OS_GENMASK(4, 0)
 
#define LTC2983_STATUS_CHAN_SEL(x)   no_os_field_prep(LTC2983_STATUS_CHAN_SEL_MASK, 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)   no_os_field_prep(LTC2983_CHAN_TYPE_MASK, x)
 
#define LTC2983_CHAN_ASSIGN_MASK   NO_OS_GENMASK(26, 22)
 
#define LTC2983_CHAN_ASSIGN(x)   no_os_field_prep(LTC2983_CHAN_ASSIGN_MASK, x)
 
#define LTC2983_CUSTOM_LEN_MASK   NO_OS_GENMASK(5, 0)
 
#define LTC2983_CUSTOM_LEN(x)   no_os_field_prep(LTC2983_CUSTOM_LEN_MASK, x)
 
#define LTC2983_CUSTOM_ADDR_MASK   NO_OS_GENMASK(11, 6)
 
#define LTC2983_CUSTOM_ADDR(x)   no_os_field_prep(LTC2983_CUSTOM_ADDR_MASK, x)
 
#define LTC2983_THERMOCOUPLE_CFG_MASK   NO_OS_GENMASK(21, 18)
 
#define LTC2983_THERMOCOUPLE_CFG(x)   no_os_field_prep(LTC2983_THERMOCOUPLE_CFG_MASK, 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)   no_os_field_prep(LTC2983_RTD_CFG_MASK, x)
 
#define LTC2983_RTD_EXC_CURRENT_MASK   NO_OS_GENMASK(17, 14)
 
#define LTC2983_RTD_EXC_CURRENT(x)   no_os_field_prep(LTC2983_RTD_EXC_CURRENT_MASK, x)
 
#define LTC2983_RTD_CURVE_MASK   NO_OS_GENMASK(13, 12)
 
#define LTC2983_RTD_CURVE(x)   no_os_field_prep(LTC2983_RTD_CURVE_MASK, x)
 
#define LTC2983_THERMISTOR_CFG_MASK   NO_OS_GENMASK(21, 19)
 
#define LTC2983_THERMISTOR_CFG(x)   no_os_field_prep(LTC2983_THERMISTOR_CFG_MASK, x)
 
#define LTC2983_THERMISTOR_EXC_CURRENT_MASK   NO_OS_GENMASK(18, 15)
 
#define LTC2983_THERMISTOR_EXC_CURRENT(x)   no_os_field_prep(LTC2983_THERMISTOR_EXC_CURRENT_MASK, x)
 
#define LTC2983_DIODE_CFG_MASK   NO_OS_GENMASK(26, 24)
 
#define LTC2983_DIODE_CFG(x)   no_os_field_prep(LTC2983_DIODE_CFG_MASK, x)
 
#define LTC2983_DIODE_EXC_CURRENT_MASK   NO_OS_GENMASK(23, 22)
 
#define LTC2983_DIODE_EXC_CURRENT(x)   no_os_field_prep(LTC2983_DIODE_EXC_CURRENT_MASK, x)
 
#define LTC2983_DIODE_IDEAL_FACTOR_MASK   NO_OS_GENMASK(21, 0)
 
#define LTC2983_DIODE_IDEAL_FACTOR(x)   no_os_field_prep(LTC2983_DIODE_IDEAL_FACTOR_MASK, x)
 
#define LTC2983_R_SENSE_VAL_MASK   NO_OS_GENMASK(26, 0)
 
#define LTC2983_R_SENSE_VAL(x)   no_os_field_prep(LTC2983_R_SENSE_VAL_MASK, x)
 
#define LTC2983_ADC_SINGLE_ENDED_MASK   NO_OS_BIT(26)
 
#define LTC2983_ADC_SINGLE_ENDED(x)   no_os_field_prep(LTC2983_ADC_SINGLE_ENDED_MASK, x)
 
#define to_thermocouple(_sensor)   NO_OS_CONTAINER_OF(_sensor, struct ltc2983_thermocouple, sensor)
 
#define to_rtd(_sensor)   NO_OS_CONTAINER_OF(_sensor, struct ltc2983_rtd, sensor)
 
#define to_thermistor(_sensor)   NO_OS_CONTAINER_OF(_sensor, struct ltc2983_thermistor, sensor)
 
#define to_diode(_sensor)   NO_OS_CONTAINER_OF(_sensor, struct ltc2983_diode, sensor)
 
#define to_rsense(_sensor)   NO_OS_CONTAINER_OF(_sensor, struct ltc2983_rsense, sensor)
 
#define to_adc(_sensor)   NO_OS_CONTAINER_OF(_sensor, struct ltc2983_adc, sensor)
 
#define to_temp(_sensor)   NO_OS_CONTAINER_OF(_sensor, struct ltc2983_temp, sensor)
 

Enumerations

enum  ltc298x_id {
  ID_LTC2983,
  ID_LTC2984,
  ID_LTC2986
}
 
enum  ltc2983_filter_notch_freq {
  LTC2983_50_60HZ_REJECTION,
  LTC2983_60HZ_REJECTION,
  LTC2983_50HZ_REJECTION
}
 Notch frequency of the digital filter. More...
 
enum  ltc2983_sensor_type {
  LTC2983_UNASSIGNED,
  LTC2983_THERMOCOUPLE_J,
  LTC2983_THERMOCOUPLE_K,
  LTC2983_THERMOCOUPLE_E,
  LTC2983_THERMOCOUPLE_N,
  LTC2983_THERMOCOUPLE_R,
  LTC2983_THERMOCOUPLE_S,
  LTC2983_THERMOCOUPLE_T,
  LTC2983_THERMOCOUPLE_B,
  LTC2983_THERMOCOUPLE_CUSTOM,
  LTC2983_RTD_PT_10,
  LTC2983_RTD_PT_50,
  LTC2983_RTD_PT_100,
  LTC2983_RTD_PT_200,
  LTC2983_RTD_PT_500,
  LTC2983_RTD_PT_1000,
  LTC2983_RTD_1000,
  LTC2983_RTD_NI_120,
  LTC2983_RTD_CUSTOM,
  LTC2983_THERMISTOR_44004_44033,
  LTC2983_THERMISTOR_44005_44030,
  LTC2983_THERMISTOR_44007_44034,
  LTC2983_THERMISTOR_44006_44031,
  LTC2983_THERMISTOR_44008_44032,
  LTC2983_THERMISTOR_YSI_400,
  LTC2983_THERMISTOR_SPECTRUM_1003K,
  LTC2983_THERMISTOR_CUSTOM_STEINHART_HART,
  LTC2983_THERMISTOR_CUSTOM,
  LTC2983_DIODE,
  LTC2983_RSENSE,
  LTC2983_DIRECT_ADC,
  LTC2983_ACTIVE_TEMP
}
 LTC2983 Sensor Type. More...
 

Functions

int ltc2983_init (struct ltc2983_desc **, struct ltc2983_init_param *)
 Device and comm init function. More...
 
int ltc2983_remove (struct ltc2983_desc *)
 Remove resources allocated by the init function. More...
 
int ltc2983_reg_read (struct ltc2983_desc *, uint16_t, uint8_t *)
 Read raw register value. More...
 
int ltc2983_reg_write (struct ltc2983_desc *, uint16_t, uint8_t)
 Write raw register value. More...
 
int ltc2983_reg_update_bits (struct ltc2983_desc *, uint16_t, uint8_t, uint8_t)
 Update register value. More...
 
int ltc2983_setup (struct ltc2983_desc *)
 Device setup. More...
 
int ltc2983_chan_read (struct ltc2983_desc *, const int, int *)
 Read channel data / temperature. More...
 
int ltc2983_chan_read_raw (struct ltc2983_desc *, const int, uint32_t *)
 Read raw channel data / temperature. More...
 
int ltc2983_chan_read_scale (struct ltc2983_desc *, const int, uint32_t *, uint32_t *)
 Set scale of raw channel data / temperature. More...
 
int ltc2983_thermocouple_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *)
 Channel assignment for thermocouple sensors. More...
 
int ltc2983_rtd_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *)
 Channel assignment for RTD sensors. More...
 
int ltc2983_thermistor_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *)
 Channel assignment for thermistor sensors. More...
 
int ltc2983_diode_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *)
 Channel assignment for diode sensors. More...
 
int ltc2983_r_sense_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *)
 Channel assignment for rsense. More...
 
int ltc2983_adc_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *)
 Channel assignment for direct ADC. More...
 
int ltc2983_temp_assign_chan (struct ltc2983_desc *, const struct ltc2983_sensor *)
 
int ltc2983_thermocouple_fault_handler (const uint32_t)
 Fault handling of thermocouple sensors. More...
 
int ltc2983_common_fault_handler (const uint32_t)
 Fault handling of sensors other than thermocouple. More...
 

Macro Definition Documentation

◆ LTC2983_ADC_SINGLE_ENDED

#define LTC2983_ADC_SINGLE_ENDED (   x)    no_os_field_prep(LTC2983_ADC_SINGLE_ENDED_MASK, x)

◆ LTC2983_ADC_SINGLE_ENDED_MASK

#define LTC2983_ADC_SINGLE_ENDED_MASK   NO_OS_BIT(26)

◆ LTC2983_CHAN_ASSIGN

#define LTC2983_CHAN_ASSIGN (   x)    no_os_field_prep(LTC2983_CHAN_ASSIGN_MASK, x)

◆ LTC2983_CHAN_ASSIGN_MASK

#define LTC2983_CHAN_ASSIGN_MASK   NO_OS_GENMASK(26, 22)

◆ LTC2983_CHAN_ASSIGN_START_REG

#define LTC2983_CHAN_ASSIGN_START_REG   0x0200

◆ LTC2983_CHAN_RES_ADDR

#define LTC2983_CHAN_RES_ADDR (   chan)    (((chan - 1) * 4) + LTC2983_TEMP_RES_START_REG)

◆ LTC2983_CHAN_START_ADDR

#define LTC2983_CHAN_START_ADDR (   chan)    (((chan - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG)

◆ LTC2983_CHAN_TYPE

#define LTC2983_CHAN_TYPE (   x)    no_os_field_prep(LTC2983_CHAN_TYPE_MASK, x)

◆ LTC2983_CHAN_TYPE_MASK

#define LTC2983_CHAN_TYPE_MASK   NO_OS_GENMASK(31, 27)

◆ LTC2983_COMMON_HARD_FAULT_MASK

#define LTC2983_COMMON_HARD_FAULT_MASK   NO_OS_GENMASK(31, 30)

◆ LTC2983_COMMON_SOFT_FAULT_MASK

#define LTC2983_COMMON_SOFT_FAULT_MASK   NO_OS_GENMASK(27, 25)

◆ LTC2983_CUST_SENS_TBL_END_REG

#define LTC2983_CUST_SENS_TBL_END_REG   0x03CF

◆ LTC2983_CUST_SENS_TBL_SIZE

#define LTC2983_CUST_SENS_TBL_SIZE
Value:
LTC2983_CUST_SENS_TBL_START_REG + 1

◆ LTC2983_CUST_SENS_TBL_START_REG

#define LTC2983_CUST_SENS_TBL_START_REG   0x0250

◆ LTC2983_CUSTOM_ADDR

#define LTC2983_CUSTOM_ADDR (   x)    no_os_field_prep(LTC2983_CUSTOM_ADDR_MASK, x)

◆ LTC2983_CUSTOM_ADDR_MASK

#define LTC2983_CUSTOM_ADDR_MASK   NO_OS_GENMASK(11, 6)

◆ LTC2983_CUSTOM_LEN

#define LTC2983_CUSTOM_LEN (   x)    no_os_field_prep(LTC2983_CUSTOM_LEN_MASK, x)

◆ LTC2983_CUSTOM_LEN_MASK

#define LTC2983_CUSTOM_LEN_MASK   NO_OS_GENMASK(5, 0)

◆ LTC2983_DATA_MASK

#define LTC2983_DATA_MASK   NO_OS_GENMASK(LTC2983_DATA_SIGN_BIT, 0)

◆ LTC2983_DATA_SIGN_BIT

#define LTC2983_DATA_SIGN_BIT   23

◆ LTC2983_DIODE_CFG

#define LTC2983_DIODE_CFG (   x)    no_os_field_prep(LTC2983_DIODE_CFG_MASK, x)

◆ LTC2983_DIODE_CFG_MASK

#define LTC2983_DIODE_CFG_MASK   NO_OS_GENMASK(26, 24)

◆ LTC2983_DIODE_EXC_CURRENT

#define LTC2983_DIODE_EXC_CURRENT (   x)    no_os_field_prep(LTC2983_DIODE_EXC_CURRENT_MASK, x)

◆ LTC2983_DIODE_EXC_CURRENT_MASK

#define LTC2983_DIODE_EXC_CURRENT_MASK   NO_OS_GENMASK(23, 22)

◆ LTC2983_DIODE_IDEAL_FACTOR

#define LTC2983_DIODE_IDEAL_FACTOR (   x)    no_os_field_prep(LTC2983_DIODE_IDEAL_FACTOR_MASK, x)

◆ LTC2983_DIODE_IDEAL_FACTOR_MASK

#define LTC2983_DIODE_IDEAL_FACTOR_MASK   NO_OS_GENMASK(21, 0)

◆ LTC2983_EEPROM_KEY

#define LTC2983_EEPROM_KEY   0xA53C0F5A

◆ LTC2983_EEPROM_KEY_REG

#define LTC2983_EEPROM_KEY_REG   0x00B0

◆ LTC2983_EEPROM_READ_CMD

#define LTC2983_EEPROM_READ_CMD   0x16

◆ LTC2983_EEPROM_READ_FAILURE_MASK

#define LTC2983_EEPROM_READ_FAILURE_MASK   NO_OS_GENMASK(7, 0)

◆ LTC2983_EEPROM_READ_STATUS_REG

#define LTC2983_EEPROM_READ_STATUS_REG   0x00D0

◆ LTC2983_EEPROM_READ_TIME_MS

#define LTC2983_EEPROM_READ_TIME_MS   20

◆ LTC2983_EEPROM_STATUS_FAILURE_MASK

#define LTC2983_EEPROM_STATUS_FAILURE_MASK   NO_OS_GENMASK(3, 1)

◆ LTC2983_EEPROM_WRITE_CMD

#define LTC2983_EEPROM_WRITE_CMD   0x15

◆ LTC2983_EEPROM_WRITE_TIME_MS

#define LTC2983_EEPROM_WRITE_TIME_MS   2600

◆ LTC2983_GLOBAL_CONFIG_REG

#define LTC2983_GLOBAL_CONFIG_REG   0x00F0

◆ LTC2983_MUX_CONFIG_REG

#define LTC2983_MUX_CONFIG_REG   0x00FF

◆ LTC2983_NOTCH_FREQ_MASK

#define LTC2983_NOTCH_FREQ_MASK   NO_OS_GENMASK(1, 0)

◆ LTC2983_R_SENSE_VAL

#define LTC2983_R_SENSE_VAL (   x)    no_os_field_prep(LTC2983_R_SENSE_VAL_MASK, x)

◆ LTC2983_R_SENSE_VAL_MASK

#define LTC2983_R_SENSE_VAL_MASK   NO_OS_GENMASK(26, 0)

◆ LTC2983_RES_VALID_MASK

#define LTC2983_RES_VALID_MASK   NO_OS_BIT(24)

◆ LTC2983_RTD_CFG

#define LTC2983_RTD_CFG (   x)    no_os_field_prep(LTC2983_RTD_CFG_MASK, x)

◆ LTC2983_RTD_CFG_MASK

#define LTC2983_RTD_CFG_MASK   NO_OS_GENMASK(21, 18)

◆ LTC2983_RTD_CURVE

#define LTC2983_RTD_CURVE (   x)    no_os_field_prep(LTC2983_RTD_CURVE_MASK, x)

◆ LTC2983_RTD_CURVE_MASK

#define LTC2983_RTD_CURVE_MASK   NO_OS_GENMASK(13, 12)

◆ LTC2983_RTD_EXC_CURRENT

#define LTC2983_RTD_EXC_CURRENT (   x)    no_os_field_prep(LTC2983_RTD_EXC_CURRENT_MASK, x)

◆ LTC2983_RTD_EXC_CURRENT_MASK

#define LTC2983_RTD_EXC_CURRENT_MASK   NO_OS_GENMASK(17, 14)

◆ LTC2983_SPI_READ_BYTE

#define LTC2983_SPI_READ_BYTE   0x3

◆ LTC2983_SPI_WRITE_BYTE

#define LTC2983_SPI_WRITE_BYTE   0x2

◆ LTC2983_STATUS_CHAN_SEL

#define LTC2983_STATUS_CHAN_SEL (   x)    no_os_field_prep(LTC2983_STATUS_CHAN_SEL_MASK, x)

◆ LTC2983_STATUS_CHAN_SEL_MASK

#define LTC2983_STATUS_CHAN_SEL_MASK   NO_OS_GENMASK(4, 0)

◆ LTC2983_STATUS_REG

#define LTC2983_STATUS_REG   0x0000

◆ LTC2983_STATUS_START

#define LTC2983_STATUS_START (   x)    no_os_field_prep(LTC2983_STATUS_START_MASK, x)

◆ LTC2983_STATUS_START_MASK

#define LTC2983_STATUS_START_MASK   NO_OS_BIT(7)

◆ LTC2983_STATUS_UP

#define LTC2983_STATUS_UP (   reg)    no_os_field_get(LTC2983_STATUS_UP_MASK, reg)

◆ LTC2983_STATUS_UP_MASK

#define LTC2983_STATUS_UP_MASK   NO_OS_GENMASK(7, 6)

◆ LTC2983_TEMP_RES_START_REG

#define LTC2983_TEMP_RES_START_REG   0x0010

◆ LTC2983_THERMISTOR_CFG

#define LTC2983_THERMISTOR_CFG (   x)    no_os_field_prep(LTC2983_THERMISTOR_CFG_MASK, x)

◆ LTC2983_THERMISTOR_CFG_MASK

#define LTC2983_THERMISTOR_CFG_MASK   NO_OS_GENMASK(21, 19)

◆ LTC2983_THERMISTOR_EXC_CURRENT

#define LTC2983_THERMISTOR_EXC_CURRENT (   x)    no_os_field_prep(LTC2983_THERMISTOR_EXC_CURRENT_MASK, x)

◆ LTC2983_THERMISTOR_EXC_CURRENT_MASK

#define LTC2983_THERMISTOR_EXC_CURRENT_MASK   NO_OS_GENMASK(18, 15)

◆ LTC2983_THERMOCOUPLE_CFG

#define LTC2983_THERMOCOUPLE_CFG (   x)    no_os_field_prep(LTC2983_THERMOCOUPLE_CFG_MASK, x)

◆ LTC2983_THERMOCOUPLE_CFG_MASK

#define LTC2983_THERMOCOUPLE_CFG_MASK   NO_OS_GENMASK(21, 18)

◆ LTC2983_THERMOCOUPLE_HARD_FAULT_MASK

#define LTC2983_THERMOCOUPLE_HARD_FAULT_MASK   NO_OS_GENMASK(31, 29)

◆ LTC2983_THERMOCOUPLE_SOFT_FAULT_MASK

#define LTC2983_THERMOCOUPLE_SOFT_FAULT_MASK   NO_OS_GENMASK(28, 25)

◆ LTC2986_EEPROM_STATUS_REG

#define LTC2986_EEPROM_STATUS_REG   0x00F9

◆ to_adc

#define to_adc (   _sensor)    NO_OS_CONTAINER_OF(_sensor, struct ltc2983_adc, sensor)

◆ to_diode

#define to_diode (   _sensor)    NO_OS_CONTAINER_OF(_sensor, struct ltc2983_diode, sensor)

◆ to_rsense

#define to_rsense (   _sensor)    NO_OS_CONTAINER_OF(_sensor, struct ltc2983_rsense, sensor)

◆ to_rtd

#define to_rtd (   _sensor)    NO_OS_CONTAINER_OF(_sensor, struct ltc2983_rtd, sensor)

◆ to_temp

#define to_temp (   _sensor)    NO_OS_CONTAINER_OF(_sensor, struct ltc2983_temp, sensor)

◆ to_thermistor

#define to_thermistor (   _sensor)    NO_OS_CONTAINER_OF(_sensor, struct ltc2983_thermistor, sensor)

◆ to_thermocouple

#define to_thermocouple (   _sensor)    NO_OS_CONTAINER_OF(_sensor, struct ltc2983_thermocouple, sensor)

Enumeration Type Documentation

◆ ltc2983_filter_notch_freq

Notch frequency of the digital filter.

Enumerator
LTC2983_50_60HZ_REJECTION 
LTC2983_60HZ_REJECTION 
LTC2983_50HZ_REJECTION 

◆ ltc2983_sensor_type

LTC2983 Sensor Type.

Enumerator
LTC2983_UNASSIGNED 
LTC2983_THERMOCOUPLE_J 
LTC2983_THERMOCOUPLE_K 
LTC2983_THERMOCOUPLE_E 
LTC2983_THERMOCOUPLE_N 
LTC2983_THERMOCOUPLE_R 
LTC2983_THERMOCOUPLE_S 
LTC2983_THERMOCOUPLE_T 
LTC2983_THERMOCOUPLE_B 
LTC2983_THERMOCOUPLE_CUSTOM 
LTC2983_RTD_PT_10 
LTC2983_RTD_PT_50 
LTC2983_RTD_PT_100 
LTC2983_RTD_PT_200 
LTC2983_RTD_PT_500 
LTC2983_RTD_PT_1000 
LTC2983_RTD_1000 
LTC2983_RTD_NI_120 
LTC2983_RTD_CUSTOM 
LTC2983_THERMISTOR_44004_44033 
LTC2983_THERMISTOR_44005_44030 
LTC2983_THERMISTOR_44007_44034 
LTC2983_THERMISTOR_44006_44031 
LTC2983_THERMISTOR_44008_44032 
LTC2983_THERMISTOR_YSI_400 
LTC2983_THERMISTOR_SPECTRUM_1003K 
LTC2983_THERMISTOR_CUSTOM_STEINHART_HART 
LTC2983_THERMISTOR_CUSTOM 
LTC2983_DIODE 
LTC2983_RSENSE 
LTC2983_DIRECT_ADC 
LTC2983_ACTIVE_TEMP 

◆ ltc298x_id

enum ltc298x_id
Enumerator
ID_LTC2983 
ID_LTC2984 
ID_LTC2986 

Function Documentation

◆ ltc2983_adc_assign_chan()

int ltc2983_adc_assign_chan ( struct ltc2983_desc device,
const struct ltc2983_sensor sensor 
)

Channel assignment for direct ADC.

Channel assignment for direct ADC

Parameters
device- LTC2983 descriptor
sensor- LTC2983 common sensor descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_chan_read()

int ltc2983_chan_read ( struct ltc2983_desc device,
const int  chan,
int *  val 
)

Read channel data / temperature.

Read channel data / temperature

Parameters
device- LTC2983 descriptor
chan- channel number
val- channel data / temperature
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_chan_read_raw()

int ltc2983_chan_read_raw ( struct ltc2983_desc device,
const int  chan,
uint32_t *  val 
)

Read raw channel data / temperature.

Read raw channel data / temperature

Parameters
device- LTC2983 descriptor
chan- channel number
val- raw channel data / temperature
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_chan_read_scale()

int ltc2983_chan_read_scale ( struct ltc2983_desc device,
const int  chan,
uint32_t *  val,
uint32_t *  val2 
)

Set scale of raw channel data / temperature.

Set scale of raw channel data / temperature

Parameters
device- LTC2983 descriptor
chan- channel number
val- scale numerator
val2- scale denominator
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_common_fault_handler()

int ltc2983_common_fault_handler ( const uint32_t  result)

Fault handling of sensors other than thermocouple.

Fault handling of sensors other than thermocouple

Parameters
result- result captured that contains the faults
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_diode_assign_chan()

int ltc2983_diode_assign_chan ( struct ltc2983_desc device,
const struct ltc2983_sensor sensor 
)

Channel assignment for diode sensors.

Channel assignment for diode sensors

Parameters
device- LTC2983 descriptor
sensor- LTC2983 common sensor descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_init()

int ltc2983_init ( struct ltc2983_desc **  device,
struct ltc2983_init_param init_param 
)

Device and comm init function.

Device and comm init function

Parameters
device- LTC2983 descriptor to be initialized
init_param- Init parameter for descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_r_sense_assign_chan()

int ltc2983_r_sense_assign_chan ( struct ltc2983_desc device,
const struct ltc2983_sensor sensor 
)

Channel assignment for rsense.

Channel assignment for rsense

Parameters
device- LTC2983 descriptor
sensor- LTC2983 common sensor descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_reg_read()

int ltc2983_reg_read ( struct ltc2983_desc device,
uint16_t  reg_addr,
uint8_t *  val 
)

Read raw register value.

Read raw register value

Parameters
device- LTC2983 descriptor
reg_addr- register address
val- register value
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ ltc2983_reg_update_bits()

int ltc2983_reg_update_bits ( struct ltc2983_desc device,
uint16_t  reg_addr,
uint8_t  mask,
uint8_t  val 
)

Update register value.

Update register value

Parameters
device- LTC2983 descriptor
reg_addr- register address
mask- Mask for specific register bits to be updated
val- register value to be written
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ ltc2983_reg_write()

int ltc2983_reg_write ( struct ltc2983_desc device,
uint16_t  reg_addr,
uint8_t  val 
)

Write raw register value.

Write raw register value

Parameters
device- LTC2983 descriptor
reg_addr- register address
val- register value
Returns
0 in case of success, negative error code otherwise
Here is the caller graph for this function:

◆ ltc2983_remove()

int ltc2983_remove ( struct ltc2983_desc device)

Remove resources allocated by the init function.

Free resources allocated by the init function

Parameters
device- LTC2983 descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_rtd_assign_chan()

int ltc2983_rtd_assign_chan ( struct ltc2983_desc device,
const struct ltc2983_sensor sensor 
)

Channel assignment for RTD sensors.

Channel assignment for RTD sensors

Parameters
device- LTC2983 descriptor
sensor- LTC2983 common sensor descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_setup()

int ltc2983_setup ( struct ltc2983_desc device)

Device setup.

Device setup

Parameters
device- LTC2983 descriptor
Returns
0 in case of success, errno errors otherwise

make sure the device is up: start bit (7) is 0 and done bit (6) is 1

Here is the caller graph for this function:

◆ ltc2983_temp_assign_chan()

int ltc2983_temp_assign_chan ( struct ltc2983_desc ,
const struct ltc2983_sensor  
)

Channel assignment for analog temp sensor

Here is the caller graph for this function:

◆ ltc2983_thermistor_assign_chan()

int ltc2983_thermistor_assign_chan ( struct ltc2983_desc device,
const struct ltc2983_sensor sensor 
)

Channel assignment for thermistor sensors.

Channel assignment for thermistor sensors

Parameters
device- LTC2983 descriptor
sensor- LTC2983 common sensor descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_thermocouple_assign_chan()

int ltc2983_thermocouple_assign_chan ( struct ltc2983_desc device,
const struct ltc2983_sensor sensor 
)

Channel assignment for thermocouple sensors.

Channel assignment for thermocouple sensors

Parameters
device- LTC2983 descriptor
sensor- LTC2983 common sensor descriptor
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:

◆ ltc2983_thermocouple_fault_handler()

int ltc2983_thermocouple_fault_handler ( const uint32_t  result)

Fault handling of thermocouple sensors.

Fault handling of thermocouple sensors

Parameters
result- result captured that contains the faults
Returns
0 in case of success, errno errors otherwise
Here is the caller graph for this function:
LTC2983_CUST_SENS_TBL_END_REG
#define LTC2983_CUST_SENS_TBL_END_REG
Definition: ltc2983.h:59