mirror of
https://github.com/ByteWelder/Tactility.git
synced 2026-02-18 19:03:16 +00:00
- Implement SPI devices in dts files for all devices - Removed `tt::hal::spi` HAL and its configurations - Fix for devicetree generator "boolean" support - Remove unused custom locks in all `DisplayDevice` implementations - Fixed some bugs with devices - Updated XPT2046 driver - Fix for `WifiEsp` deadlock - Export a lot of new `math.h` symbols with `tt_init.cpp` - Created `SpiDeviceLock` in `TactilityCore` as a wrapper for kernel SPI locking - Improved `TactilityKernel` SPI driver.
36 lines
1022 B
C++
36 lines
1022 B
C++
#pragma once
|
|
|
|
#include <Tactility/hal/display/DisplayDriver.h>
|
|
|
|
#include <esp_lcd_panel_ops.h>
|
|
|
|
class EspLcdDisplayDriver : public tt::hal::display::DisplayDriver {
|
|
|
|
esp_lcd_panel_handle_t panelHandle;
|
|
uint16_t hRes;
|
|
uint16_t vRes;
|
|
tt::hal::display::ColorFormat colorFormat;
|
|
|
|
public:
|
|
|
|
EspLcdDisplayDriver(
|
|
esp_lcd_panel_handle_t panelHandle,
|
|
uint16_t hRes,
|
|
uint16_t vRes,
|
|
tt::hal::display::ColorFormat colorFormat
|
|
) : panelHandle(panelHandle), hRes(hRes), vRes(vRes), colorFormat(colorFormat) {}
|
|
|
|
tt::hal::display::ColorFormat getColorFormat() const override {
|
|
return colorFormat;
|
|
}
|
|
|
|
bool drawBitmap(int xStart, int yStart, int xEnd, int yEnd, const void* pixelData) override {
|
|
bool result = esp_lcd_panel_draw_bitmap(panelHandle, xStart, yStart, xEnd, yEnd, pixelData) == ESP_OK;
|
|
return result;
|
|
}
|
|
|
|
uint16_t getPixelWidth() const override { return hRes; }
|
|
|
|
uint16_t getPixelHeight() const override { return vRes; }
|
|
};
|