Thanks a lot for this library! Help me solve the problem with the difference between datasheet and library.
Library:
//! Chip Address
#define AXP202_SLAVE_ADDRESS (0x35U)
#define AXP192_SLAVE_ADDRESS (0x34U)
#define AXP173_SLAVE_ADDRESS (0x34U)
//! Chip ID
#define AXP202_CHIP_ID (0x41)
#define AXP192_CHIP_ID (0x03)
#define AXP173_CHIP_ID (0xAD) //!Axp173 does not have a chip ID, given a custom ID
But datasheet fro X-powers official site talk about 0x68 and 0x69 AXP202 Address. Its mean (0x34 << 1) for write access. For AXP192 datasheet talk about 0x68 address too.
Than i try using (0x34 << 1 | READ_BIT) for read registers, and it`s work fine. Why lib using 0x35 address?
After that I tried to read Chip ID (03H address in library) and check datasheet for 03H register description. And datasheet not contain 03h register. And any other libs for AXP202 for Linux or ESP or STM32 not contain 0x03 register in defines
int AXP20X_Class::_axp_probe(void)
{
uint8_t data;
if (_isAxp173) {
//!Axp173 does not have a chip ID, read the status register to see if it reads normally
_readByte(0x01, 1, &data);
if (data == 0 || data == 0xFF) {
return AXP_FAIL;
}
_chip_id = AXP173_CHIP_ID;
_readByte(AXP202_LDO234_DC23_CTL, 1, &_outputReg);
AXP_DEBUG("OUTPUT Register 0x%x\n", _outputReg);
_init = true;
return AXP_PASS;
}
_readByte(AXP202_IC_TYPE, 1, &_chip_id);
AXP_DEBUG("chip id detect 0x%x\n", _chip_id);
if (_chip_id == AXP202_CHIP_ID || _chip_id == AXP192_CHIP_ID) {
AXP_DEBUG("Detect CHIP :%s\n", _chip_id == AXP202_CHIP_ID ? "AXP202" : "AXP192");
_readByte(AXP202_LDO234_DC23_CTL, 1, &_outputReg);
AXP_DEBUG("OUTPUT Register 0x%x\n", _outputReg);
_init = true;
return AXP_PASS;
}
return AXP_FAIL;
}
AXP202_IC_TYPE -> 0x03
AXP202_CHIP_ID -> 0x41
Where i can find info about 0x03 register in lib and its address. The official datasheet has a difference with this
Thank you!
The information about the chip ID is not disclosed. I did not know it from the manual, but from the staff of x-power. The device address is customized and cannot be changed from the hardware.
Thanks a lot for this library! Help me solve the problem with the difference between datasheet and library.
Library:
But datasheet fro X-powers official site talk about 0x68 and 0x69 AXP202 Address. Its mean (0x34 << 1) for write access. For AXP192 datasheet talk about 0x68 address too.
Than i try using (0x34 << 1 | READ_BIT) for read registers, and it`s work fine. Why lib using 0x35 address?
After that I tried to read Chip ID (03H address in library) and check datasheet for 03H register description. And datasheet not contain 03h register. And any other libs for AXP202 for Linux or ESP or STM32 not contain 0x03 register in defines
AXP202_IC_TYPE -> 0x03 AXP202_CHIP_ID -> 0x41
Where i can find info about 0x03 register in lib and its address. The official datasheet has a difference with this Thank you!