Files
MeshCore-Evo/variants/wio_wm1110/WioWM1110Board.h

51 lines
1.0 KiB
C
Raw Normal View History

2025-10-20 18:49:34 +02:00
#pragma once
#include <MeshCore.h>
#include <Arduino.h>
#include <helpers/NRF52Board.h>
2025-10-20 18:49:34 +02:00
#ifdef WIO_WM1110
#ifdef Serial
#undef Serial
#endif
#define Serial Serial1
class WioWM1110Board : public NRF52BoardDCDC {
2025-10-20 18:49:34 +02:00
public:
WioWM1110Board() : NRF52Board("WM1110_OTA") {}
2025-10-20 18:49:34 +02:00
void begin();
#if defined(LED_GREEN)
void onBeforeTransmit() override {
digitalWrite(LED_RED, HIGH);
}
void onAfterTransmit() override {
digitalWrite(LED_RED, LOW);
}
#endif
uint16_t getBattMilliVolts() override {
int adcvalue = 0;
analogReadResolution(12);
analogReference(AR_INTERNAL_3_0);
delay(10);
adcvalue = analogRead(BATTERY_PIN);
return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE * 1000.0) / 4096.0;
}
const char* getManufacturerName() const override {
return "Seeed Wio WM1110";
}
void enableSensorPower(bool enable) {
digitalWrite(SENSOR_POWER_PIN, enable ? HIGH : LOW);
if (enable) {
delay(100);
}
}
};
#endif