2025-04-11 14:51:10 +02:00
|
|
|
#ifdef XIAO_NRF52
|
|
|
|
|
|
2025-04-07 18:14:39 +02:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <Wire.h>
|
2025-09-15 14:46:10 +02:00
|
|
|
|
|
|
|
|
#include "XiaoNrf52Board.h"
|
2025-04-07 18:14:39 +02:00
|
|
|
|
|
|
|
|
void XiaoNrf52Board::begin() {
|
2025-12-09 17:05:33 +01:00
|
|
|
NRF52BoardDCDC::begin();
|
2025-04-07 18:14:39 +02:00
|
|
|
|
|
|
|
|
pinMode(PIN_VBAT, INPUT);
|
|
|
|
|
pinMode(VBAT_ENABLE, OUTPUT);
|
|
|
|
|
digitalWrite(VBAT_ENABLE, HIGH);
|
|
|
|
|
|
2025-11-19 17:25:05 +01:00
|
|
|
#ifdef PIN_USER_BTN
|
2025-12-05 12:39:37 +01:00
|
|
|
pinMode(PIN_USER_BTN, INPUT_PULLUP);
|
2025-11-19 17:25:05 +01:00
|
|
|
#endif
|
|
|
|
|
|
2025-04-07 18:14:39 +02:00
|
|
|
#if defined(PIN_WIRE_SDA) && defined(PIN_WIRE_SCL)
|
|
|
|
|
Wire.setPins(PIN_WIRE_SDA, PIN_WIRE_SCL);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
Wire.begin();
|
|
|
|
|
|
|
|
|
|
#ifdef P_LORA_TX_LED
|
|
|
|
|
pinMode(P_LORA_TX_LED, OUTPUT);
|
|
|
|
|
digitalWrite(P_LORA_TX_LED, HIGH);
|
|
|
|
|
#endif
|
|
|
|
|
|
2025-09-15 14:46:10 +02:00
|
|
|
// pinMode(SX126X_POWER_EN, OUTPUT);
|
|
|
|
|
// digitalWrite(SX126X_POWER_EN, HIGH);
|
|
|
|
|
delay(10); // give sx1262 some time to power up
|
2025-04-07 18:14:39 +02:00
|
|
|
}
|
|
|
|
|
|
2025-04-11 14:51:10 +02:00
|
|
|
#endif
|