Merge branch 'dev' into nrf-dcdc

This commit is contained in:
fdlamotte
2026-01-27 08:42:58 -04:00
committed by GitHub
92 changed files with 3339 additions and 393 deletions

View File

@@ -7,6 +7,11 @@
#ifdef XIAO_NRF52
class XiaoNrf52Board : public NRF52BoardDCDC {
protected:
#if NRF52_POWER_MANAGEMENT
void initiateShutdown(uint8_t reason) override;
#endif
public:
XiaoNrf52Board() : NRF52Board("XIAO_NRF52_OTA") {}
void begin();
@@ -20,21 +25,7 @@ public:
}
#endif
uint16_t getBattMilliVolts() override {
// Please read befor going further ;)
// https://wiki.seeedstudio.com/XIAO_BLE#q3-what-are-the-considerations-when-using-xiao-nrf52840-sense-for-battery-charging
// We can't drive VBAT_ENABLE to HIGH as long
// as we don't know wether we are charging or not ...
// this is a 3mA loss (4/1500)
digitalWrite(VBAT_ENABLE, LOW);
int adcvalue = 0;
analogReadResolution(12);
analogReference(AR_INTERNAL_3_0);
delay(10);
adcvalue = analogRead(PIN_VBAT);
return (adcvalue * ADC_MULTIPLIER * AREF_VOLTAGE) / 4.096;
}
uint16_t getBattMilliVolts() override;
const char* getManufacturerName() const override {
return "Seeed Xiao-nrf52";