no-OS
ltc2983.h
Go to the documentation of this file.
1 /***************************************************************************/
34 #ifndef __LTC2983_H__
35 #define __LTC2983_H__
36 
37 /******************************************************************************/
38 /***************************** Include Files **********************************/
39 /******************************************************************************/
40 
41 #include <stdbool.h>
42 #include "no_os_gpio.h"
43 #include "no_os_spi.h"
44 #include "no_os_util.h"
45 
46 /******************************************************************************/
47 /********************** Macros and Constants Definitions **********************/
48 /******************************************************************************/
49 
50 #define LTC2983_STATUS_REG 0x0000
51 #define LTC2983_TEMP_RES_START_REG 0x0010
52 #define LTC2983_EEPROM_KEY_REG 0x00B0
53 #define LTC2983_EEPROM_READ_STATUS_REG 0x00D0
54 #define LTC2983_GLOBAL_CONFIG_REG 0x00F0
55 #define LTC2986_EEPROM_STATUS_REG 0x00F9
56 #define LTC2983_MUX_CONFIG_REG 0x00FF
57 #define LTC2983_CHAN_ASSIGN_START_REG 0x0200
58 #define LTC2983_CUST_SENS_TBL_START_REG 0x0250
59 #define LTC2983_CUST_SENS_TBL_END_REG 0x03CF
60 
61 #define LTC2983_CUST_SENS_TBL_SIZE LTC2983_CUST_SENS_TBL_END_REG - \
62  LTC2983_CUST_SENS_TBL_START_REG + 1
63 #define LTC2983_SPI_READ_BYTE 0x3
64 #define LTC2983_SPI_WRITE_BYTE 0x2
65 
66 #define LTC2983_EEPROM_KEY 0xA53C0F5A
67 #define LTC2983_EEPROM_WRITE_CMD 0x15
68 #define LTC2983_EEPROM_READ_CMD 0x16
69 #define LTC2983_EEPROM_STATUS_FAILURE_MASK NO_OS_GENMASK(3, 1)
70 #define LTC2983_EEPROM_READ_FAILURE_MASK NO_OS_GENMASK(7, 0)
71 
72 #define LTC2983_EEPROM_WRITE_TIME_MS 2600
73 #define LTC2983_EEPROM_READ_TIME_MS 20
74 
75 #define LTC2983_CHAN_START_ADDR(chan) \
76  (((chan - 1) * 4) + LTC2983_CHAN_ASSIGN_START_REG)
77 #define LTC2983_CHAN_RES_ADDR(chan) \
78  (((chan - 1) * 4) + LTC2983_TEMP_RES_START_REG)
79 
80 #define LTC2983_COMMON_HARD_FAULT_MASK NO_OS_GENMASK(31, 30)
81 #define LTC2983_COMMON_SOFT_FAULT_MASK NO_OS_GENMASK(27, 25)
82 
83 #define LTC2983_STATUS_START_MASK NO_OS_BIT(7)
84 #define LTC2983_STATUS_START(x) no_os_field_prep(LTC2983_STATUS_START_MASK, x)
85 #define LTC2983_STATUS_UP_MASK NO_OS_GENMASK(7, 6)
86 #define LTC2983_STATUS_UP(reg) no_os_field_get(LTC2983_STATUS_UP_MASK, reg)
87 
88 #define LTC2983_STATUS_CHAN_SEL_MASK NO_OS_GENMASK(4, 0)
89 #define LTC2983_STATUS_CHAN_SEL(x) \
90  no_os_field_prep(LTC2983_STATUS_CHAN_SEL_MASK, x)
91 
92 #define LTC2983_NOTCH_FREQ_MASK NO_OS_GENMASK(1, 0)
93 
94 #define LTC2983_RES_VALID_MASK NO_OS_BIT(24)
95 #define LTC2983_DATA_SIGN_BIT 23
96 #define LTC2983_DATA_MASK NO_OS_GENMASK(LTC2983_DATA_SIGN_BIT, 0)
97 
98 #define LTC2983_CHAN_TYPE_MASK NO_OS_GENMASK(31, 27)
99 #define LTC2983_CHAN_TYPE(x) no_os_field_prep(LTC2983_CHAN_TYPE_MASK, x)
100 
101 #define LTC2983_CHAN_ASSIGN_MASK NO_OS_GENMASK(26, 22)
102 #define LTC2983_CHAN_ASSIGN(x) no_os_field_prep(LTC2983_CHAN_ASSIGN_MASK, x)
103 
104 #define LTC2983_CUSTOM_LEN_MASK NO_OS_GENMASK(5, 0)
105 #define LTC2983_CUSTOM_LEN(x) no_os_field_prep(LTC2983_CUSTOM_LEN_MASK, x)
106 
107 #define LTC2983_CUSTOM_ADDR_MASK NO_OS_GENMASK(11, 6)
108 #define LTC2983_CUSTOM_ADDR(x) no_os_field_prep(LTC2983_CUSTOM_ADDR_MASK, x)
109 
110 #define LTC2983_THERMOCOUPLE_CFG_MASK NO_OS_GENMASK(21, 18)
111 #define LTC2983_THERMOCOUPLE_CFG(x) \
112  no_os_field_prep(LTC2983_THERMOCOUPLE_CFG_MASK, x)
113 #define LTC2983_THERMOCOUPLE_HARD_FAULT_MASK NO_OS_GENMASK(31, 29)
114 #define LTC2983_THERMOCOUPLE_SOFT_FAULT_MASK NO_OS_GENMASK(28, 25)
115 
116 #define LTC2983_RTD_CFG_MASK NO_OS_GENMASK(21, 18)
117 #define LTC2983_RTD_CFG(x) no_os_field_prep(LTC2983_RTD_CFG_MASK, x)
118 #define LTC2983_RTD_EXC_CURRENT_MASK NO_OS_GENMASK(17, 14)
119 #define LTC2983_RTD_EXC_CURRENT(x) \
120  no_os_field_prep(LTC2983_RTD_EXC_CURRENT_MASK, x)
121 #define LTC2983_RTD_CURVE_MASK NO_OS_GENMASK(13, 12)
122 #define LTC2983_RTD_CURVE(x) no_os_field_prep(LTC2983_RTD_CURVE_MASK, x)
123 
124 #define LTC2983_THERMISTOR_CFG_MASK NO_OS_GENMASK(21, 19)
125 #define LTC2983_THERMISTOR_CFG(x) \
126  no_os_field_prep(LTC2983_THERMISTOR_CFG_MASK, x)
127 #define LTC2983_THERMISTOR_EXC_CURRENT_MASK NO_OS_GENMASK(18, 15)
128 #define LTC2983_THERMISTOR_EXC_CURRENT(x) \
129  no_os_field_prep(LTC2983_THERMISTOR_EXC_CURRENT_MASK, x)
130 
131 #define LTC2983_DIODE_CFG_MASK NO_OS_GENMASK(26, 24)
132 #define LTC2983_DIODE_CFG(x) no_os_field_prep(LTC2983_DIODE_CFG_MASK, x)
133 #define LTC2983_DIODE_EXC_CURRENT_MASK NO_OS_GENMASK(23, 22)
134 #define LTC2983_DIODE_EXC_CURRENT(x) \
135  no_os_field_prep(LTC2983_DIODE_EXC_CURRENT_MASK, x)
136 #define LTC2983_DIODE_IDEAL_FACTOR_MASK NO_OS_GENMASK(21, 0)
137 #define LTC2983_DIODE_IDEAL_FACTOR(x) \
138  no_os_field_prep(LTC2983_DIODE_IDEAL_FACTOR_MASK, x)
139 
140 #define LTC2983_R_SENSE_VAL_MASK NO_OS_GENMASK(26, 0)
141 #define LTC2983_R_SENSE_VAL(x) no_os_field_prep(LTC2983_R_SENSE_VAL_MASK, x)
142 
143 #define LTC2983_ADC_SINGLE_ENDED_MASK NO_OS_BIT(26)
144 #define LTC2983_ADC_SINGLE_ENDED(x) \
145  no_os_field_prep(LTC2983_ADC_SINGLE_ENDED_MASK, x)
146 
155 };
156 
164 };
165 
202 };
203 
204 #define to_thermocouple(_sensor) \
205  NO_OS_CONTAINER_OF(_sensor, struct ltc2983_thermocouple, sensor)
206 
207 #define to_rtd(_sensor) \
208  NO_OS_CONTAINER_OF(_sensor, struct ltc2983_rtd, sensor)
209 
210 #define to_thermistor(_sensor) \
211  NO_OS_CONTAINER_OF(_sensor, struct ltc2983_thermistor, sensor)
212 
213 #define to_diode(_sensor) \
214  NO_OS_CONTAINER_OF(_sensor, struct ltc2983_diode, sensor)
215 
216 #define to_rsense(_sensor) \
217  NO_OS_CONTAINER_OF(_sensor, struct ltc2983_rsense, sensor)
218 
219 #define to_adc(_sensor) \
220  NO_OS_CONTAINER_OF(_sensor, struct ltc2983_adc, sensor)
221 
222 #define to_temp(_sensor) \
223  NO_OS_CONTAINER_OF(_sensor, struct ltc2983_temp, sensor)
224 
238  struct ltc2983_sensor *sensors[20];
240  uint16_t custom_addr_ptr;
243 };
244 
248 struct ltc2983_desc {
258  uint8_t num_channels;
260  struct ltc2983_sensor *sensors[20];
262  uint16_t custom_addr_ptr;
265 };
266 
272  uint8_t chan;
274  uint8_t type : 5;
275 };
276 
282  uint32_t *table;
284  size_t len;
287 };
288 
298  uint32_t sensor_config;
301 };
302 
306 struct ltc2983_rtd {
312  uint32_t sensor_config;
314  uint32_t r_sense_chan;
318  uint32_t rtd_curve;
319 };
320 
330  uint32_t sensor_config;
332  uint32_t r_sense_chan;
335 };
336 
345 };
346 
354  uint32_t sensor_config;
359 };
360 
366  uint32_t r_sense_val_int;
369 };
370 
379 };
380 
384 struct ltc2983_adc {
389 };
390 
394 struct ltc2983_temp {
401 };
402 
404 int ltc2983_init(struct ltc2983_desc **, struct ltc2983_init_param *);
405 
407 int ltc2983_remove(struct ltc2983_desc *);
408 
410 int ltc2983_reg_read(struct ltc2983_desc *, uint16_t, uint8_t *);
411 
413 int ltc2983_reg_write(struct ltc2983_desc *, uint16_t, uint8_t);
414 
416 int ltc2983_reg_update_bits(struct ltc2983_desc *, uint16_t, uint8_t, uint8_t);
417 
419 int ltc2983_setup(struct ltc2983_desc *);
420 
422 int ltc2983_chan_read(struct ltc2983_desc *, const int, int *);
423 
425 int ltc2983_chan_read_raw(struct ltc2983_desc *, const int, uint32_t *);
426 
428 int ltc2983_chan_read_scale(struct ltc2983_desc *, const int, uint32_t *,
429  uint32_t *);
430 
433  const struct ltc2983_sensor *);
434 
437  const struct ltc2983_sensor *);
438 
441  const struct ltc2983_sensor *);
442 
445  const struct ltc2983_sensor *);
446 
449  const struct ltc2983_sensor *);
450 
453  const struct ltc2983_sensor *);
454 
457  const struct ltc2983_sensor *);
458 
460 int ltc2983_thermocouple_fault_handler(const uint32_t);
461 
463 int ltc2983_common_fault_handler(const uint32_t);
464 
465 #endif
LTC2983_THERMISTOR_CUSTOM_STEINHART_HART
@ LTC2983_THERMISTOR_CUSTOM_STEINHART_HART
Definition: ltc2983.h:196
LTC2983_RTD_PT_10
@ LTC2983_RTD_PT_10
Definition: ltc2983.h:180
ltc2983_init_param::gpio_rstn
struct no_os_gpio_init_param gpio_rstn
Definition: ltc2983.h:232
no_os_put_unaligned_be16
void no_os_put_unaligned_be16(uint16_t val, uint8_t *buf)
ltc2983_rtd_assign_chan
int ltc2983_rtd_assign_chan(struct ltc2983_desc *device, const struct ltc2983_sensor *sensor)
Channel assignment for RTD sensors.
Definition: ltc2983.c:517
no_os_put_unaligned_be24
void no_os_put_unaligned_be24(uint32_t val, uint8_t *buf)
LTC2983_50HZ_REJECTION
@ LTC2983_50HZ_REJECTION
Definition: ltc2983.h:163
timeout
uint32_t timeout
Definition: ad413x.c:49
no_os_alloc.h
no_os_gpio_init_param
Structure holding the parameters for GPIO initialization.
Definition: no_os_gpio.h:79
ID_LTC2984
@ ID_LTC2984
Definition: ltc2983.h:153
LTC2983_THERMOCOUPLE_E
@ LTC2983_THERMOCOUPLE_E
Definition: ltc2983.h:173
LTC2983_THERMISTOR_CUSTOM
@ LTC2983_THERMISTOR_CUSTOM
Definition: ltc2983.h:197
ltc2983_desc::sensors
struct ltc2983_sensor * sensors[20]
Definition: ltc2983.h:260
r_sense_value::r_sense_val_dec_1024
uint32_t r_sense_val_dec_1024
Definition: ltc2983.h:368
LTC2983_RTD_CUSTOM
@ LTC2983_RTD_CUSTOM
Definition: ltc2983.h:188
LTC2983_DIRECT_ADC
@ LTC2983_DIRECT_ADC
Definition: ltc2983.h:200
r_sense_value::r_sense_val_int
uint32_t r_sense_val_int
Definition: ltc2983.h:366
ltc2983_diode::ideal_factor_val
struct ideal_factor_value ideal_factor_val
Definition: ltc2983.h:358
LTC2983_THERMOCOUPLE_HARD_FAULT_MASK
#define LTC2983_THERMOCOUPLE_HARD_FAULT_MASK
Definition: ltc2983.h:113
ltc2983_desc::max_channels_nr
uint8_t max_channels_nr
Definition: ltc2983.h:264
no_os_spi_write_and_read
int32_t no_os_spi_write_and_read(struct no_os_spi_desc *desc, uint8_t *data, uint16_t bytes_number)
Write and read data to/from SPI.
Definition: no_os_spi.c:159
ltc2983_remove
int ltc2983_remove(struct ltc2983_desc *)
Remove resources allocated by the init function.
Definition: ltc2983.c:130
LTC2983_THERMOCOUPLE_K
@ LTC2983_THERMOCOUPLE_K
Definition: ltc2983.h:172
LTC2983_RES_VALID_MASK
#define LTC2983_RES_VALID_MASK
Definition: ltc2983.h:94
LTC2983_DIODE_CFG
#define LTC2983_DIODE_CFG(x)
Definition: ltc2983.h:132
no_os_spi.h
Header file of SPI Interface.
LTC2983_DATA_SIGN_BIT
#define LTC2983_DATA_SIGN_BIT
Definition: ltc2983.h:95
LTC2983_THERMISTOR_44004_44033
@ LTC2983_THERMISTOR_44004_44033
Definition: ltc2983.h:189
ltc2983_init_param::filter_notch_freq
enum ltc2983_filter_notch_freq filter_notch_freq
Definition: ltc2983.h:236
LTC2983_THERMOCOUPLE_B
@ LTC2983_THERMOCOUPLE_B
Definition: ltc2983.h:178
ltc2983_thermocouple_fault_handler
int ltc2983_thermocouple_fault_handler(const uint32_t)
Fault handling of thermocouple sensors.
Definition: ltc2983.c:670
LTC2983_CHAN_RES_ADDR
#define LTC2983_CHAN_RES_ADDR(chan)
Definition: ltc2983.h:77
pr_err
#define pr_err(fmt, args...)
Definition: no_os_print_log.h:88
LTC2983_THERMISTOR_44008_44032
@ LTC2983_THERMISTOR_44008_44032
Definition: ltc2983.h:193
LTC2983_RTD_CURVE
#define LTC2983_RTD_CURVE(x)
Definition: ltc2983.h:122
no_os_delay.h
Header file of Delay functions.
ltc2983_diode::sensor
struct ltc2983_sensor sensor
Definition: ltc2983.h:352
LTC2983_CHAN_TYPE
#define LTC2983_CHAN_TYPE(x)
Definition: ltc2983.h:99
pr_info
#define pr_info(fmt, args...)
Definition: no_os_print_log.h:115
ltc2983_common_fault_handler
int ltc2983_common_fault_handler(const uint32_t result)
Fault handling of sensors other than thermocouple.
Definition: ltc2983.c:682
ltc2983_init_param::mux_delay_config_us
uint32_t mux_delay_config_us
Definition: ltc2983.h:234
ltc2983_diode
diode sensor descriptor for LTC2983
Definition: ltc2983.h:350
ltc2983_adc_assign_chan
int ltc2983_adc_assign_chan(struct ltc2983_desc *device, const struct ltc2983_sensor *sensor)
Channel assignment for direct ADC.
Definition: ltc2983.c:615
LTC2983_STATUS_UP
#define LTC2983_STATUS_UP(reg)
Definition: ltc2983.h:86
ltc2983_chan_read_scale
int ltc2983_chan_read_scale(struct ltc2983_desc *, const int, uint32_t *, uint32_t *)
Set scale of raw channel data / temperature.
Definition: ltc2983.c:406
ltc2983_reg_write
int ltc2983_reg_write(struct ltc2983_desc *device, uint16_t reg_addr, uint8_t val)
Write raw register value.
Definition: ltc2983.c:182
ltc2983_temp_assign_chan
int ltc2983_temp_assign_chan(struct ltc2983_desc *device, const struct ltc2983_sensor *sensor)
Definition: ltc2983.c:626
device
Definition: ad9361_util.h:69
LTC2983_NOTCH_FREQ_MASK
#define LTC2983_NOTCH_FREQ_MASK
Definition: ltc2983.h:92
NO_OS_GPIO_HIGH
@ NO_OS_GPIO_HIGH
Definition: no_os_gpio.h:117
LTC2983_COMMON_HARD_FAULT_MASK
#define LTC2983_COMMON_HARD_FAULT_MASK
Definition: ltc2983.h:80
no_os_print_log.h
Print messages helpers.
ltc2983_chan_read_raw
int ltc2983_chan_read_raw(struct ltc2983_desc *, const int, uint32_t *)
Read raw channel data / temperature.
Definition: ltc2983.c:354
to_adc
#define to_adc(_sensor)
Definition: ltc2983.h:219
LTC2983_THERMISTOR_YSI_400
@ LTC2983_THERMISTOR_YSI_400
Definition: ltc2983.h:194
ltc2983_desc
LTC2983 descriptor.
Definition: ltc2983.h:248
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
NO_OS_ARRAY_SIZE
#define NO_OS_ARRAY_SIZE(x)
Definition: no_os_util.h:49
ltc2983_reg_write
int ltc2983_reg_write(struct ltc2983_desc *, uint16_t, uint8_t)
Write raw register value.
Definition: ltc2983.c:182
ltc2983_rtd::sensor_config
uint32_t sensor_config
Definition: ltc2983.h:312
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.
Definition: ltc2983.c:406
ltc2983_rsense
sense resistor descriptor for LTC2983
Definition: ltc2983.h:374
ltc2983_diode_assign_chan
int ltc2983_diode_assign_chan(struct ltc2983_desc *device, const struct ltc2983_sensor *sensor)
Channel assignment for diode sensors.
Definition: ltc2983.c:574
ltc2983_sensor
common LTC2983 sensor struct
Definition: ltc2983.h:270
ID_LTC2983
@ ID_LTC2983
Definition: ltc2983.h:152
to_rsense
#define to_rsense(_sensor)
Definition: ltc2983.h:216
ltc2983_thermistor::sensor_config
uint32_t sensor_config
Definition: ltc2983.h:330
NO_OS_GPIO_LOW
@ NO_OS_GPIO_LOW
Definition: no_os_gpio.h:115
ideal_factor_value::ideal_factor_val_dec_1048576
uint32_t ideal_factor_val_dec_1048576
Definition: ltc2983.h:344
LTC2983_THERMISTOR_44007_44034
@ LTC2983_THERMISTOR_44007_44034
Definition: ltc2983.h:191
ltc2983_setup
int ltc2983_setup(struct ltc2983_desc *)
Device setup.
Definition: ltc2983.c:228
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
LTC2983_CHAN_START_ADDR
#define LTC2983_CHAN_START_ADDR(chan)
Definition: ltc2983.h:75
ltc2983_temp
analog temperature sensor descriptor for LTC2983
Definition: ltc2983.h:394
no_os_field_prep
uint32_t no_os_field_prep(uint32_t mask, uint32_t val)
ltc2983_reg_update_bits
int ltc2983_reg_update_bits(struct ltc2983_desc *, uint16_t, uint8_t, uint8_t)
Update register value.
Definition: ltc2983.c:208
LTC2983_THERMOCOUPLE_J
@ LTC2983_THERMOCOUPLE_J
Definition: ltc2983.h:171
ltc2983_rsense::r_sense_val
struct r_sense_value r_sense_val
Definition: ltc2983.h:378
LTC2983_RSENSE
@ LTC2983_RSENSE
Definition: ltc2983.h:199
LTC2983_RTD_PT_100
@ LTC2983_RTD_PT_100
Definition: ltc2983.h:182
ltc2983_init_param::sensors
struct ltc2983_sensor * sensors[20]
Definition: ltc2983.h:238
LTC2983_ACTIVE_TEMP
@ LTC2983_ACTIVE_TEMP
Definition: ltc2983.h:201
ltc2983_thermocouple::sensor
struct ltc2983_sensor sensor
Definition: ltc2983.h:294
ltc2983_rtd::sensor
struct ltc2983_sensor sensor
Definition: ltc2983.h:308
ltc2983_diode::sensor_config
uint32_t sensor_config
Definition: ltc2983.h:354
ltc2983_rtd::excitation_current
uint32_t excitation_current
Definition: ltc2983.h:316
LTC2983_RTD_NI_120
@ LTC2983_RTD_NI_120
Definition: ltc2983.h:187
no_os_put_unaligned_be32
void no_os_put_unaligned_be32(uint32_t val, uint8_t *buf)
ltc298x_id
ltc298x_id
Definition: ltc2983.h:151
LTC2983_60HZ_REJECTION
@ LTC2983_60HZ_REJECTION
Definition: ltc2983.h:162
LTC2983_THERMISTOR_SPECTRUM_1003K
@ LTC2983_THERMISTOR_SPECTRUM_1003K
Definition: ltc2983.h:195
LTC2983_THERMOCOUPLE_T
@ LTC2983_THERMOCOUPLE_T
Definition: ltc2983.h:177
ltc2983_desc::comm_desc
struct no_os_spi_desc * comm_desc
Definition: ltc2983.h:250
ltc2983_thermocouple_assign_chan
int ltc2983_thermocouple_assign_chan(struct ltc2983_desc *, const struct ltc2983_sensor *)
Channel assignment for thermocouple sensors.
Definition: ltc2983.c:490
LTC2983_THERMISTOR_CFG
#define LTC2983_THERMISTOR_CFG(x)
Definition: ltc2983.h:125
ltc2983_chan_read
int ltc2983_chan_read(struct ltc2983_desc *, const int, int *)
Read channel data / temperature.
Definition: ltc2983.c:324
ltc2983_thermistor_assign_chan
int ltc2983_thermistor_assign_chan(struct ltc2983_desc *device, const struct ltc2983_sensor *sensor)
Channel assignment for thermistor sensors.
Definition: ltc2983.c:545
ltc2983_init
int ltc2983_init(struct ltc2983_desc **, struct ltc2983_init_param *)
Device and comm init function.
Definition: ltc2983.c:55
ltc2983_thermistor::sensor
struct ltc2983_sensor sensor
Definition: ltc2983.h:326
LTC2983_MUX_CONFIG_REG
#define LTC2983_MUX_CONFIG_REG
Definition: ltc2983.h:56
to_diode
#define to_diode(_sensor)
Definition: ltc2983.h:213
ltc2983_r_sense_assign_chan
int ltc2983_r_sense_assign_chan(struct ltc2983_desc *device, const struct ltc2983_sensor *sensor)
Channel assignment for rsense.
Definition: ltc2983.c:596
LTC2983_GLOBAL_CONFIG_REG
#define LTC2983_GLOBAL_CONFIG_REG
Definition: ltc2983.h:54
LTC2983_RTD_PT_1000
@ LTC2983_RTD_PT_1000
Definition: ltc2983.h:185
ltc2983_desc::custom_addr_ptr
uint16_t custom_addr_ptr
Definition: ltc2983.h:262
LTC2983_THERMOCOUPLE_SOFT_FAULT_MASK
#define LTC2983_THERMOCOUPLE_SOFT_FAULT_MASK
Definition: ltc2983.h:114
ltc2983_rtd::custom
struct ltc2983_custom_sensor * custom
Definition: ltc2983.h:310
LTC2983_RTD_PT_200
@ LTC2983_RTD_PT_200
Definition: ltc2983.h:183
ltc2983_thermistor
thermistor sensor descriptor for LTC2983
Definition: ltc2983.h:324
ltc2983_custom_sensor::is_steinhart
bool is_steinhart
Definition: ltc2983.h:286
no_os_gpio_remove
int32_t no_os_gpio_remove(struct no_os_gpio_desc *desc)
Free the resources allocated by no_os_gpio_get().
Definition: no_os_gpio.c:104
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:171
ltc2983_setup
int ltc2983_setup(struct ltc2983_desc *device)
Device setup.
Definition: ltc2983.c:228
ltc2983_thermocouple_assign_chan
int ltc2983_thermocouple_assign_chan(struct ltc2983_desc *device, const struct ltc2983_sensor *sensor)
Channel assignment for thermocouple sensors.
Definition: ltc2983.c:490
ltc2983_desc::gpio_rstn
struct no_os_gpio_desc * gpio_rstn
Definition: ltc2983.h:252
ltc2983_thermocouple::cold_junction_chan
uint32_t cold_junction_chan
Definition: ltc2983.h:300
LTC2983_RTD_EXC_CURRENT
#define LTC2983_RTD_EXC_CURRENT(x)
Definition: ltc2983.h:119
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.
Definition: ltc2983.c:208
LTC2983_COMMON_SOFT_FAULT_MASK
#define LTC2983_COMMON_SOFT_FAULT_MASK
Definition: ltc2983.h:81
LTC2983_50_60HZ_REJECTION
@ LTC2983_50_60HZ_REJECTION
Definition: ltc2983.h:161
to_thermistor
#define to_thermistor(_sensor)
Definition: ltc2983.h:210
LTC2983_CUSTOM_ADDR
#define LTC2983_CUSTOM_ADDR(x)
Definition: ltc2983.h:108
ltc2983_temp::single_ended
bool single_ended
Definition: ltc2983.h:400
no_os_gpio_desc
Structure holding the GPIO descriptor.
Definition: no_os_gpio.h:96
LTC2983_DIODE_IDEAL_FACTOR
#define LTC2983_DIODE_IDEAL_FACTOR(x)
Definition: ltc2983.h:137
ID_LTC2986
@ ID_LTC2986
Definition: ltc2983.h:154
ltc2983_temp_assign_chan
int ltc2983_temp_assign_chan(struct ltc2983_desc *, const struct ltc2983_sensor *)
Definition: ltc2983.c:626
ideal_factor_value
LTC2983 diode ideal factor value.
Definition: ltc2983.h:340
ltc2983_adc::sensor
struct ltc2983_sensor sensor
Definition: ltc2983.h:386
ltc2983_diode::excitation_current
uint32_t excitation_current
Definition: ltc2983.h:356
ltc2983_reg_read
int ltc2983_reg_read(struct ltc2983_desc *device, uint16_t reg_addr, uint8_t *val)
Read raw register value.
Definition: ltc2983.c:156
LTC2983_RTD_CFG
#define LTC2983_RTD_CFG(x)
Definition: ltc2983.h:117
LTC2983_RTD_PT_500
@ LTC2983_RTD_PT_500
Definition: ltc2983.h:184
ltc2983_thermistor::r_sense_chan
uint32_t r_sense_chan
Definition: ltc2983.h:332
ltc2983_adc_assign_chan
int ltc2983_adc_assign_chan(struct ltc2983_desc *, const struct ltc2983_sensor *)
Channel assignment for direct ADC.
Definition: ltc2983.c:615
to_temp
#define to_temp(_sensor)
Definition: ltc2983.h:222
ltc2983_custom_sensor::table
uint32_t * table
Definition: ltc2983.h:282
LTC2983_DIODE_EXC_CURRENT
#define LTC2983_DIODE_EXC_CURRENT(x)
Definition: ltc2983.h:134
ltc2983_rtd::r_sense_chan
uint32_t r_sense_chan
Definition: ltc2983.h:314
ltc2983_temp::custom
struct ltc2983_custom_sensor * custom
Definition: ltc2983.h:398
ltc2983_thermocouple
thermocouple sensor descriptor for LTC2983
Definition: ltc2983.h:292
ltc2983_rtd
RTD sensor descriptor for LTC2983.
Definition: ltc2983.h:306
LTC2983_CHAN_ASSIGN
#define LTC2983_CHAN_ASSIGN(x)
Definition: ltc2983.h:102
LTC2983_ADC_SINGLE_ENDED
#define LTC2983_ADC_SINGLE_ENDED(x)
Definition: ltc2983.h:144
ltc2983_desc::num_channels
uint8_t num_channels
Definition: ltc2983.h:258
ltc2983_adc::single_ended
bool single_ended
Definition: ltc2983.h:388
LTC2983_THERMISTOR_EXC_CURRENT
#define LTC2983_THERMISTOR_EXC_CURRENT(x)
Definition: ltc2983.h:128
LTC2983_THERMOCOUPLE_S
@ LTC2983_THERMOCOUPLE_S
Definition: ltc2983.h:176
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
LTC2983_THERMOCOUPLE_R
@ LTC2983_THERMOCOUPLE_R
Definition: ltc2983.h:175
ltc2983_rtd_assign_chan
int ltc2983_rtd_assign_chan(struct ltc2983_desc *, const struct ltc2983_sensor *)
Channel assignment for RTD sensors.
Definition: ltc2983.c:517
ltc2983_diode_assign_chan
int ltc2983_diode_assign_chan(struct ltc2983_desc *, const struct ltc2983_sensor *)
Channel assignment for diode sensors.
Definition: ltc2983.c:574
ltc2983_init
int ltc2983_init(struct ltc2983_desc **device, struct ltc2983_init_param *init_param)
Device and comm init function.
Definition: ltc2983.c:55
ltc2983_custom_sensor
custom LTC2983 sensor struct
Definition: ltc2983.h:280
ltc2983_desc::mux_delay_config_us
uint32_t mux_delay_config_us
Definition: ltc2983.h:254
ltc2983_filter_notch_freq
ltc2983_filter_notch_freq
Notch frequency of the digital filter.
Definition: ltc2983.h:160
ltc2983_chan_read
int ltc2983_chan_read(struct ltc2983_desc *device, const int chan, int *val)
Read channel data / temperature.
Definition: ltc2983.c:324
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
ltc2983_rtd::rtd_curve
uint32_t rtd_curve
Definition: ltc2983.h:318
ltc2983_init_param::spi_init
struct no_os_spi_init_param spi_init
Definition: ltc2983.h:230
to_rtd
#define to_rtd(_sensor)
Definition: ltc2983.h:207
LTC2983_CUST_SENS_TBL_SIZE
#define LTC2983_CUST_SENS_TBL_SIZE
Definition: ltc2983.h:61
no_os_get_unaligned_be32
uint32_t no_os_get_unaligned_be32(uint8_t *buf)
no_os_gpio_set_value
int32_t no_os_gpio_set_value(struct no_os_gpio_desc *desc, uint8_t value)
Set the value of the specified GPIO.
Definition: no_os_gpio.c:197
init_param
struct ad7616_init_param init_param
Definition: ad7616_sdz.c:113
LTC2983_THERMISTOR_44006_44031
@ LTC2983_THERMISTOR_44006_44031
Definition: ltc2983.h:192
LTC2983_RTD_PT_50
@ LTC2983_RTD_PT_50
Definition: ltc2983.h:181
LTC2983_DIODE
@ LTC2983_DIODE
Definition: ltc2983.h:198
r_sense_value
LTC2983 sense resistance value.
Definition: ltc2983.h:364
ltc2983_sensor_type
ltc2983_sensor_type
LTC2983 Sensor Type.
Definition: ltc2983.h:169
LTC2983_SPI_READ_BYTE
#define LTC2983_SPI_READ_BYTE
Definition: ltc2983.h:63
ltc2983.h
LTC2983_UNASSIGNED
@ LTC2983_UNASSIGNED
Definition: ltc2983.h:170
LTC2983_THERMOCOUPLE_N
@ LTC2983_THERMOCOUPLE_N
Definition: ltc2983.h:174
LTC2983_RTD_1000
@ LTC2983_RTD_1000
Definition: ltc2983.h:186
ltc2983_reg_read
int ltc2983_reg_read(struct ltc2983_desc *, uint16_t, uint8_t *)
Read raw register value.
Definition: ltc2983.c:156
ltc2983_init_param
LTC2983 init param.
Definition: ltc2983.h:228
LTC2983_SPI_WRITE_BYTE
#define LTC2983_SPI_WRITE_BYTE
Definition: ltc2983.h:64
ltc2983_thermocouple_fault_handler
int ltc2983_thermocouple_fault_handler(const uint32_t result)
Fault handling of thermocouple sensors.
Definition: ltc2983.c:670
ltc2983_sensor::type
uint8_t type
Definition: ltc2983.h:274
ltc2983_temp::sensor
struct ltc2983_sensor sensor
Definition: ltc2983.h:396
ltc2983_sensor::chan
uint8_t chan
Definition: ltc2983.h:272
no_os_spi_remove
int32_t no_os_spi_remove(struct no_os_spi_desc *desc)
Free the resources allocated by no_os_spi_init().
Definition: no_os_spi.c:116
ltc2983_thermistor::custom
struct ltc2983_custom_sensor * custom
Definition: ltc2983.h:328
ltc2983_remove
int ltc2983_remove(struct ltc2983_desc *device)
Remove resources allocated by the init function.
Definition: ltc2983.c:130
ltc2983_adc
direct ADC descriptor for LTC2983
Definition: ltc2983.h:384
no_os_gpio.h
Header file of GPIO Interface.
ltc2983_thermocouple::sensor_config
uint32_t sensor_config
Definition: ltc2983.h:298
ltc2983_thermocouple::custom
struct ltc2983_custom_sensor * custom
Definition: ltc2983.h:296
LTC2983_THERMOCOUPLE_CUSTOM
@ LTC2983_THERMOCOUPLE_CUSTOM
Definition: ltc2983.h:179
ltc2983_custom_sensor::len
size_t len
Definition: ltc2983.h:284
ltc2983_desc::filter_notch_freq
enum ltc2983_filter_notch_freq filter_notch_freq
Definition: ltc2983.h:256
no_os_spi_init
int32_t no_os_spi_init(struct no_os_spi_desc **desc, const struct no_os_spi_init_param *param)
Initialize the SPI communication peripheral.
Definition: no_os_spi.c:52
to_thermocouple
#define to_thermocouple(_sensor)
Definition: ltc2983.h:204
no_os_util.h
Header file of utility functions.
ltc2983_init_param::dev_type
enum ltc298x_id dev_type
Definition: ltc2983.h:242
LTC2983_CUSTOM_LEN
#define LTC2983_CUSTOM_LEN(x)
Definition: ltc2983.h:105
no_os_sign_extend32
int32_t no_os_sign_extend32(uint32_t value, int index)
ltc2983_init_param::custom_addr_ptr
uint16_t custom_addr_ptr
Definition: ltc2983.h:240
LTC2983_STATUS_START
#define LTC2983_STATUS_START(x)
Definition: ltc2983.h:84
no_os_gpio_direction_output
int32_t no_os_gpio_direction_output(struct no_os_gpio_desc *desc, uint8_t value)
Enable the output direction of the specified GPIO.
Definition: no_os_gpio.c:147
ltc2983_rsense::sensor
struct ltc2983_sensor sensor
Definition: ltc2983.h:376
LTC2983_DATA_MASK
#define LTC2983_DATA_MASK
Definition: ltc2983.h:96
LTC2983_THERMISTOR_44005_44030
@ LTC2983_THERMISTOR_44005_44030
Definition: ltc2983.h:190
ltc2983_thermistor_assign_chan
int ltc2983_thermistor_assign_chan(struct ltc2983_desc *, const struct ltc2983_sensor *)
Channel assignment for thermistor sensors.
Definition: ltc2983.c:545
LTC2983_THERMOCOUPLE_CFG
#define LTC2983_THERMOCOUPLE_CFG(x)
Definition: ltc2983.h:111
ltc2983_chan_read_raw
int ltc2983_chan_read_raw(struct ltc2983_desc *device, const int chan, uint32_t *val)
Read raw channel data / temperature.
Definition: ltc2983.c:354
LTC2983_STATUS_CHAN_SEL
#define LTC2983_STATUS_CHAN_SEL(x)
Definition: ltc2983.h:89
ideal_factor_value::ideal_factor_val_int
uint32_t ideal_factor_val_int
Definition: ltc2983.h:342
errno.h
Error macro definition for ARM Compiler.
LTC2983_STATUS_REG
#define LTC2983_STATUS_REG
Definition: ltc2983.h:50
ltc2983_r_sense_assign_chan
int ltc2983_r_sense_assign_chan(struct ltc2983_desc *, const struct ltc2983_sensor *)
Channel assignment for rsense.
Definition: ltc2983.c:596
ltc2983_common_fault_handler
int ltc2983_common_fault_handler(const uint32_t)
Fault handling of sensors other than thermocouple.
Definition: ltc2983.c:682
ltc2983_thermistor::excitation_current
uint32_t excitation_current
Definition: ltc2983.h:334
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:125
LTC2983_R_SENSE_VAL
#define LTC2983_R_SENSE_VAL(x)
Definition: ltc2983.h:141
no_os_gpio_get_optional
int32_t no_os_gpio_get_optional(struct no_os_gpio_desc **desc, const struct no_os_gpio_init_param *param)
Get the value of an optional GPIO.
Definition: no_os_gpio.c:75