Added V2 feature

This commit is contained in:
lewisxhe
2020-10-12 09:23:59 +08:00
parent 44bacde1ae
commit d2aebf2d03
3 changed files with 22 additions and 15 deletions

View File

@@ -137,10 +137,6 @@
#elif defined(LILYGO_WATCH_2020_V2)
#include "board/twatch2020_v2.h"
#if defined(BOARD_HAS_PSRAM)
#error "The version you choose is Twatch 2020 V2, this version is not configured with PSRAM, please select Disable in the PSRAM enable tab in Arduino IDE"
#endif
// Has
#define LILYGO_WATCH_HAS_TOUCH
#define LILYGO_WATCH_HAS_DISPLAY
@@ -152,15 +148,14 @@
#define LILYGO_WATCH_HAS_IRREMOTE
#define LILYGO_WATCH_HAS_BACKLIGHT
#define LILYGO_WATCH_HAS_GPS
#define LILYGO_WATCH_HAS_SDCARD
// Hardware not support
#undef LILYGO_WATCH_HAS_NFC
#undef LILYGO_WATCH_HAS_GPRS
// #undef LILYGO_WATCH_HAS_GPS
#undef LILYGO_WATCH_HAS_LORA
#undef LILYGO_WATCH_HAS_MPU6050
#undef LILYGO_WATCH_HAS_MAX301XX
#undef LILYGO_WATCH_HAS_SDCARD
#undef LILYGO_WATCH_HAS_BUTTON
#undef LILYGO_WATCH_HAS_MPR121
#undef LILYGO_WATCH_HAS_BBQ_KEYBOARD

View File

@@ -282,7 +282,7 @@ public:
x = _x;
y = _y;
}
#elif defined(LILYGO_WATCH_2020_V1)
#elif defined(LILYGO_WATCH_2020_V1) || defined(LILYGO_WATCH_2020_V2)
uint8_t rotation = tft->getRotation();
switch (rotation) {
case 0:
@@ -986,7 +986,7 @@ private:
return false;
}
// T-Watch 2020 and 2019 use different mapping axes
#if defined(LILYGO_WATCH_2020_V1)
#if defined(LILYGO_WATCH_2020_V1) || defined(LILYGO_WATCH_2020_V2)
remap_data.x_axis = 0;
remap_data.x_axis_sign = 1;
remap_data.y_axis = 1;
@@ -1056,7 +1056,7 @@ private:
tft->initDMA(); // To use SPI DMA you must call initDMA() to setup the DMA engine
#endif
#ifdef LILYGO_WATCH_2020_V1
#if defined(LILYGO_WATCH_2020_V1) || defined(LILYGO_WATCH_2020_V2)
// Set default initial orientation
tft->setRotation(2);
#endif /*LILYGO_WATCH_2020_V1*/
@@ -1169,16 +1169,23 @@ private:
power->setPowerOutPut(AXP202_LDO4, false);
power->setLDO4Voltage(AXP202_LDO4_3300MV);
power->setPowerOutPut(AXP202_LDO3, false);
power->setLDO3Voltage(AXP202_LDO3, 3300);
//Adding a hardware reset can reduce the current consumption of the capacitive touch
//Adding a hardware reset can reduce the current consumption of the capacitive touch
power->setPowerOutPut(AXP202_EXTEN, true);
delay(20);
power->setPowerOutPut(AXP202_EXTEN, false);
delay(20);
power->setPowerOutPut(AXP202_EXTEN, true);
/*
In 2020V2, LDO3 is allocated to the display and touch screen power.
When ESP32 is set to sleep or other situations where power consumption needs to be saved,
LDO3 can be turned off
*/
power->setPowerOutPut(AXP202_LDO3, false);
power->setLDO3Voltage(3300);
power->setPowerOutPut(AXP202_LDO3, true);
#endif /*LILYGO_WATCH_2020_V2*/
}
#endif /*LILYGO_WATCH_HAS_AXP202*/

View File

@@ -19,7 +19,7 @@
#define SEN_SDA 21
#define SEN_SCL 22
#define RTC_INT_PIN 37
#define RTC_INT_PIN 37
#define AXP202_INT 35
#define BMA423_INT1 39
@@ -30,4 +30,9 @@
#define GPS_RX 25
#define GPS_TX 26
#define GPS_WAKE 33
#define GPS_BAUD_RATE 9600
#define GPS_BAUD_RATE 9600
#define SD_CS 13
#define SD_MISO 2
#define SD_MOSI 15
#define SD_SCLK 14