mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 10:53:17 +00:00
- `TT_LOG_*` macros are replaced by `Logger` via `#include<Tactility/Logger.h>` - Changed default timezone to Europe/Amsterdam - Fix for logic bug in unPhone hardware - Fix for init/deinit in DRV2605 driver - Other fixes - Removed optimization that broke unPhone (disabled the moving of heap-related functions to flash)
39 lines
903 B
C++
39 lines
903 B
C++
#pragma once
|
|
|
|
#include <Tactility/hal/i2c/I2cDevice.h>
|
|
|
|
#define BQ24295_ADDRESS 0x6BU
|
|
|
|
class Bq24295 final : public tt::hal::i2c::I2cDevice {
|
|
|
|
|
|
bool readChargeTermination(uint8_t& out) const;
|
|
|
|
public:
|
|
|
|
std::string getName() const final { return "BQ24295"; }
|
|
|
|
std::string getDescription() const final { return "I2C-controlled single cell USB charger"; }
|
|
|
|
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;
|
|
};
|