This commit is contained in:
commit
2bf49aaeab
5 files changed
+14
-8
No files matched your search
@@ -20,6 +20,7 @@ Adafruit_NeoPixel *Led[] =
|
||||
|
||||
void TechoCardBoard::begin() {
|
||||
NRF52BoardDCDC::begin();
|
||||
gps_rf_power.begin(); // LNA stays off until the GPS is started
|
||||
Wire.begin();
|
||||
|
||||
for (uint8_t i = 0; i < sizeof(Led) / sizeof(Led[0]); i++)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <MeshCore.h>
|
||||
#include <Arduino.h>
|
||||
#include <helpers/NRF52Board.h>
|
||||
#include <helpers/RefCountedDigitalPin.h>
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
|
||||
// built-ins
|
||||
@@ -17,7 +18,9 @@
|
||||
class TechoCardBoard : public NRF52BoardDCDC {
|
||||
bool _torchStatus = false;
|
||||
public:
|
||||
TechoCardBoard() : NRF52Board("TECHO_OTA") {}
|
||||
RefCountedDigitalPin gps_rf_power; // GPS antenna LNA, claimed while the GPS is running
|
||||
|
||||
TechoCardBoard() : NRF52Board("TECHO_OTA"), gps_rf_power(PIN_GPS_RF_EN, HIGH) {}
|
||||
void begin();
|
||||
uint16_t getBattMilliVolts() override;
|
||||
void onBeforeTransmit(void) override;
|
||||
|
||||
@@ -13,7 +13,8 @@ VolatileRTCClock fallback_clock;
|
||||
AutoDiscoverRTCClock rtc_clock(fallback_clock);
|
||||
|
||||
#ifdef ENV_INCLUDE_GPS
|
||||
NmeaGpsDriver gps_driver(Serial1);
|
||||
// GPS_RF_EN (antenna LNA) is claimed while the GPS runs and released when it stops
|
||||
NmeaGpsDriver gps_driver(Serial1, PIN_GPS_TX, PIN_GPS_RX, GPS_RESET, GPS_EN, &board.gps_rf_power);
|
||||
MicroNMEALocationProvider nmea(gps_driver, &rtc_clock);
|
||||
EnvironmentSensorManager sensors = EnvironmentSensorManager(nmea);
|
||||
#else
|
||||
|
||||
@@ -34,9 +34,9 @@ void initVariant() {
|
||||
pinMode(SPEAKER_EN_2, OUTPUT);
|
||||
digitalWrite(SPEAKER_EN_2, LOW);
|
||||
|
||||
// gps
|
||||
pinMode(PIN_GPS_STANDBY, OUTPUT);
|
||||
digitalWrite(PIN_GPS_STANDBY, HIGH);
|
||||
// gps - PIN_GPS_RF_EN (LNA) is switched by TechoCardBoard::gps_rf_power
|
||||
pinMode(PIN_GPS_RF_EN, OUTPUT);
|
||||
digitalWrite(PIN_GPS_RF_EN, LOW);
|
||||
pinMode(PIN_GPS_EN, OUTPUT);
|
||||
digitalWrite(PIN_GPS_EN, HIGH);
|
||||
pinMode(PIN_GPS_RESET, OUTPUT);
|
||||
|
||||
@@ -113,15 +113,16 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// GPS
|
||||
|
||||
// NOTE: these pins are defined differently to how lilygo does them but they
|
||||
// seem to work properly for how EnvironmentSensorManager operates.
|
||||
// NOTE: these pins are named differently to how lilygo does them but they
|
||||
// work properly for how EnvironmentSensorManager operates. LilyGo's own
|
||||
// examples switch the GPS on/off by driving GPS_WAKE_UP and GPS_RF_EN together.
|
||||
// TODO: MAYBE? migrate to board based sensor manager / add GPS_WAKE_UP to ESM
|
||||
|
||||
#define PIN_GPS_RX (21) // GPS_UART_RX in lilygo pin defs
|
||||
#define PIN_GPS_TX (19) // GPS_UART_TX in lilygo pin defs
|
||||
#define PIN_GPS_EN (25) // GPS_WAKE_UP in lilygo pin defs
|
||||
#define PIN_GPS_RESET (47) // GPS_EN in lilygo pin defs
|
||||
#define PIN_GPS_STANDBY (29) // GPS_RF_EN in lilygo pin defs
|
||||
#define PIN_GPS_RF_EN (29) // GPS_RF_EN in lilygo pin defs (antenna LNA), follows GPS on/off
|
||||
#define PIN_GPS_PPS (23) // GPS_1PPS in lilygo pin defs
|
||||
|
||||
// buzzer - enabled in platformio.ini so it can be easily turned off if not wanted.
|
||||
|
||||
Reference in new issue
Block a user