Deduplicate DC/DC regulator enable for NRF52 boards

Some NRF52 boards are able to use the internal power-efficient DC/DC
regulator. Add a new class that can be inherited by board classes to
enable this feature and reduce the power consumption.

Signed-off-by: Frieder Schrempf <frieder@fris.de>
Šī revīzija ir iekļauta:
Frieder Schrempf
2025-12-17 10:29:14 +01:00
vecāks 93d1560d14
revīzija e3bb225efb
12 mainīti faili ar 40 papildinājumiem un 56 dzēšanām
+1 -10
Parādīt failu
@@ -21,16 +21,7 @@ static void disconnect_callback(uint16_t conn_handle, uint8_t reason) {
}
void XiaoNrf52Board::begin() {
NRF52Board::begin();
// Enable DC/DC converter for improved power efficiency
uint8_t sd_enabled = 0;
sd_softdevice_is_enabled(&sd_enabled);
if (sd_enabled) {
sd_power_dcdc_mode_set(NRF_POWER_DCDC_ENABLE);
} else {
NRF_POWER->DCDCEN = 1;
}
NRF52BoardDCDC::begin();
pinMode(PIN_VBAT, INPUT);
pinMode(VBAT_ENABLE, OUTPUT);
+1 -1
Parādīt failu
@@ -6,7 +6,7 @@
#ifdef XIAO_NRF52
class XiaoNrf52Board : public NRF52Board {
class XiaoNrf52Board : public NRF52BoardDCDC {
public:
void begin();