Flying Silicon Sensor
pwrSupply.cpp File Reference

Manage power supply status of the device. More...

#include <Arduino.h>
#include "pwrSupply.h"
#include "pindefs.h"
#include "debug.h"

Go to the source code of this file.

Namespaces

namespace  PwrSupply
 

Macros

#define MinBattV   3.6
 Min voltage limit to protect battery.
 
#define FAST_CHARGE   1
 Enable fast charging (100mA)
 

Enumerations

enum  PwrSupply::Supply { PwrSupply::PwrUsbOnly = 0 , PwrSupply::PwrBattOnly = 1 , PwrSupply::PwrConnected = 2 , PwrSupply::PwrBattDrained = 3 }
 

Functions

int PwrSupply::isCharging (void)
 
float PwrSupply::getBatPct (void)
 
float PwrSupply::getBatVolt (void)
 
int PwrSupply::isUsbConnected (void)
 
int PwrSupply::isUsbOnly (void)
 
int PwrSupply::isBatPowered (void)
 
int PwrSupply::isBatDrained (void)
 
void PwrSupply::reset (void)
 
void PwrSupply::updateState (void)
 

Variables

static int PwrSupply::pwrStat = PwrUsbOnly
 Power supply status.
 
static float PwrSupply::batVolt = 0.0
 Battery Voltage.
 
static float PwrSupply::batPct = 0.0
 Battery charge %.
 
static int PwrSupply::charging = 0
 Charging state.
 

Detailed Description

Manage power supply status of the device.

Arduino code for Flying Silicon Airspeed/Vario Probe and TotalVario Android app.

For more information refer to: https://flyingsilicon.blogspot.com/
https://totalvario.blogspot.com/

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License http://www.gnu.org/licenses/ for more details.

Definition in file pwrSupply.cpp.

Macro Definition Documentation

◆ FAST_CHARGE

#define FAST_CHARGE   1

Enable fast charging (100mA)

Definition at line 33 of file pwrSupply.cpp.

◆ MinBattV

#define MinBattV   3.6

Min voltage limit to protect battery.

Definition at line 30 of file pwrSupply.cpp.