Ken Van Hoeylandt c87200a80d
Project restructuring (fixes macOS builds) (#198)
- Create `Include/` folder for all main projects
- Fix some issues here and there (found while moving things)
- All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
2025-02-01 18:13:20 +01:00

36 lines
725 B
C++

#pragma once
#include <Tactility/hal/i2c/I2cDevice.h>
#define BQ24295_ADDRESS 0x6BU
class Bq24295 : I2cDevice {
private:
bool readChargeTermination(uint8_t& out) const;
public:
enum class WatchDogTimer {
Disabled = 0b000000,
Enabled40s = 0b010000,
Enabled80s = 0b100000,
Enabled160s = 0b110000
};
explicit Bq24295(i2c_port_t port) : I2cDevice(port, BQ24295_ADDRESS) {}
bool getWatchDogTimer(WatchDogTimer& out) const;
bool setWatchDogTimer(WatchDogTimer in) const;
bool isUsbPowerConnected() const;
bool setBatFetOn(bool on) const;
bool getStatus(uint8_t& value) const;
bool getVersion(uint8_t& value) const;
void printInfo() const;
};