2025-08-10 10:34:47 -07:00
|
|
|
#ifdef XIAO_NRF52
|
|
|
|
|
|
|
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <Wire.h>
|
|
|
|
|
|
2025-12-09 19:56:00 +01:00
|
|
|
#include "IkokaStickNRFBoard.h"
|
2025-08-10 10:34:47 -07:00
|
|
|
|
2025-09-07 21:29:10 -07:00
|
|
|
void IkokaStickNRFBoard::begin() {
|
2025-12-09 15:00:08 +01:00
|
|
|
NRF52Board::begin();
|
2025-08-10 10:34:47 -07:00
|
|
|
|
|
|
|
|
pinMode(PIN_VBAT, INPUT);
|
|
|
|
|
pinMode(VBAT_ENABLE, OUTPUT);
|
|
|
|
|
digitalWrite(VBAT_ENABLE, HIGH);
|
|
|
|
|
|
|
|
|
|
#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
|