From e26d1a356708b3702c91a86ff37f3c5c615941c9 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Thu, 27 Dec 2018 19:11:46 -0500 Subject: i2ccmds: Pass the i2c address as a 7-bit number (0-127) The sam3 i2c code and the linux code use a 7-bit i2c address, while the avr, lpc176x, and samd21 i2c code uses an 8-bit address with the least significant bit always zero. A similar issue occurred in the host code (sx1509.py and replicape.py use 7-bit addresses while uc1701.py and mcp4451.py use 8-bit addresses). Consistently use 7-bit addresses in all the code. This breaks compatibility between host and mcu software, so make a change to the config_i2c command to force users to synchronize software updates. This also breaks common Smoothieboard configs, so update the mcp4451 code to validate the i2c_address. Signed-off-by: Kevin O'Connor --- config/generic-smoothieboard.cfg | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'config') diff --git a/config/generic-smoothieboard.cfg b/config/generic-smoothieboard.cfg index 6d635352..742d5442 100644 --- a/config/generic-smoothieboard.cfg +++ b/config/generic-smoothieboard.cfg @@ -90,7 +90,7 @@ max_z_accel: 100 pins: P1.18, P1.19, P1.20, P1.21, P4.28 [mcp4451 stepper_digipot1] -i2c_address: 88 +i2c_address: 44 # Scale the config so that wiper values can be specified in amps. scale: 2.25 # wiper 0 is X (aka alpha), 1 is Y, 2 is Z, 3 is E0 @@ -100,7 +100,7 @@ wiper_2: 1.0 wiper_3: 1.0 [mcp4451 stepper_digipot2] -i2c_address: 90 +i2c_address: 45 scale: 2.25 # wiper 0 is E1 wiper_0: 1.0 -- cgit v1.2.3-70-g09d2