stefanthoss / esphome-axp2101

ESPHome component for AXP2101
2 stars 5 forks source link

I can't control behavior and pins of AXP2101 #5

Open VBMek opened 7 months ago

VBMek commented 7 months ago

During my research on repository of martydingo with AXP192 and m5stack Core2 i noticed that some devices PWR pins and RST or EN pins are connected to AXP192 and AXP2101. Version 1.1 of Core2 has same topology everything is connected to AXP2101 (https://docs.m5stack.com/en/core/Core2%20v1.1?id=pinmap). What i wanted to do is to have ability to control those pins same way as in AXP192. I looked and comapred your code to AXP192 which is very similar, but Im not able (maybe lack of knowledge) to do it same way as in AXP192. What i found out that in AXP192 others are use something like this:

- lambda: "axp192_axp192component->set_brightness(0.5);"
- lambda: "axp192_axp192component->LDO(true);"

my failed result of using it with AXP2101 is:

  on_boot: 
    priority: 600
    then: 
      lambda: |-
        axp2101_axp2101component->AXP_VRTC(true);
<unicode string>: In lambda function:
<unicode string>:19:7: error: 'axp2101_axp2101component' was not declared in this scope

as you can see i changed axp192 in that command to axp2101 which didn't worked at all. Pins which are connected to AXP2101:

AXP_ALDO2 - ILI9342C RST
AXP_BLDO1 - ILI9342C BL
AXP_ALDO4 - ILI9342C PWR
AXP_ALDO2 - FT6336U RST
AXP_ALDO3 - NS4168 SPK_EN
AXP_VRTC - Blue LED
AXP_DLDO1 - Vibration motor
AXP_IRQ - BM8563 INT