diff options
author | Timofey Titovets <nefelim4ag@gmail.com> | 2024-09-10 21:03:06 +0200 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2024-09-22 19:23:14 -0400 |
commit | 71433b8224ca73f8897d3338defeecf7118c5ab3 (patch) | |
tree | b598abb980f0ef561a243a7850ed37f9462668ab | |
parent | 87ac69363aecd51c282999f8bf0f5c3513f58ed2 (diff) | |
download | kutter-71433b8224ca73f8897d3338defeecf7118c5ab3.tar.gz kutter-71433b8224ca73f8897d3338defeecf7118c5ab3.tar.xz kutter-71433b8224ca73f8897d3338defeecf7118c5ab3.zip |
sx1509: drop i2c_modify_bits
According to the datasheet default value is 0000 0000
We do not modify them in other places.
Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
-rw-r--r-- | klippy/extras/sx1509.py | 12 |
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" % ( |