m5core2 uses DC-DC3 to control brightness rather than using LDO2. DC-DC3 is controlled by the 7 least significant bits in the 0x27 register; the most significant bit is reserved. As a result the brightness value shifts left 3 places rather than 4. in order to set the register I read the entire byte, logical AND with 0x80 to clear all bits except the reserved bit, logical OR with the shifted brightness value.
added brightness to the sample m5core2 config
Fixes errors including:
src/esphome/components/axp192/axp192.cpp: In member function 'void esphome::axp192::AXP192Component::DeepSleep(uint64_t)':
src/esphome/components/axp192/axp192.cpp:355:35: error: 'gpio_num_t' was not declared in this scope
esp_sleep_enable_ext0_wakeup((gpio_num_t)37, LOW);
^
src/esphome/components/axp192/axp192.cpp:355:50: error: 'LOW' was not declared in this scope
esp_sleep_enable_ext0_wakeup((gpio_num_t)37, LOW);
^