| 14 | namespace dev { |
| 15 | |
| 16 | void M5StackCore2::init(void) |
| 17 | { |
| 18 | Wire.begin(TOUCH_SDA, TOUCH_SCL, (uint32_t)I2C_TOUCH_FREQUENCY); |
| 19 | Axp.begin(); |
| 20 | |
| 21 | Axp.SetCHGCurrent(AXP192::kCHG_100mA); |
| 22 | Axp.SetLcdVoltage(2800); |
| 23 | _backlight_power = true; |
| 24 | |
| 25 | Axp.SetBusPowerMode(0); |
| 26 | Axp.SetCHGCurrent(AXP192::kCHG_190mA); |
| 27 | |
| 28 | Axp.SetLDOEnable(3, true); |
| 29 | // CoverScrollText("Motor Test", M5.Lcd.color565(SUCCE_COLOR)); |
| 30 | delay(150); |
| 31 | Axp.SetLDOEnable(3, false); |
| 32 | |
| 33 | Axp.SetLed(1); |
| 34 | // CoverScrollText("LED Test", M5.Lcd.color565(SUCCE_COLOR)); |
| 35 | delay(100); |
| 36 | Axp.SetLed(0); |
| 37 | |
| 38 | // FastLED.addLeds<SK6812, LEDS_PIN>(ledsBuff, LEDS_NUM); |
| 39 | // for(int i = 0; i < LEDS_NUM; i++) { |
| 40 | // ledsBuff[i].setRGB(20, 20, 20); |
| 41 | // } |
| 42 | // FastLED.show(); |
| 43 | |
| 44 | Axp.SetLDOVoltage(3, 3300); |
| 45 | Axp.SetLed(1); |
| 46 | } |
| 47 | |
| 48 | void M5StackCore2::set_backlight_level(uint8_t level) |
| 49 | { |