Numworks Epsilon
1.4.1
Graphing Calculator Operating System
battery.h
Go to the documentation of this file.
1
#ifndef ION_DEVICE_BATTERY_H
2
#define ION_DEVICE_BATTERY_H
3
4
#include "
regs/regs.h
"
5
6
namespace
Ion
{
7
namespace
Battery {
8
namespace
Device {
9
10
/* Pin | Role | Mode | Function
11
* -----+-------------------+-----------------------+----------
12
* PA0 | BAT_CHRG | Input, pulled up | Low = charging, high = full
13
* PA1 | VBAT_SNS | Analog | ADC1_1
14
*/
15
16
void
init
();
17
void
shutdown
();
18
void
initGPIO
();
19
void
initADC
();
20
21
constexpr
GPIO
ChargingGPIO
=
GPIOA
;
22
constexpr
uint8_t
ChargingPin
= 0;
23
24
constexpr
GPIO
ADCGPIO
=
GPIOA
;
25
constexpr
uint8_t
ADCPin
= 1;
26
constexpr
uint8_t
ADCChannel
= 1;
27
28
constexpr
float
ADCReferenceVoltage
= 2.8f;
29
constexpr
float
ADCDividerBridgeRatio
= 2.0f;
30
31
}
32
}
33
}
34
35
#endif
GPIO
Definition:
gpio.h:6
Ion::Battery::Device::ADCDividerBridgeRatio
constexpr float ADCDividerBridgeRatio
Definition:
battery.h:29
Ion::Battery::Device::ChargingPin
constexpr uint8_t ChargingPin
Definition:
battery.h:22
uint8_t
unsigned char uint8_t
Definition:
stdint.h:4
Ion::Battery::Device::ADCPin
constexpr uint8_t ADCPin
Definition:
battery.h:25
Ion::Battery::Device::ChargingGPIO
constexpr GPIO ChargingGPIO
Definition:
battery.h:21
Ion::Battery::Device::shutdown
void shutdown()
Definition:
battery.cpp:77
Ion::Battery::Device::ADCReferenceVoltage
constexpr float ADCReferenceVoltage
Definition:
battery.h:28
Ion::Battery::Device::initGPIO
void initGPIO()
Definition:
battery.cpp:67
Ion::Battery::Device::ADCGPIO
constexpr GPIO ADCGPIO
Definition:
battery.h:24
Ion::Battery::Device::init
void init()
Definition:
battery.cpp:50
Ion::Battery::Device::initADC
void initADC()
Ion::Battery::Device::ADCChannel
constexpr uint8_t ADCChannel
Definition:
battery.h:26
regs.h
GPIOA
constexpr GPIO GPIOA(0)
Ion
Definition:
backlight.h:6
epsilon
ion
src
device
battery.h
Generated by
1.8.14