From 35b13847e62e6e9b33d9f058079c2ebc2a03d09a Mon Sep 17 00:00:00 2001 From: Nasimovy Date: Sun, 16 Mar 2025 14:37:20 +0100 Subject: [PATCH] fixed the address --- src/configuration.h | 2 +- src/detect/ScanI2C.h | 4 ++-- src/detect/ScanI2CTwoWire.cpp | 6 +++--- src/input/TCA8418Keyboard.h | 4 ++-- src/input/cardKbI2cImpl.cpp | 2 +- src/input/kbI2cBase.cpp | 8 ++++---- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/configuration.h b/src/configuration.h index c5d9419e8..325e74f3c 100644 --- a/src/configuration.h +++ b/src/configuration.h @@ -115,7 +115,6 @@ along with this program. If not, see . #define TDECK_KB_ADDR 0x55 #define BBQ10_KB_ADDR 0x1F #define MPR121_KB_ADDR 0x5A -#define TCA8418_KB_ADDR 0x34 // ----------------------------------------------------------------------------- // SENSOR @@ -153,6 +152,7 @@ along with this program. If not, see . #define MLX90614_ADDR_DEF 0x5A #define CGRADSENS_ADDR 0x66 #define LTR390UV_ADDR 0x53 +#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 //same adress as TCA8418 // ----------------------------------------------------------------------------- // ACCELEROMETER diff --git a/src/detect/ScanI2C.h b/src/detect/ScanI2C.h index 7a4c173e1..3a031dfd8 100644 --- a/src/detect/ScanI2C.h +++ b/src/detect/ScanI2C.h @@ -17,8 +17,8 @@ class ScanI2C CARDKB, TDECKKB, BBQ10KB, - RAK14004, - PMU_AXP192_AXP2101, + RAK14004, + PMU_AXP192_AXP2101, // has the same address as the TCA8418KB BME_680, BME_280, BMP_280, diff --git a/src/detect/ScanI2CTwoWire.cpp b/src/detect/ScanI2CTwoWire.cpp index 7c71e7bf4..50c01f86a 100644 --- a/src/detect/ScanI2CTwoWire.cpp +++ b/src/detect/ScanI2CTwoWire.cpp @@ -11,9 +11,9 @@ #endif // AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp -#ifndef XPOWERS_AXP192_AXP2101_ADDRESS -#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 -#endif +//#ifndef XPOWERS_AXP192_AXP2101_ADDRESS +//#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 +//#endif bool in_array(uint8_t *array, int size, uint8_t lookfor) { diff --git a/src/input/TCA8418Keyboard.h b/src/input/TCA8418Keyboard.h index a8eebf113..cbf30d402 100644 --- a/src/input/TCA8418Keyboard.h +++ b/src/input/TCA8418Keyboard.h @@ -30,8 +30,8 @@ class TCA8418Keyboard TCA8418Keyboard(); - void begin(uint8_t addr = TCA8418_KB_ADDR, TwoWire *wire = &Wire); - void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = TCA8418_KB_ADDR); + void begin(uint8_t addr = XPOWERS_AXP192_AXP2101_ADDRESS, TwoWire *wire = &Wire); + void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = XPOWERS_AXP192_AXP2101_ADDRESS); void reset(void); // Configure the size of the keypad. diff --git a/src/input/cardKbI2cImpl.cpp b/src/input/cardKbI2cImpl.cpp index 1793999d5..0d661811b 100644 --- a/src/input/cardKbI2cImpl.cpp +++ b/src/input/cardKbI2cImpl.cpp @@ -12,7 +12,7 @@ void CardKbI2cImpl::init() #if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(I2C_NO_RESCAN) if (cardkb_found.address == 0x00) { LOG_DEBUG("Rescan for I2C keyboard"); - uint8_t i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR, MPR121_KB_ADDR, TCA8418_KB_ADDR}; + uint8_t i2caddr_scan[] = {CARDKB_ADDR, TDECK_KB_ADDR, BBQ10_KB_ADDR, MPR121_KB_ADDR, XPOWERS_AXP192_AXP2101_ADDRESS}; uint8_t i2caddr_asize = 5; auto i2cScanner = std::unique_ptr(new ScanI2CTwoWire()); diff --git a/src/input/kbI2cBase.cpp b/src/input/kbI2cBase.cpp index 0e968b956..7c8234fa0 100644 --- a/src/input/kbI2cBase.cpp +++ b/src/input/kbI2cBase.cpp @@ -43,8 +43,8 @@ int32_t KbI2cBase::runOnce() if (cardkb_found.address == MPR121_KB_ADDR) { MPRkeyboard.begin(MPR121_KB_ADDR, &Wire1); } - if (cardkb_found.address == TCA8418_KB_ADDR) { - TCAKeyboard.begin(TCA8418_KB_ADDR, &Wire1); + if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) { + TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire1); } break; #endif @@ -58,8 +58,8 @@ int32_t KbI2cBase::runOnce() if (cardkb_found.address == MPR121_KB_ADDR) { MPRkeyboard.begin(MPR121_KB_ADDR, &Wire); } - if (cardkb_found.address == TCA8418_KB_ADDR) { - TCAKeyboard.begin(TCA8418_KB_ADDR, &Wire); + if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) { + TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire); } break; case ScanI2C::NO_I2C: