SPI device migration (#490)
- 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.
This commit is contained in:
committed by
GitHub
parent
74127a5f6c
commit
d27404964a
@@ -121,7 +121,6 @@ std::shared_ptr<tt::hal::display::DisplayDriver> EspLcdDisplay::getDisplayDriver
|
||||
|
||||
displayDriver = std::make_shared<EspLcdDisplayDriver>(
|
||||
panelHandle,
|
||||
lock,
|
||||
lvgl_port_config.hres,
|
||||
lvgl_port_config.vres,
|
||||
color_format
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/Lock.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
|
||||
@@ -14,8 +13,8 @@ class EspLcdDisplay : public tt::hal::display::DisplayDevice {
|
||||
esp_lcd_panel_handle_t panelHandle = nullptr;
|
||||
lv_display_t* lvglDisplay = nullptr;
|
||||
std::shared_ptr<tt::hal::display::DisplayDriver> displayDriver;
|
||||
std::shared_ptr<tt::Lock> lock;
|
||||
lcd_rgb_element_order_t rgbElementOrder;
|
||||
/** @warning This is never changed, so a driver that needs BGR is not supported */
|
||||
lcd_rgb_element_order_t rgbElementOrder = LCD_RGB_ELEMENT_ORDER_RGB;
|
||||
|
||||
protected:
|
||||
|
||||
@@ -34,12 +33,10 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
EspLcdDisplay(std::shared_ptr<tt::Lock> lock) : lock(lock) {}
|
||||
EspLcdDisplay() = default;
|
||||
|
||||
~EspLcdDisplay() override;
|
||||
|
||||
std::shared_ptr<tt::Lock> getLock() const { return lock; }
|
||||
|
||||
bool start() final;
|
||||
|
||||
bool stop() final;
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/Mutex.h>
|
||||
#include <Tactility/hal/display/DisplayDriver.h>
|
||||
|
||||
#include <esp_lcd_panel_ops.h>
|
||||
@@ -8,7 +7,6 @@
|
||||
class EspLcdDisplayDriver : public tt::hal::display::DisplayDriver {
|
||||
|
||||
esp_lcd_panel_handle_t panelHandle;
|
||||
std::shared_ptr<tt::Lock> lock;
|
||||
uint16_t hRes;
|
||||
uint16_t vRes;
|
||||
tt::hal::display::ColorFormat colorFormat;
|
||||
@@ -17,11 +15,10 @@ public:
|
||||
|
||||
EspLcdDisplayDriver(
|
||||
esp_lcd_panel_handle_t panelHandle,
|
||||
std::shared_ptr<tt::Lock> lock,
|
||||
uint16_t hRes,
|
||||
uint16_t vRes,
|
||||
tt::hal::display::ColorFormat colorFormat
|
||||
) : panelHandle(panelHandle), lock(lock), hRes(hRes), vRes(vRes), colorFormat(colorFormat) {}
|
||||
) : panelHandle(panelHandle), hRes(hRes), vRes(vRes), colorFormat(colorFormat) {}
|
||||
|
||||
tt::hal::display::ColorFormat getColorFormat() const override {
|
||||
return colorFormat;
|
||||
@@ -35,6 +32,4 @@ public:
|
||||
uint16_t getPixelWidth() const override { return hRes; }
|
||||
|
||||
uint16_t getPixelHeight() const override { return vRes; }
|
||||
|
||||
std::shared_ptr<tt::Lock> getLock() const override { return lock; }
|
||||
};
|
||||
|
||||
@@ -221,7 +221,6 @@ std::shared_ptr<tt::hal::display::DisplayDriver> EspLcdDisplayV2::getDisplayDriv
|
||||
|
||||
displayDriver = std::make_shared<EspLcdDisplayDriver>(
|
||||
panelHandle,
|
||||
lock,
|
||||
lvgl_port_config.hres,
|
||||
lvgl_port_config.vres,
|
||||
color_format
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/Lock.h>
|
||||
#include <tactility/check.h>
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <esp_lcd_panel_dev.h>
|
||||
@@ -35,7 +34,6 @@ class EspLcdDisplayV2 : public tt::hal::display::DisplayDevice {
|
||||
esp_lcd_panel_handle_t _Nullable panelHandle = nullptr;
|
||||
lv_display_t* _Nullable lvglDisplay = nullptr;
|
||||
std::shared_ptr<tt::hal::display::DisplayDriver> _Nullable displayDriver;
|
||||
std::shared_ptr<tt::Lock> lock;
|
||||
std::shared_ptr<EspLcdConfiguration> configuration;
|
||||
|
||||
bool applyConfiguration() const;
|
||||
@@ -67,18 +65,12 @@ protected:
|
||||
|
||||
public:
|
||||
|
||||
EspLcdDisplayV2(const std::shared_ptr<EspLcdConfiguration>& configuration, const std::shared_ptr<tt::Lock>& lock) :
|
||||
lock(lock),
|
||||
explicit EspLcdDisplayV2(const std::shared_ptr<EspLcdConfiguration>& configuration) :
|
||||
configuration(configuration)
|
||||
{
|
||||
assert(configuration != nullptr);
|
||||
assert(lock != nullptr);
|
||||
}
|
||||
{}
|
||||
|
||||
~EspLcdDisplayV2() override;
|
||||
|
||||
std::shared_ptr<tt::Lock> getLock() const { return lock; }
|
||||
|
||||
bool start() final;
|
||||
|
||||
bool stop() final;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "EspLcdDisplayV2.h"
|
||||
#include <Tactility/hal/spi/Spi.h>
|
||||
|
||||
#include <driver/spi_common.h>
|
||||
|
||||
#include <esp_lcd_io_spi.h>
|
||||
#include <esp_lcd_types.h>
|
||||
@@ -23,7 +24,7 @@ public:
|
||||
};
|
||||
|
||||
explicit EspLcdSpiDisplay(const std::shared_ptr<EspLcdConfiguration>& configuration, const std::shared_ptr<SpiConfiguration> spiConfiguration, int gammaCurveCount) :
|
||||
EspLcdDisplayV2(configuration, tt::hal::spi::getLock(spiConfiguration->spiHostDevice)),
|
||||
EspLcdDisplayV2(configuration),
|
||||
spiConfiguration(spiConfiguration),
|
||||
gammaCurveCount(gammaCurveCount)
|
||||
{}
|
||||
|
||||
Reference in New Issue
Block a user