New kernel drivers and device migrations (#563)

This commit is contained in:
Ken Van Hoeylandt
2026-07-14 20:26:57 +02:00
committed by GitHub
parent 955416dac8
commit 8af6204ba1
215 changed files with 6359 additions and 3633 deletions
+41
View File
@@ -0,0 +1,41 @@
#pragma once
#include <tactility/check.h>
#include <tactility/device.h>
struct Device;
struct GpioDescriptor;
/**
* Easy access to GPIO pins
*/
class BatteryManager final {
::Device* expander = nullptr;
::Device* batteryManagement = nullptr;
::GpioDescriptor* expanderPowerPin = nullptr;
bool initGpioExpander();
public:
explicit BatteryManager() {
check(device_get_by_name("bq24295", &batteryManagement) == ERROR_NONE);
}
~BatteryManager() {
device_put(batteryManagement);
}
bool init();
bool setExpanderPower(bool on) const;
void turnPeripheralsOff() const;
/** Battery management (BQ24295) will stop supplying power until USB connects */
void setShipping(bool on) const;
bool isUsbPowerConnected() const;
};