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
Definition: gpio.h:6
constexpr float ADCDividerBridgeRatio
Definition: battery.h:29
constexpr uint8_t ChargingPin
Definition: battery.h:22
unsigned char uint8_t
Definition: stdint.h:4
constexpr uint8_t ADCPin
Definition: battery.h:25
constexpr GPIO ChargingGPIO
Definition: battery.h:21
constexpr float ADCReferenceVoltage
Definition: battery.h:28
constexpr GPIO ADCGPIO
Definition: battery.h:24
constexpr uint8_t ADCChannel
Definition: battery.h:26
constexpr GPIO GPIOA(0)
Definition: backlight.h:6