mirror of
https://github.com/HASwitchPlate/openHASP.git
synced 2025-07-28 13:46:36 +00:00
Add M5Stack core2
This commit is contained in:
parent
398d90c89d
commit
a4fc3a84a4
@ -1,7 +1,49 @@
|
|||||||
#include "hasp_drv_display.h"
|
#include "hasp_drv_display.h"
|
||||||
|
|
||||||
|
#if defined(M5STACK)
|
||||||
|
#include "AXP192.h" // Power Mgmt
|
||||||
|
|
||||||
|
AXP192 Axp;
|
||||||
|
|
||||||
|
void m5stack_init()
|
||||||
|
{
|
||||||
|
AXP192 Axp;
|
||||||
|
Wire.begin(TOUCH_SDA, TOUCH_SCL);
|
||||||
|
Axp.begin();
|
||||||
|
|
||||||
|
Axp.SetCHGCurrent(AXP192::kCHG_100mA);
|
||||||
|
Axp.SetLcdVoltage(3300);
|
||||||
|
|
||||||
|
Axp.SetBusPowerMode(0);
|
||||||
|
Axp.SetCHGCurrent(AXP192::kCHG_190mA);
|
||||||
|
|
||||||
|
// Axp.SetLDOEnable(3, true);
|
||||||
|
// CoverScrollText("Motor Test", M5.Lcd.color565(SUCCE_COLOR));
|
||||||
|
// delay(150);
|
||||||
|
// Axp.SetLDOEnable(3, false);
|
||||||
|
|
||||||
|
Axp.SetLed(1);
|
||||||
|
// CoverScrollText("LED Test", M5.Lcd.color565(SUCCE_COLOR));
|
||||||
|
delay(100);
|
||||||
|
Axp.SetLed(0);
|
||||||
|
|
||||||
|
// FastLED.addLeds<SK6812, LEDS_PIN>(ledsBuff, LEDS_NUM);
|
||||||
|
// for(int i = 0; i < LEDS_NUM; i++) {
|
||||||
|
// ledsBuff[i].setRGB(20, 20, 20);
|
||||||
|
// }
|
||||||
|
// FastLED.show();
|
||||||
|
|
||||||
|
Axp.SetLDOVoltage(3, 3300);
|
||||||
|
// Axp.SetLed(1);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void drv_display_init(uint8_t rotation)
|
void drv_display_init(uint8_t rotation)
|
||||||
{
|
{
|
||||||
|
#if defined(M5STACK)
|
||||||
|
m5stack_init(); // Set LCD power first
|
||||||
|
#endif
|
||||||
|
|
||||||
/* TFT init */
|
/* TFT init */
|
||||||
#if defined(USE_FSMC)
|
#if defined(USE_FSMC)
|
||||||
fsmc_ili9341_init(rotation);
|
fsmc_ili9341_init(rotation);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user