add st7789

This commit is contained in:
Terrence
2024-11-06 10:06:05 +08:00
parent 3575448373
commit 20deb2b777
13 changed files with 250 additions and 28 deletions

View File

@@ -191,6 +191,7 @@ public:
virtual bool GetBatteryVoltage(int &voltage, bool& charging) override {
ESP_ERROR_CHECK(adc_oneshot_get_calibrated_result(adc1_handle_, adc1_cali_handle_, ADC_CHANNEL_0, &voltage));
voltage *= 3;
charging = gpio_get_level(GPIO_NUM_2) == 0;
ESP_LOGI(TAG, "Battery voltage: %d, Charging: %d", voltage, charging);
return true;