Skip to content

Commit ed61040

Browse files
naNEQfabiobaltieri
authored andcommitted
drivers: sensor: mcp9600: fix wrong register address
The address of most of the registers defined in the driver are wrong. This fixes it, following the correct numbering as can be found in the device's datasheet. Moreover, re-grouping of the macros according to their functionality. Signed-off-by: Nikos Agianniotis <[email protected]>
1 parent a3e5af9 commit ed61040

File tree

1 file changed

+17
-16
lines changed

1 file changed

+17
-16
lines changed

drivers/sensor/mcp9600/mcp9600.c

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,22 +25,23 @@ LOG_MODULE_REGISTER(MCP9600, CONFIG_SENSOR_LOG_LEVEL);
2525

2626
#define MCP9600_REG_TC_CONFIG 0x05
2727
#define MCP9600_REG_DEV_CONFIG 0x06
28-
#define MCP9600_REG_A1_CONFIG 0x07
29-
30-
#define MCP9600_REG_A2_CONFIG 0x08
31-
#define MCP9600_REG_A3_CONFIG 0x09
32-
#define MCP9600_REG_A4_CONFIG 0x0A
33-
#define MCP9600_A1_HYST 0x0B
34-
35-
#define MCP9600_A2_HYST 0x0C
36-
#define MCP9600_A3_HYST 0x0D
37-
#define MCP9600_A4_HYST 0x0E
38-
#define MCP9600_A1_LIMIT 0x0F
39-
40-
#define MCP9600_A2_LIMIT 0x10
41-
#define MCP9600_A3_LIMIT 0x11
42-
#define MCP9600_A4_LIMIT 0x12
43-
#define MCP9600_REG_ID_REVISION 0x13
28+
29+
#define MCP9600_REG_A1_CONFIG 0x08
30+
#define MCP9600_REG_A2_CONFIG 0x09
31+
#define MCP9600_REG_A3_CONFIG 0x0A
32+
#define MCP9600_REG_A4_CONFIG 0x0B
33+
34+
#define MCP9600_A1_HYST 0x0C
35+
#define MCP9600_A2_HYST 0x0D
36+
#define MCP9600_A3_HYST 0x0E
37+
#define MCP9600_A4_HYST 0x0F
38+
39+
#define MCP9600_A1_LIMIT 0x10
40+
#define MCP9600_A2_LIMIT 0x11
41+
#define MCP9600_A3_LIMIT 0x12
42+
#define MCP9600_A4_LIMIT 0x13
43+
44+
#define MCP9600_REG_ID_REVISION 0x20
4445

4546
struct mcp9600_data {
4647
int32_t temp;

0 commit comments

Comments
 (0)