BatteryInterface.h 503 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef BatteryInterface_h
  2. #define BatteryInterface_h
  3. #include <Arduino.h>
  4. #include "configs.h"
  5. #ifndef MARAUDER_FLIPPER
  6. #include <Wire.h>
  7. #endif
  8. #define I2C_SDA 33
  9. #define I2C_SCL 22
  10. #define IP5306_ADDR 0x75
  11. class BatteryInterface {
  12. private:
  13. uint32_t initTime = 0;
  14. public:
  15. int8_t battery_level = 0;
  16. int8_t old_level = 0;
  17. bool i2c_supported = false;
  18. BatteryInterface();
  19. void RunSetup();
  20. void main(uint32_t currentTime);
  21. int8_t getBatteryLevel();
  22. };
  23. #endif