32#define LM75_PARAM_I2C I2C_DEV(0)
38#ifndef CONFIG_LM75_I2C_ADDR
39#define CONFIG_LM75_I2C_ADDR (0x48)
43#if IS_ACTIVE(CONFIG_NORMAL_MODE)
44#define CONFIG_OPERATION_MODE NORMAL_MODE
45#elif IS_ACTIVE(CONFIG_SHUTDOWN_MODE)
46#define CONFIG_OPERATION_MODE SHUTDOWN_MODE
49#ifndef CONFIG_OPERATION_MODE
50#define CONFIG_OPERATION_MODE NORMAL_MODE
55#if IS_ACTIVE(CONFIG_COMPARATOR_MODE)
56#define CONFIG_THERMOSTAT_MODE COMPARATOR_MODE
57#elif IS_ACTIVE(CONFIG_INTERRUPT_MODE)
58#define CONFIG_THERMOSTAT_MODE INTERRUPT_MODE
61#ifndef CONFIG_THERMOSTAT_MODE
62#define CONFIG_THERMOSTAT_MODE COMPARATOR_MODE
67#if IS_ACTIVE(CONFIG_OS_ACTIVE_LOW)
68#define CONFIG_OS_POLARITY OS_ACTIVE_LOW
69#elif IS_ACTIVE(CONFIG_OS_ACTIVE_HIGH)
70#define CONFIG_OS_POLARITY OS_ACTIVE_HIGH
73#ifndef CONFIG_OS_POLARITY
74#define CONFIG_OS_POLARITY OS_ACTIVE_LOW
80#if IS_ACTIVE(CONFIG_FAULT_1)
81#define CONFIG_FAULT_QUEUE FAULT_1
82#elif IS_ACTIVE(CONFIG_FAULT_2)
83#define CONFIG_FAULT_QUEUE FAULT_2
84#elif (IS_ACTIVE(CONFIG_FAULT_3) && IS_USED(MODULE_TMP1075))
85#define CONFIG_FAULT_QUEUE FAULT_3
86#elif (IS_ACTIVE(CONFIG_FAULT_4) && IS_USED(MODULE_LM75A))
87#define CONFIG_FAULT_QUEUE FAULT_4
88#elif (IS_ACTIVE(CONFIG_FAULT_4) && IS_USED(MODULE_TMP1075))
89#define CONFIG_FAULT_QUEUE FAULT_4_TMP1075
90#elif (IS_ACTIVE(CONFIG_FAULT_6) && IS_USED(MODULE_LM75A))
91#define CONFIG_FAULT_QUEUE FAULT_6
94#ifndef CONFIG_FAULT_QUEUE
95#define CONFIG_FAULT_QUEUE FAULT_1
100#define LM75_PARAM_INT GPIO_UNDEF
103#define LM75A_CONV_RATE (100)
105#define LM75A_OS_RES (5)
106#define LM75A_OS_MULT (10)
107#define LM75A_OS_SHIFT (7)
108#define LM75A_TEMP_RES (125)
109#define LM75A_TEMP_MULT (1000)
110#define LM75A_TEMP_SHIFT (5)
112#define TMP1075_OS_RES (625)
113#define TMP1075_OS_MULT (10000)
114#define TMP1075_OS_SHIFT (4)
115#define TMP1075_TEMP_RES (625)
116#define TMP1075_TEMP_MULT (10000)
117#define TMP1075_TEMP_SHIFT (4)
120#if IS_ACTIVE(CONFIG_TMP1075_CONV_RATE_REG_27H)
121#define CONFIG_TMP1075_CONV_RATE_REG TMP1075_CONV_RATE_REG_27H
122#define TMP1075_CONV_RATE (28)
123#elif IS_ACTIVE(CONFIG_TMP1075_CONV_RATE_REG_55)
124#define CONFIG_TMP1075_CONV_RATE_REG TMP1075_CONV_RATE_REG_55
125#define TMP1075_CONV_RATE (55)
126#elif IS_ACTIVE(CONFIG_TMP1075_CONV_RATE_REG_110)
127#define CONFIG_TMP1075_CONV_RATE_REG TMP1075_CONV_RATE_REG_110
128#define TMP1075_CONV_RATE (110)
129#elif IS_ACTIVE(CONFIG_TMP1075_CONV_RATE_REG_220)
130#define CONFIG_TMP1075_CONV_RATE_REG TMP1075_CONV_RATE_REG_220
131#define TMP1075_CONV_RATE (220)
134#ifndef CONFIG_TMP1075_CONV_RATE_REG
135#define CONFIG_TMP1075_CONV_RATE_REG TMP1075_CONV_RATE_REG_27H
136#define TMP1075_CONV_RATE (28)
141#if IS_USED(MODULE_LM75A)
142#define LM75_PARAMS { .res = &lm75a_properties, \
143 .gpio_alarm = LM75_PARAM_INT, \
144 .conv_rate = LM75A_CONV_RATE, \
145 .i2c_bus = LM75_PARAM_I2C, \
146 .i2c_addr = CONFIG_LM75_I2C_ADDR, \
147 .shutdown_mode = CONFIG_OPERATION_MODE, \
148 .tm_mode = CONFIG_THERMOSTAT_MODE, \
149 .polarity = CONFIG_OS_POLARITY, \
150 .fault_q = CONFIG_FAULT_QUEUE }
154#if IS_USED(MODULE_TMP1075)
155#define LM75_PARAMS { .res = &tmp1075_properties, \
156 .gpio_alarm = LM75_PARAM_INT, \
157 .conv_rate = TMP1075_CONV_RATE, \
158 .i2c_bus = LM75_PARAM_I2C, \
159 .i2c_addr = CONFIG_LM75_I2C_ADDR, \
160 .shutdown_mode = CONFIG_OPERATION_MODE, \
161 .tm_mode = CONFIG_THERMOSTAT_MODE, \
162 .polarity = CONFIG_OS_POLARITY, \
163 .fault_q = CONFIG_FAULT_QUEUE, \
164 .conv_rate_reg = CONFIG_TMP1075_CONV_RATE_REG }
Common macros and compiler attributes/pragmas configuration.
Driver for the LM75 temperature sensor.
Registers for the lm75 and derived (lm75a and tmp1075) temperature sensors.
params required for initialization