2025-09-22 19:58:27 +08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <helpers/RefCountedDigitalPin.h>
|
|
|
|
|
#include <helpers/ESP32Board.h>
|
|
|
|
|
#include <driver/rtc_io.h>
|
2026-02-26 17:47:03 +08:00
|
|
|
#include "LoRaFEMControl.h"
|
2026-04-19 15:29:43 +02:00
|
|
|
|
|
|
|
|
#ifndef ADC_MULTIPLIER
|
|
|
|
|
#define ADC_MULTIPLIER 5.42
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-09-22 19:58:27 +08:00
|
|
|
class HeltecV4Board : public ESP32Board {
|
|
|
|
|
|
2026-04-19 15:29:43 +02:00
|
|
|
protected:
|
|
|
|
|
float adc_mult = ADC_MULTIPLIER;
|
|
|
|
|
|
2025-09-22 19:58:27 +08:00
|
|
|
public:
|
|
|
|
|
RefCountedDigitalPin periph_power;
|
2026-02-26 17:47:03 +08:00
|
|
|
LoRaFEMControl loRaFEMControl;
|
2025-09-22 19:58:27 +08:00
|
|
|
HeltecV4Board() : periph_power(PIN_VEXT_EN,PIN_VEXT_EN_ACTIVE) { }
|
|
|
|
|
|
|
|
|
|
void begin();
|
|
|
|
|
void onBeforeTransmit(void) override;
|
|
|
|
|
void onAfterTransmit(void) override;
|
|
|
|
|
void enterDeepSleep(uint32_t secs, int pin_wake_btn = -1);
|
|
|
|
|
void powerOff() override;
|
|
|
|
|
uint16_t getBattMilliVolts() override;
|
2026-04-19 15:29:43 +02:00
|
|
|
bool setAdcMultiplier(float multiplier) override {
|
|
|
|
|
if (multiplier == 0.0f) {
|
|
|
|
|
adc_mult = ADC_MULTIPLIER;
|
|
|
|
|
} else {
|
|
|
|
|
adc_mult = multiplier;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
float getAdcMultiplier() const override { return adc_mult; }
|
|
|
|
|
const char* getManufacturerName() const override;
|
2025-09-22 19:58:27 +08:00
|
|
|
};
|