aboutsummaryrefslogtreecommitdiffstats
path: root/klippy/extras/sx1509.py
diff options
context:
space:
mode:
Diffstat (limited to 'klippy/extras/sx1509.py')
-rw-r--r--klippy/extras/sx1509.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/klippy/extras/sx1509.py b/klippy/extras/sx1509.py
index 3bfecb78..070b9133 100644
--- a/klippy/extras/sx1509.py
+++ b/klippy/extras/sx1509.py
@@ -38,19 +38,17 @@ class SX1509(object):
REG_INPUT_DISABLE : 0, REG_ANALOG_DRIVER_ENABLE : 0}
self.reg_i_on_dict = {reg : 0 for reg in REG_I_ON}
def _build_config(self):
- # Reset the chip
+ # Reset the chip, Default RegClock/RegMisc 0x0
self._mcu.add_config_cmd("i2c_write oid=%d data=%02x%02x" % (
self._oid, REG_RESET, 0x12))
self._mcu.add_config_cmd("i2c_write oid=%d data=%02x%02x" % (
self._oid, REG_RESET, 0x34))
# Enable Oscillator
- self._mcu.add_config_cmd("i2c_modify_bits oid=%d reg=%02x"
- " clear_set_bits=%02x%02x" % (
- self._oid, REG_CLOCK, 0, (1 << 6)))
+ self._mcu.add_config_cmd("i2c_write oid=%d data=%02x%02x" % (
+ self._oid, REG_CLOCK, (1 << 6)))
# Setup Clock Divider
- self._mcu.add_config_cmd("i2c_modify_bits oid=%d reg=%02x"
- " clear_set_bits=%02x%02x" % (
- self._oid, REG_MISC, 0, (1 << 4)))
+ self._mcu.add_config_cmd("i2c_write oid=%d data=%02x%02x" % (
+ self._oid, REG_MISC, (1 << 4)))
# Transfer all regs with their initial cached state
for _reg, _data in self.reg_dict.items():
self._mcu.add_config_cmd("i2c_write oid=%d data=%02x%04x" % (