Browse Source

Implement initial power management functions.

Next up, we need to test it to see how long it'll last on a battery.
master
Starbeamrainbowlabs 3 years ago
parent
commit
79adeef737
  1. 19
      iot/main/power.cpp
  2. 15
      iot/main/power.h
  3. 6
      iot/main/settings.h

19
iot/main/power.cpp

@ -0,0 +1,19 @@ @@ -0,0 +1,19 @@
#include <Arduino.h>
#include "settings.h"
void power_gps_wakeup() {
Serial.println("Warn: GPS wakeup isn't implemented yet.");
}
void power_gps_standby() {
Serial.println("Warn: GPS standby isn't implemented yet.");
}
void power_off() {
power_gps_standby();
pinMode(PIN_TPL_DONE, OUTPUT);
digitalWrite(PIN_TPL_DONE, HIGH);
}

15
iot/main/power.h

@ -0,0 +1,15 @@ @@ -0,0 +1,15 @@
/**
* Wakes the GPS module up from standby.
*/
void power_gps_wakeup();
/**
* Puts the GPS module into standby.
*/
void power_gps_standby();
/**
* Signals that our work is complete and that we can turn off now to the
* TPL5111.
*/
void power_off();

6
iot/main/settings.h

@ -5,10 +5,12 @@ @@ -5,10 +5,12 @@
//////////////////////////////////
// The speed at which we should talk over our main hardware serial connection.
#define BAUD_PC 115200
#define BAUD_PC 115200
// Multiple devices can use the same SPI data pin AFAIKT, but some libraries *cough* SD *cough* are too stupid to figure out which pin it is on their own.
#define PIN_SPI_DATA 9
#define PIN_SPI_DATA 9
#define PIN_TPL_DONE 8
/////////////////////////////////
////////////// GPS //////////////

Loading…
Cancel
Save