ESP32-PaxCounter/include/power.h

24 lines
530 B
C
Raw Normal View History

2019-09-07 19:52:25 +02:00
#ifndef _POWER_H
#define _POWER_H
#include <Arduino.h>
2019-09-07 23:10:53 +02:00
#include <driver/adc.h>
#include <esp_adc_cal.h>
2019-09-07 19:52:25 +02:00
#include "i2cscan.h"
2019-09-07 23:10:53 +02:00
#define DEFAULT_VREF 1100 // tbd: use adc2_vref_to_gpio() for better estimate
#define NO_OF_SAMPLES 64 // we do some multisampling to get better values
2019-09-07 19:52:25 +02:00
#ifdef HAS_PMU
#include <axp20x.h>
void pover_event_IRQ(void);
void AXP192_power(bool on);
2019-09-07 19:52:25 +02:00
#endif
void AXP192_init(void);
void AXP192_displaypower(void);
2019-09-07 23:10:53 +02:00
uint16_t read_voltage(void);
void calibrate_voltage(void);
uint8_t getBattLevel(void);
2019-09-07 19:52:25 +02:00
#endif