MCPcopy Create free account
hub / github.com/HASwitchPlate/openHASP / init

Method init

src/dev/esp32/m5stackcore2.cpp:16–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14namespace dev {
15
16void 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
48void M5StackCore2::set_backlight_level(uint8_t level)
49{

Callers

nothing calls this directly

Calls 1

beginMethod · 0.45

Tested by

no test coverage detected