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.
50 lines
1.2 KiB
C++
50 lines
1.2 KiB
C++
#pragma once
|
|
|
|
#include "EspLcdDisplayV2.h"
|
|
|
|
#include <driver/spi_common.h>
|
|
|
|
#include <esp_lcd_io_spi.h>
|
|
#include <esp_lcd_types.h>
|
|
|
|
/**
|
|
* Adds IO implementations on top of EspLcdDisplayV2
|
|
* @warning This is an abstract class. You need to extend it to use it.
|
|
*/
|
|
class EspLcdSpiDisplay : public EspLcdDisplayV2 {
|
|
|
|
public:
|
|
|
|
struct SpiConfiguration {
|
|
spi_host_device_t spiHostDevice;
|
|
gpio_num_t csPin;
|
|
gpio_num_t dcPin;
|
|
unsigned int pixelClockFrequency = 80'000'000; // Hertz
|
|
size_t transactionQueueDepth = 10;
|
|
};
|
|
|
|
explicit EspLcdSpiDisplay(const std::shared_ptr<EspLcdConfiguration>& configuration, const std::shared_ptr<SpiConfiguration> spiConfiguration, int gammaCurveCount) :
|
|
EspLcdDisplayV2(configuration),
|
|
spiConfiguration(spiConfiguration),
|
|
gammaCurveCount(gammaCurveCount)
|
|
{}
|
|
|
|
private:
|
|
|
|
std::shared_ptr<SpiConfiguration> spiConfiguration;
|
|
int gammaCurveCount;
|
|
|
|
protected:
|
|
|
|
bool createIoHandle(esp_lcd_panel_io_handle_t& ioHandle) override;
|
|
|
|
// region Gamma
|
|
|
|
void setGammaCurve(uint8_t index) override;
|
|
|
|
uint8_t getGammaCurveCount() const override { return gammaCurveCount; }
|
|
|
|
// endregion
|
|
};
|
|
|