From 354b1e666b92d1b51bf19b3d834848d6ce1639df Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Mon, 14 Jul 2025 12:58:38 -0400 Subject: [PATCH] pca9632: Remove custom software i2c - use normal mcu software i2c instead Signed-off-by: Kevin O'Connor --- docs/Config_Changes.md | 4 ++++ docs/Config_Reference.md | 5 ----- klippy/extras/pca9632.py | 7 ++----- test/klippy/led.cfg | 4 ++-- 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/docs/Config_Changes.md b/docs/Config_Changes.md index 87bcc9716..001791929 100644 --- a/docs/Config_Changes.md +++ b/docs/Config_Changes.md @@ -8,6 +8,10 @@ All dates in this document are approximate. ## Changes +20250721: The `[pca9632]` module no longer accepts the `scl_pin` and +`sda_pin` options. Use `i2c_software_scl_pin` and +`i2c_software_sda_pin` instead. + 20250428: The maximum `cycle_time` for pwm `[output_pin]`, `[pwm_cycle_time]`, `[pwm_tool]`, and similar config sections is now 3 seconds (reduced from 5 seconds). The `maximum_mcu_duration` in diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index d9125d47b..bc99bd94b 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -3477,11 +3477,6 @@ PCA9632 LED support. The PCA9632 is used on the FlashForge Dreamer. #i2c_speed: # See the "common I2C settings" section for a description of the # above parameters. -#scl_pin: -#sda_pin: -# Alternatively, if the pca9632 is not connected to a hardware I2C -# bus, then one may specify the "clock" (scl_pin) and "data" -# (sda_pin) pins. The default is to use hardware I2C. #color_order: RGBW # Set the pixel order of the LED (using a string containing the # letters R, G, B, W). The default is RGBW. diff --git a/klippy/extras/pca9632.py b/klippy/extras/pca9632.py index 8a3551cf2..b8a813c33 100644 --- a/klippy/extras/pca9632.py +++ b/klippy/extras/pca9632.py @@ -3,7 +3,7 @@ # Copyright (C) 2022 Ricardo Alcantara # # This file may be distributed under the terms of the GNU GPLv3 license. -from . import bus, led, mcp4018 +from . import bus, led BACKGROUND_PRIORITY_CLOCK = 0x7fffffff00000000 @@ -25,10 +25,7 @@ PCA9632_LED3 = 0x06 class PCA9632: def __init__(self, config): self.printer = printer = config.get_printer() - if config.get("scl_pin", None) is not None: - self.i2c = mcp4018.SoftwareI2C(config, 98) - else: - self.i2c = bus.MCU_I2C_from_config(config, default_addr=98) + self.i2c = bus.MCU_I2C_from_config(config, default_addr=98) color_order = config.get("color_order", "RGBW") if sorted(color_order) != sorted("RGBW"): raise config.error("Invalid color_order '%s'" % (color_order,)) diff --git a/test/klippy/led.cfg b/test/klippy/led.cfg index d134490fa..c7f685d76 100644 --- a/test/klippy/led.cfg +++ b/test/klippy/led.cfg @@ -25,8 +25,8 @@ initial_GREEN: 0.2 initial_BLUE: 0.3 [pca9632 p6led] -scl_pin: PB1 -sda_pin: PB2 +i2c_software_scl_pin: PB1 +i2c_software_sda_pin: PB2 initial_RED: 0.4 initial_GREEN: 0.5 initial_BLUE: 0.6