Implement initial power management functions.

Next up, we need to test it to see how long it'll last on a battery.
This commit is contained in:
Starbeamrainbowlabs 2019-06-20 12:23:09 +01:00
parent 6a0b3b8a48
commit 79adeef737
3 changed files with 38 additions and 2 deletions

19
iot/main/power.cpp Normal file
View file

@ -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 Normal file
View file

@ -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();

View file

@ -10,6 +10,8 @@
// 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_TPL_DONE 8
/////////////////////////////////
////////////// GPS //////////////
/////////////////////////////////