2025-07-11 01:08:38 +10:00
|
|
|
#include <Arduino.h>
|
|
|
|
|
#include <Wire.h>
|
|
|
|
|
|
2025-12-09 19:56:00 +01:00
|
|
|
#include "WioTrackerL1Board.h"
|
2025-07-11 01:08:38 +10:00
|
|
|
|
|
|
|
|
void WioTrackerL1Board::begin() {
|
2025-12-09 17:05:33 +01:00
|
|
|
NRF52BoardDCDC::begin();
|
2025-07-11 01:08:38 +10:00
|
|
|
btn_prev_state = HIGH;
|
|
|
|
|
|
|
|
|
|
pinMode(PIN_VBAT_READ, INPUT); // VBAT ADC input
|
|
|
|
|
// Set all button pins to INPUT_PULLUP
|
|
|
|
|
pinMode(PIN_BUTTON1, INPUT_PULLUP);
|
|
|
|
|
pinMode(PIN_BUTTON2, INPUT_PULLUP);
|
|
|
|
|
pinMode(PIN_BUTTON3, INPUT_PULLUP);
|
|
|
|
|
pinMode(PIN_BUTTON4, INPUT_PULLUP);
|
|
|
|
|
pinMode(PIN_BUTTON5, INPUT_PULLUP);
|
|
|
|
|
pinMode(PIN_BUTTON6, INPUT_PULLUP);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#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, LOW);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
delay(10); // give sx1262 some time to power up
|
|
|
|
|
}
|