fixed the address

This commit is contained in:
Nasimovy 2025-03-16 14:37:20 +01:00
parent 6e8d965385
commit 35b13847e6
6 changed files with 13 additions and 13 deletions

View File

@ -115,7 +115,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define TDECK_KB_ADDR 0x55 #define TDECK_KB_ADDR 0x55
#define BBQ10_KB_ADDR 0x1F #define BBQ10_KB_ADDR 0x1F
#define MPR121_KB_ADDR 0x5A #define MPR121_KB_ADDR 0x5A
#define TCA8418_KB_ADDR 0x34
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// SENSOR // SENSOR
@ -153,6 +152,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MLX90614_ADDR_DEF 0x5A #define MLX90614_ADDR_DEF 0x5A
#define CGRADSENS_ADDR 0x66 #define CGRADSENS_ADDR 0x66
#define LTR390UV_ADDR 0x53 #define LTR390UV_ADDR 0x53
#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 //same adress as TCA8418
// ----------------------------------------------------------------------------- // -----------------------------------------------------------------------------
// ACCELEROMETER // ACCELEROMETER

View File

@ -18,7 +18,7 @@ class ScanI2C
TDECKKB, TDECKKB,
BBQ10KB, BBQ10KB,
RAK14004, RAK14004,
PMU_AXP192_AXP2101, PMU_AXP192_AXP2101, // has the same address as the TCA8418KB
BME_680, BME_680,
BME_280, BME_280,
BMP_280, BMP_280,

View File

@ -11,9 +11,9 @@
#endif #endif
// AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp // AXP192 and AXP2101 have the same device address, we just need to identify it in Power.cpp
#ifndef XPOWERS_AXP192_AXP2101_ADDRESS //#ifndef XPOWERS_AXP192_AXP2101_ADDRESS
#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34 //#define XPOWERS_AXP192_AXP2101_ADDRESS 0x34
#endif //#endif
bool in_array(uint8_t *array, int size, uint8_t lookfor) bool in_array(uint8_t *array, int size, uint8_t lookfor)
{ {

View File

@ -30,8 +30,8 @@ class TCA8418Keyboard
TCA8418Keyboard(); TCA8418Keyboard();
void begin(uint8_t addr = TCA8418_KB_ADDR, TwoWire *wire = &Wire); 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 = TCA8418_KB_ADDR); void begin(i2c_com_fptr_t r, i2c_com_fptr_t w, uint8_t addr = XPOWERS_AXP192_AXP2101_ADDRESS);
void reset(void); void reset(void);
// Configure the size of the keypad. // Configure the size of the keypad.

View File

@ -12,7 +12,7 @@ void CardKbI2cImpl::init()
#if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(I2C_NO_RESCAN) #if !MESHTASTIC_EXCLUDE_I2C && !defined(ARCH_PORTDUINO) && !defined(I2C_NO_RESCAN)
if (cardkb_found.address == 0x00) { if (cardkb_found.address == 0x00) {
LOG_DEBUG("Rescan for I2C keyboard"); 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; uint8_t i2caddr_asize = 5;
auto i2cScanner = std::unique_ptr<ScanI2CTwoWire>(new ScanI2CTwoWire()); auto i2cScanner = std::unique_ptr<ScanI2CTwoWire>(new ScanI2CTwoWire());

View File

@ -43,8 +43,8 @@ int32_t KbI2cBase::runOnce()
if (cardkb_found.address == MPR121_KB_ADDR) { if (cardkb_found.address == MPR121_KB_ADDR) {
MPRkeyboard.begin(MPR121_KB_ADDR, &Wire1); MPRkeyboard.begin(MPR121_KB_ADDR, &Wire1);
} }
if (cardkb_found.address == TCA8418_KB_ADDR) { if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) {
TCAKeyboard.begin(TCA8418_KB_ADDR, &Wire1); TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire1);
} }
break; break;
#endif #endif
@ -58,8 +58,8 @@ int32_t KbI2cBase::runOnce()
if (cardkb_found.address == MPR121_KB_ADDR) { if (cardkb_found.address == MPR121_KB_ADDR) {
MPRkeyboard.begin(MPR121_KB_ADDR, &Wire); MPRkeyboard.begin(MPR121_KB_ADDR, &Wire);
} }
if (cardkb_found.address == TCA8418_KB_ADDR) { if (cardkb_found.address == XPOWERS_AXP192_AXP2101_ADDRESS) {
TCAKeyboard.begin(TCA8418_KB_ADDR, &Wire); TCAKeyboard.begin(XPOWERS_AXP192_AXP2101_ADDRESS, &Wire);
} }
break; break;
case ScanI2C::NO_I2C: case ScanI2C::NO_I2C: