From 4e3ee845b9ebb8c742481e93bdba906f1f68ccb1 Mon Sep 17 00:00:00 2001 From: Bob-the-Kuhn Date: Wed, 11 Oct 2017 15:42:24 -0500 Subject: [PATCH] config_adv (#7941) get rid of twi.h move to board files --- Marlin/Configuration_adv.h | 14 ++++++++++++++ Marlin/src/HAL/utility/twi.h | 4 ---- Marlin/src/config/default/Configuration_adv.h | 14 ++++++++++++++ .../examples/AlephObjects/TAZ4/Configuration_adv.h | 14 ++++++++++++++ .../config/examples/Anet/A6/Configuration_adv.h | 14 ++++++++++++++ .../config/examples/Anet/A8/Configuration_adv.h | 14 ++++++++++++++ .../examples/BQ/Hephestos/Configuration_adv.h | 14 ++++++++++++++ .../examples/BQ/Hephestos_2/Configuration_adv.h | 14 ++++++++++++++ .../config/examples/BQ/WITBOX/Configuration_adv.h | 14 ++++++++++++++ .../config/examples/Cartesio/Configuration_adv.h | 14 ++++++++++++++ .../examples/Creality/CR-10/Configuration_adv.h | 14 ++++++++++++++ .../src/config/examples/Felix/Configuration_adv.h | 14 ++++++++++++++ .../Folger Tech/i3-2020/Configuration_adv.h | 14 ++++++++++++++ .../examples/Infitary/i3-M508/Configuration_adv.h | 14 ++++++++++++++ .../examples/Malyan/M150/Configuration_adv.h | 14 ++++++++++++++ .../config/examples/RigidBot/Configuration_adv.h | 14 ++++++++++++++ .../src/config/examples/SCARA/Configuration_adv.h | 14 ++++++++++++++ .../examples/Sanguinololu/Configuration_adv.h | 14 ++++++++++++++ .../config/examples/TinyBoy2/Configuration_adv.h | 14 ++++++++++++++ .../examples/Velleman/K8200/Configuration_adv.h | 14 ++++++++++++++ .../examples/Velleman/K8400/Configuration_adv.h | 14 ++++++++++++++ .../delta/FLSUN/auto_calibrate/Configuration_adv.h | 14 ++++++++++++++ .../delta/FLSUN/kossel_mini/Configuration_adv.h | 14 ++++++++++++++ .../examples/delta/generic/Configuration_adv.h | 14 ++++++++++++++ .../examples/delta/kossel_mini/Configuration_adv.h | 14 ++++++++++++++ .../examples/delta/kossel_pro/Configuration_adv.h | 14 ++++++++++++++ .../examples/delta/kossel_xl/Configuration_adv.h | 14 ++++++++++++++ .../examples/gCreate/gMax1.5+/Configuration_adv.h | 14 ++++++++++++++ .../config/examples/makibox/Configuration_adv.h | 14 ++++++++++++++ .../examples/tvrrug/Round2/Configuration_adv.h | 14 ++++++++++++++ .../src/config/examples/wt150/Configuration_adv.h | 14 ++++++++++++++ Marlin/src/feature/digipot/digipot_mcp4018.cpp | 4 +--- Marlin/src/feature/digipot/digipot_mcp4451.cpp | 3 +-- Marlin/src/pins/pins_5DPRINT.h | 3 +++ Marlin/src/pins/pins_AZTEEG_X3_PRO.h | 4 ++++ Marlin/src/pins/pins_MIGHTYBOARD_REVE.h | 1 + 36 files changed, 430 insertions(+), 9 deletions(-) delete mode 100644 Marlin/src/HAL/utility/twi.h diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h index 22b512b017..4629224949 100644 --- a/Marlin/Configuration_adv.h +++ b/Marlin/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/HAL/utility/twi.h b/Marlin/src/HAL/utility/twi.h deleted file mode 100644 index b80776ac40..0000000000 --- a/Marlin/src/HAL/utility/twi.h +++ /dev/null @@ -1,4 +0,0 @@ -// Modified for use with the mcp4451 digipot routine -#if defined(TARGET_LPC1768) - -#endif diff --git a/Marlin/src/config/default/Configuration_adv.h b/Marlin/src/config/default/Configuration_adv.h index 22b512b017..4629224949 100644 --- a/Marlin/src/config/default/Configuration_adv.h +++ b/Marlin/src/config/default/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h index 4503615078..c13082b085 100644 --- a/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h +++ b/Marlin/src/config/examples/AlephObjects/TAZ4/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h index bc128c6868..f0cc32b929 100644 --- a/Marlin/src/config/examples/Anet/A6/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A6/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h index a60739525d..a3bdae8198 100644 --- a/Marlin/src/config/examples/Anet/A8/Configuration_adv.h +++ b/Marlin/src/config/examples/Anet/A8/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h index b3e5f80f50..b0afce3ecd 100644 --- a/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h index b877648e03..3e3479ed7e 100644 --- a/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/Hephestos_2/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h index b3e5f80f50..b0afce3ecd 100644 --- a/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h +++ b/Marlin/src/config/examples/BQ/WITBOX/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Cartesio/Configuration_adv.h b/Marlin/src/config/examples/Cartesio/Configuration_adv.h index bbc44b1656..9348e57dd1 100644 --- a/Marlin/src/config/examples/Cartesio/Configuration_adv.h +++ b/Marlin/src/config/examples/Cartesio/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h index 46ae41f09d..f1f82a3296 100644 --- a/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h +++ b/Marlin/src/config/examples/Creality/CR-10/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Felix/Configuration_adv.h b/Marlin/src/config/examples/Felix/Configuration_adv.h index 3da24b10bf..93ddd2aba3 100644 --- a/Marlin/src/config/examples/Felix/Configuration_adv.h +++ b/Marlin/src/config/examples/Felix/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h index 0f553b1e78..7e635eadf0 100644 --- a/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h +++ b/Marlin/src/config/examples/Folger Tech/i3-2020/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h index e5820e0f7d..aa0b535291 100644 --- a/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h +++ b/Marlin/src/config/examples/Infitary/i3-M508/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h index da4b9cdd47..56be301bd9 100644 --- a/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h +++ b/Marlin/src/config/examples/Malyan/M150/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/RigidBot/Configuration_adv.h b/Marlin/src/config/examples/RigidBot/Configuration_adv.h index f44de466b6..999a159014 100644 --- a/Marlin/src/config/examples/RigidBot/Configuration_adv.h +++ b/Marlin/src/config/examples/RigidBot/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/SCARA/Configuration_adv.h b/Marlin/src/config/examples/SCARA/Configuration_adv.h index cc76b99c9d..787eb0b7e6 100644 --- a/Marlin/src/config/examples/SCARA/Configuration_adv.h +++ b/Marlin/src/config/examples/SCARA/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h index f5d9458465..5c750f4d51 100644 --- a/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h +++ b/Marlin/src/config/examples/Sanguinololu/Configuration_adv.h @@ -425,6 +425,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h index 4b0e666986..0dcd3e436d 100644 --- a/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h +++ b/Marlin/src/config/examples/TinyBoy2/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h index 1ddab4dbd1..28f7f76b0c 100644 --- a/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8200/Configuration_adv.h @@ -449,6 +449,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h index 4a209b4434..e24bd36c5c 100644 --- a/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h +++ b/Marlin/src/config/examples/Velleman/K8400/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h index 27c9c35888..aaf54049eb 100644 --- a/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/auto_calibrate/Configuration_adv.h @@ -438,6 +438,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h index ab1186d6aa..0506b2d67a 100644 --- a/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/FLSUN/kossel_mini/Configuration_adv.h @@ -438,6 +438,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/delta/generic/Configuration_adv.h b/Marlin/src/config/examples/delta/generic/Configuration_adv.h index ab1186d6aa..0506b2d67a 100644 --- a/Marlin/src/config/examples/delta/generic/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/generic/Configuration_adv.h @@ -438,6 +438,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h index ab1186d6aa..0506b2d67a 100644 --- a/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_mini/Configuration_adv.h @@ -438,6 +438,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h index 0747baa632..97770eb3f7 100644 --- a/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_pro/Configuration_adv.h @@ -443,6 +443,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h index a9f954d17e..dad3190adf 100644 --- a/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h +++ b/Marlin/src/config/examples/delta/kossel_xl/Configuration_adv.h @@ -438,6 +438,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h index ddb07fe012..0f377bec48 100644 --- a/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h +++ b/Marlin/src/config/examples/gCreate/gMax1.5+/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/makibox/Configuration_adv.h b/Marlin/src/config/examples/makibox/Configuration_adv.h index cfb9725968..a6edb67e50 100644 --- a/Marlin/src/config/examples/makibox/Configuration_adv.h +++ b/Marlin/src/config/examples/makibox/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 4 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h index b1eba00052..798f84a4f5 100644 --- a/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h +++ b/Marlin/src/config/examples/tvrrug/Round2/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro //#define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT + #define DIGIPOT_I2C_ADDRESS_B 0x2D // unshifted slave address for second DIGIPOT +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + //#define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 8 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/config/examples/wt150/Configuration_adv.h b/Marlin/src/config/examples/wt150/Configuration_adv.h index dad34c39d8..b04b59276e 100644 --- a/Marlin/src/config/examples/wt150/Configuration_adv.h +++ b/Marlin/src/config/examples/wt150/Configuration_adv.h @@ -436,6 +436,20 @@ // Uncomment to enable an I2C based DIGIPOT like on the Azteeg X3 Pro #define DIGIPOT_I2C + +#if (defined(DIGIPOT_I2C) && !defined(DIGIPOT_I2C_ADDRESS_A)) //default to settings in pins_XXXX.h files + #define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address for DIGIPOT (5E <- 2F << 1) +// #define DIGIPOT_I2C_ADDRESS_B 0x2D // one DIGIPOT on this board +#endif +/** + * common slave addresses + * + * board A (A shifted) B (B shifted) IC + * Smoothie 0x2C (0x58) 0x2D (0x5A) MCP4451 + * AZTEEG_X3_PRO 0x2C (0x58) 0x2E (0x5C) MCP4451 + * MIGHTYBOARD_REVE 0x2F (0x5E) MCP4018 + */ + #define DIGIPOT_MCP4018 // Requires library from https://github.com/stawel/SlowSoftI2CMaster #define DIGIPOT_I2C_NUM_CHANNELS 5 // 5DPRINT: 4 AZTEEG_X3_PRO: 8 // Actual motor currents in Amps, need as many here as DIGIPOT_I2C_NUM_CHANNELS diff --git a/Marlin/src/feature/digipot/digipot_mcp4018.cpp b/Marlin/src/feature/digipot/digipot_mcp4018.cpp index 95295f1330..5ae24188fd 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4018.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4018.cpp @@ -31,8 +31,6 @@ // Settings for the I2C based DIGIPOT (MCP4018) based on WT150 -#define DIGIPOT_I2C_ADDRESS 0x2F - #define DIGIPOT_A4988_Rsx 0.250 #define DIGIPOT_A4988_Vrefmax 1.666 #define DIGIPOT_A4988_MAX_VALUE 127 @@ -81,7 +79,7 @@ static SlowSoftI2CMaster pots[DIGIPOT_I2C_NUM_CHANNELS] = { static void i2c_send(const uint8_t channel, const byte v) { if (WITHIN(channel, 0, DIGIPOT_I2C_NUM_CHANNELS - 1)) { - pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS) << 1) | I2C_WRITE); + pots[channel].i2c_start(((DIGIPOT_I2C_ADDRESS_A) << 1) | I2C_WRITE); pots[channel].i2c_write(v); pots[channel].i2c_stop(); } diff --git a/Marlin/src/feature/digipot/digipot_mcp4451.cpp b/Marlin/src/feature/digipot/digipot_mcp4451.cpp index 0034050d82..de479a7cd4 100644 --- a/Marlin/src/feature/digipot/digipot_mcp4451.cpp +++ b/Marlin/src/feature/digipot/digipot_mcp4451.cpp @@ -25,7 +25,6 @@ #if ENABLED(DIGIPOT_I2C) && DISABLED(DIGIPOT_MCP4018) #include "Stream.h" -#include "utility/twi.h" #include // Settings for the I2C based DIGIPOT (MCP4451) on Azteeg X3 Pro @@ -52,7 +51,7 @@ static void i2c_send(const byte addr, const byte a, const byte b) { void digipot_i2c_set_current(const uint8_t channel, const float current) { // these addresses are specific to Azteeg X3 Pro, can be set to others, // In this case first digipot is at address A0=0, A1= 0, second one is at A0=0, A1= 1 - const byte addr = channel < 4 ? 0x2C : 0x2E; // channel 0-3 vs 4-7 + const byte addr = channel < 4 ? DIGIPOT_I2C_ADDRESS_A : DIGIPOT_I2C_ADDRESS_B; // channel 0-3 vs 4-7 // Initial setup i2c_send(addr, 0x40, 0xFF); diff --git a/Marlin/src/pins/pins_5DPRINT.h b/Marlin/src/pins/pins_5DPRINT.h index cb0dbb23fa..26bf139816 100755 --- a/Marlin/src/pins/pins_5DPRINT.h +++ b/Marlin/src/pins/pins_5DPRINT.h @@ -140,3 +140,6 @@ // Misc. Functions // #define SDSS 20 // B0 + +//DIGIPOTS slave addresses +#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for DIGIPOT 0x2C (0x58 <- 0x2C << 1) diff --git a/Marlin/src/pins/pins_AZTEEG_X3_PRO.h b/Marlin/src/pins/pins_AZTEEG_X3_PRO.h index f44beb5128..61810d98e9 100644 --- a/Marlin/src/pins/pins_AZTEEG_X3_PRO.h +++ b/Marlin/src/pins/pins_AZTEEG_X3_PRO.h @@ -41,6 +41,10 @@ #error "Oops! Make sure you have 'Arduino Mega 2560' selected from the 'Tools -> Boards' menu." #endif +//DIGIPOT slave addresses +#define DIGIPOT_I2C_ADDRESS_A 0x2C // unshifted slave address for first DIGIPOT 0x2C (0x58 <- 0x2C << 1) +#define DIGIPOT_I2C_ADDRESS_B 0x2E // unshifted slave address for second DIGIPOT 0x2E (0x5C <- 0x2E << 1) + // // Servos // diff --git a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h b/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h index 5b5d6e7ed1..21b75130af 100644 --- a/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h +++ b/Marlin/src/pins/pins_MIGHTYBOARD_REVE.h @@ -121,6 +121,7 @@ #define DIGIPOTS_I2C_SDA_Z 65 // K3 #define DIGIPOTS_I2C_SDA_E0 27 // A5 #define DIGIPOTS_I2C_SDA_E1 77 // J6 +#define DIGIPOT_I2C_ADDRESS_A 0x2F // unshifted slave address (5E <- 2F << 1) // // Temperature Sensors