38 lines
827 B
C++
38 lines
827 B
C++
#ifdef XIAO_NRF52
|
|
|
|
#include <Arduino.h>
|
|
#include <Wire.h>
|
|
|
|
#include "IkokaStickNRFBoard.h"
|
|
|
|
void IkokaStickNRFBoard::begin() {
|
|
NRF52BoardDCDC::begin();
|
|
|
|
pinMode(PIN_VBAT, INPUT);
|
|
// Seeed's XIAO charging guidance requires READ_BAT_ENABLE to stay LOW.
|
|
// Preload the safe latch before enabling the output; do not pulse HIGH.
|
|
digitalWrite(VBAT_ENABLE, LOW);
|
|
pinMode(VBAT_ENABLE, OUTPUT);
|
|
|
|
#ifdef PIN_USER_BTN
|
|
pinMode(PIN_USER_BTN, INPUT_PULLUP);
|
|
#endif
|
|
|
|
#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
|
|
|
|
// pinMode(SX126X_POWER_EN, OUTPUT);
|
|
// digitalWrite(SX126X_POWER_EN, HIGH);
|
|
delay(10); // give sx1262 some time to power up
|
|
}
|
|
|
|
#endif
|