New kernel drivers and more (#560)
- Added kernel base drivers for: display, pointer (touch, mouse, etc.), keyboard, adc, power supply and backlight - Implement new kernel driver modules: `st7789-module` and `gt911-module` - Implement ESP32 ADC "oneshot" kernel driver - Implement ESP32 backlight kernel driver with ledc API - Implemented `battery-sense` driver that allows for voltage measurement and creates a power supply child device - Updated github actions - Updated flash scripts - Fix for esp32 legacy driver conflict with ADC - Created separate `lilygo-tdeck` and `lilygo-tdeck-plus` devices - Created `lilygo-module` with LilyGO kernel drivers - Fix for intermittent errors in build related to code generation of `devicetree.c` - `lvgl-module` can now map kernel drivers onto LVGL devices - Created `KernelDisplayApp` as a mirror of `HalDisplayApp` (formerly `DisplayApp`) - Removed `struct` and `enum` prefix in a lot of kernel driver cpp source files - `lilygo-tdeck` and `lilygo-tdeck-plus` are now fully relying on kernel drivers and don't use any of the old HAL
This commit is contained in:
committed by
GitHub
parent
c4406b24ba
commit
50c0a14a93
@@ -0,0 +1,26 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDriver.h>
|
||||
|
||||
#include <tactility/device.h>
|
||||
|
||||
namespace tt::hal::display {
|
||||
|
||||
/** Wraps a TactilityKernel Device of type DISPLAY_TYPE as a DisplayDriver. */
|
||||
class KernelDisplayDriver final : public DisplayDriver {
|
||||
|
||||
::Device* device;
|
||||
|
||||
public:
|
||||
|
||||
explicit KernelDisplayDriver(::Device* device);
|
||||
|
||||
ColorFormat getColorFormat() const override;
|
||||
uint16_t getPixelWidth() const override;
|
||||
uint16_t getPixelHeight() const override;
|
||||
bool drawBitmap(int xStart, int yStart, int xEnd, int yEnd, const void* pixelData) override;
|
||||
uint8_t getFrameBuffers(void* outBuffers[2]) const override;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <tactility/hal/Device.h>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
namespace tt::hal::power {
|
||||
|
||||
@@ -9,8 +10,8 @@ class PowerDevice : public Device {
|
||||
|
||||
public:
|
||||
|
||||
PowerDevice() = default;
|
||||
~PowerDevice() override = default;
|
||||
PowerDevice();
|
||||
~PowerDevice() override;
|
||||
|
||||
Type getType() const override { return Type::Power; }
|
||||
|
||||
@@ -46,6 +47,17 @@ public:
|
||||
|
||||
virtual bool supportsPowerOff() const { return false; }
|
||||
virtual void powerOff() { /* NO-OP*/ }
|
||||
|
||||
private:
|
||||
|
||||
/** Creates the kernel-level power_supply device that exposes this instance to TactilityKernel. */
|
||||
void createPowerSupplyDevice();
|
||||
|
||||
/** Destroys the kernel-level power_supply device created by createPowerSupplyDevice(). */
|
||||
void destroyPowerSupplyDevice();
|
||||
|
||||
std::string kernelDeviceName;
|
||||
KernelDevice kernelDevice {};
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
// SPDX-License-Identifier: Apache-2.0
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/touch/TouchDriver.h>
|
||||
|
||||
#include <tactility/device.h>
|
||||
|
||||
namespace tt::hal::touch {
|
||||
|
||||
/** Wraps a TactilityKernel Device of type POINTER_TYPE as a TouchDriver. */
|
||||
class KernelTouchDriver final : public TouchDriver {
|
||||
|
||||
::Device* device;
|
||||
|
||||
public:
|
||||
|
||||
explicit KernelTouchDriver(::Device* device);
|
||||
|
||||
bool getTouchedPoints(uint16_t* x, uint16_t* y, uint16_t* strength, uint8_t* pointCount, uint8_t maxPointCount) override;
|
||||
};
|
||||
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace tt::hal::touch {
|
||||
|
||||
class TouchDriver {
|
||||
|
||||
Reference in New Issue
Block a user