Device migrations, new drivers, cleanup (#567)
* **New Features** * Added native display support for ST7796, ILI9341, and ST7789 panels across supported boards. * Added FT5x06 and FT6x36 touchscreen support. * Generic PWM driver * ESP32 PWM driver * Generic RGB LED driver * RGB PWM LED driver * RGB GPIO LED driver * Implementation of RGB LED for various boards * **Improvements** * Updated board hardware descriptions to use explicit display/touch/backlight device-tree bindings and disabled deprecated HAL usage. * Improved display and touch-driver cleanup to prevent stale resources and improve shutdown reliability. * Pinned esp-hosted library to a fixed version * **Deletions** * Obsolete placeholder display * Legacy ILI9488 support. * ESP32-specific LEDC PWM implementation
This commit is contained in:
committed by
GitHub
parent
6fb2bb736c
commit
3b5a401594
@@ -6,7 +6,8 @@
|
||||
#include <tactility/bindings/esp32_gpio.h>
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_usbhost.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/rgb_display.h>
|
||||
#include <bindings/gt911.h>
|
||||
|
||||
@@ -55,9 +56,17 @@
|
||||
pin-scl = <&gpio0 3 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
pin-backlight = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
compatible = "pwm-backlight";
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
display0 {
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/ili9341.h>
|
||||
#include <bindings/cst816s.h>
|
||||
|
||||
@@ -39,13 +41,57 @@
|
||||
};
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
#include <tactility/module.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
#include <driver/gpio.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Set the RGB LED pins to output and turn them off (0 on, 1 off)
|
||||
gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); // Red
|
||||
gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT); // Green
|
||||
gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT); // Blue
|
||||
|
||||
gpio_set_level(GPIO_NUM_4, 1); // Red
|
||||
gpio_set_level(GPIO_NUM_16, 1); // Green
|
||||
gpio_set_level(GPIO_NUM_17, 1); // Blue
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/ili9341.h>
|
||||
#include <bindings/xpt2046.h>
|
||||
|
||||
@@ -24,13 +26,57 @@
|
||||
gpio-count = <40>;
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/ili9341.h>
|
||||
#include <bindings/xpt2046_softspi.h>
|
||||
|
||||
@@ -33,13 +35,57 @@
|
||||
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
touch {
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
#include <tactility/module.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
#include <driver/gpio.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Set the RGB LED pins to output and turn them off (0 on, 1 off)
|
||||
gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); // Red
|
||||
gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT); // Green
|
||||
gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT); // Blue
|
||||
|
||||
gpio_set_level(GPIO_NUM_4, 1); // Red
|
||||
gpio_set_level(GPIO_NUM_16, 1); // Green
|
||||
gpio_set_level(GPIO_NUM_17, 1); // Blue
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -7,7 +7,9 @@
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/st7789.h>
|
||||
#include <bindings/xpt2046_softspi.h>
|
||||
|
||||
@@ -33,13 +35,57 @@
|
||||
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
touch {
|
||||
|
||||
@@ -1,20 +1,8 @@
|
||||
#include <tactility/module.h>
|
||||
#include <tactility/error.h>
|
||||
|
||||
#include <driver/gpio.h>
|
||||
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Set the RGB LED pins to output and turn them off (0 on, 1 off)
|
||||
gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT); // Red
|
||||
gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT); // Green
|
||||
gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT); // Blue
|
||||
|
||||
gpio_set_level(GPIO_NUM_4, 1); // Red
|
||||
gpio_set_level(GPIO_NUM_16, 1); // Green
|
||||
gpio_set_level(GPIO_NUM_17, 1); // Blue
|
||||
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility esp_lvgl_port ILI934x GT911 PwmBacklight driver vfs fatfs
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -1,47 +0,0 @@
|
||||
#include "devices/Display.h"
|
||||
#include <driver/gpio.h>
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <Tactility/SystemEvents.h>
|
||||
#include <Tactility/lvgl/LvglSync.h>
|
||||
|
||||
#include <PwmBacklight.h>
|
||||
|
||||
static bool init_boot() {
|
||||
if (!driver::pwmbacklight::init(LCD_PIN_BACKLIGHT)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Set the RGB LED Pins to output and turn them off
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); // Red
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); // Green
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); // Blue
|
||||
|
||||
// 0 on, 1 off
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); // Red
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); // Green
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); // Blue
|
||||
|
||||
// This display has a weird glitch with gamma during boot, which results in uneven dark gray colours.
|
||||
// Setting gamma curve index to 0 doesn't work at boot for an unknown reason, so we set the curve index to 1:
|
||||
tt::kernel::subscribeSystemEvent(tt::kernel::SystemEvent::BootSplash, [](auto) {
|
||||
auto display = tt::hal::findFirstDevice<tt::hal::display::DisplayDevice>(tt::hal::Device::Type::Display);
|
||||
assert(display != nullptr);
|
||||
tt::lvgl::lock(portMAX_DELAY);
|
||||
display->setGammaCurve(1U);
|
||||
tt::lvgl::unlock();
|
||||
});
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static tt::hal::DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay(),
|
||||
};
|
||||
}
|
||||
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {
|
||||
.initBoot = init_boot,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
@@ -1,48 +0,0 @@
|
||||
#include "Display.h"
|
||||
|
||||
#include <Gt911Touch.h>
|
||||
#include <Ili934xDisplay.h>
|
||||
#include <PwmBacklight.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
|
||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||
auto* i2c = device_find_by_name("i2c0");
|
||||
check(i2c);
|
||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
||||
i2c,
|
||||
LCD_HORIZONTAL_RESOLUTION,
|
||||
LCD_VERTICAL_RESOLUTION
|
||||
);
|
||||
|
||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
Ili934xDisplay::Configuration panel_configuration = {
|
||||
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
||||
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
||||
.gapX = 0,
|
||||
.gapY = 0,
|
||||
.swapXY = true,
|
||||
.mirrorX = true,
|
||||
.mirrorY = true,
|
||||
.invertColor = true,
|
||||
.swapBytes = true,
|
||||
.bufferSize = LCD_BUFFER_SIZE,
|
||||
.touch = createTouch(),
|
||||
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
|
||||
.resetPin = GPIO_NUM_NC,
|
||||
.rgbElementOrder = LCD_RGB_ELEMENT_ORDER_RGB
|
||||
};
|
||||
|
||||
auto spi_configuration = std::make_shared<Ili934xDisplay::SpiConfiguration>(Ili934xDisplay::SpiConfiguration {
|
||||
.spiHostDevice = LCD_SPI_HOST,
|
||||
.csPin = LCD_PIN_CS,
|
||||
.dcPin = LCD_PIN_DC,
|
||||
.pixelClockFrequency = 40'000'000,
|
||||
.transactionQueueDepth = 10
|
||||
});
|
||||
|
||||
return std::make_shared<Ili934xDisplay>(panel_configuration, spi_configuration, true);
|
||||
}
|
||||
@@ -1,18 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/spi_common.h>
|
||||
#include <memory>
|
||||
|
||||
// Display
|
||||
constexpr auto LCD_SPI_HOST = SPI2_HOST;
|
||||
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
|
||||
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
|
||||
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_27;
|
||||
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
|
||||
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
|
||||
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 10;
|
||||
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
@@ -6,7 +6,11 @@
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/display_placeholder.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/ili9341.h>
|
||||
#include <bindings/gt911.h>
|
||||
|
||||
/ {
|
||||
compatible = "root";
|
||||
@@ -28,6 +32,66 @@
|
||||
clock-frequency = <400000>;
|
||||
pin-sda = <&gpio0 33 GPIO_FLAG_NONE>;
|
||||
pin-scl = <&gpio0 32 GPIO_FLAG_NONE>;
|
||||
|
||||
touch {
|
||||
compatible = "goodix,gt911";
|
||||
reg = <0x5D>;
|
||||
x-max = <240>;
|
||||
y-max = <320>;
|
||||
};
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
@@ -37,8 +101,19 @@
|
||||
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
|
||||
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
|
||||
|
||||
display {
|
||||
compatible = "display-placeholder";
|
||||
display@0 {
|
||||
compatible = "ilitek,ili9341";
|
||||
horizontal-resolution = <240>;
|
||||
vertical-resolution = <320>;
|
||||
swap-xy;
|
||||
mirror-x;
|
||||
mirror-y;
|
||||
invert-color;
|
||||
// Curve 0 doesn't apply cleanly at boot on this panel (uneven dark-gray gamma glitch); 1 does.
|
||||
gamma-curve = <1>;
|
||||
pixel-clock-hz = <40000000>;
|
||||
pin-dc = <&gpio0 2 GPIO_FLAG_NONE>;
|
||||
backlight = <&display_backlight>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ hardware.target=ESP32
|
||||
hardware.flashSize=4MB
|
||||
hardware.spiRam=false
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=3.2"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
dependencies:
|
||||
- Platforms/platform-esp32
|
||||
- Drivers/ili9341-module
|
||||
- Drivers/gt911-module
|
||||
dts: cyd,2432s032c.dts
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility esp_lvgl_port ST7796 GT911 PwmBacklight driver vfs fatfs
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "devices/Display.h"
|
||||
#include <driver/gpio.h>
|
||||
|
||||
#include <PwmBacklight.h>
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
static bool initBoot() {
|
||||
//Set the RGB Led Pins to output and turn them off
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); //Red
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); //Green
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); //Blue
|
||||
|
||||
//0 on, 1 off... yep it's backwards.
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); //Red
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); //Green
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); //Blue
|
||||
|
||||
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
|
||||
}
|
||||
|
||||
static DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay(),
|
||||
};
|
||||
}
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
@@ -1,40 +0,0 @@
|
||||
#include "Display.h"
|
||||
|
||||
#include <Gt911Touch.h>
|
||||
#include <PwmBacklight.h>
|
||||
#include <St7796Display.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
|
||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||
auto* i2c = device_find_by_name("i2c0");
|
||||
check(i2c);
|
||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
||||
i2c,
|
||||
LCD_HORIZONTAL_RESOLUTION,
|
||||
LCD_VERTICAL_RESOLUTION
|
||||
);
|
||||
|
||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
auto touch = createTouch();
|
||||
auto configuration = std::make_unique<St7796Display::Configuration>(
|
||||
LCD_SPI_HOST,
|
||||
LCD_PIN_CS,
|
||||
LCD_PIN_DC,
|
||||
LCD_HORIZONTAL_RESOLUTION,
|
||||
LCD_VERTICAL_RESOLUTION,
|
||||
touch,
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
configuration->backlightDutyFunction = driver::pwmbacklight::setBacklightDuty;
|
||||
|
||||
auto display = std::make_shared<St7796Display>(std::move(configuration));
|
||||
return std::reinterpret_pointer_cast<tt::hal::display::DisplayDevice>(display);
|
||||
}
|
||||
@@ -1,20 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <memory>
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/spi_common.h>
|
||||
|
||||
// Display backlight (PWM)
|
||||
constexpr auto LCD_PIN_BACKLIGHT = GPIO_NUM_27;
|
||||
|
||||
// Display
|
||||
constexpr auto LCD_SPI_HOST = SPI2_HOST;
|
||||
constexpr auto LCD_PIN_CS = GPIO_NUM_15;
|
||||
constexpr auto LCD_PIN_DC = GPIO_NUM_2;
|
||||
constexpr auto LCD_HORIZONTAL_RESOLUTION = 320;
|
||||
constexpr auto LCD_VERTICAL_RESOLUTION = 480;
|
||||
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 10;
|
||||
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
@@ -7,7 +7,11 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/display_placeholder.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/st7796.h>
|
||||
#include <bindings/gt911.h>
|
||||
|
||||
/ {
|
||||
compatible = "root";
|
||||
@@ -29,6 +33,13 @@
|
||||
clock-frequency = <400000>;
|
||||
pin-sda = <&gpio0 33 GPIO_FLAG_NONE>;
|
||||
pin-scl = <&gpio0 32 GPIO_FLAG_NONE>;
|
||||
|
||||
touch {
|
||||
compatible = "goodix,gt911";
|
||||
reg = <0x5D>;
|
||||
x-max = <320>;
|
||||
y-max = <480>;
|
||||
};
|
||||
};
|
||||
|
||||
// CN1 header
|
||||
@@ -40,6 +51,59 @@
|
||||
pin-scl = <&gpio0 22 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
compatible = "espressif,esp32-spi";
|
||||
host = <SPI2_HOST>;
|
||||
@@ -47,8 +111,14 @@
|
||||
pin-mosi = <&gpio0 13 GPIO_FLAG_NONE>;
|
||||
pin-sclk = <&gpio0 14 GPIO_FLAG_NONE>;
|
||||
|
||||
display {
|
||||
compatible = "display-placeholder";
|
||||
display@0 {
|
||||
compatible = "sitronix,st7796";
|
||||
horizontal-resolution = <320>;
|
||||
vertical-resolution = <480>;
|
||||
mirror-x;
|
||||
pixel-clock-hz = <80000000>;
|
||||
pin-dc = <&gpio0 2 GPIO_FLAG_NONE>;
|
||||
backlight = <&display_backlight>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -7,6 +7,8 @@ hardware.target=ESP32
|
||||
hardware.flashSize=4MB
|
||||
hardware.spiRam=false
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=3.5"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
dependencies:
|
||||
- Platforms/platform-esp32
|
||||
- Drivers/st7796-module
|
||||
- Drivers/gt911-module
|
||||
dts: cyd,3248s035c.dts
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility esp_lvgl_port esp_lcd RgbDisplay GT911 PwmBacklight driver vfs fatfs
|
||||
REQUIRES TactilityKernel driver
|
||||
)
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
#include "PwmBacklight.h"
|
||||
#include "devices/Display.h"
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
static bool initBoot() {
|
||||
// Display backlight
|
||||
return driver::pwmbacklight::init(GPIO_NUM_2, 200);
|
||||
}
|
||||
|
||||
static DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay(),
|
||||
};
|
||||
}
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
@@ -1,108 +0,0 @@
|
||||
#include "Display.h"
|
||||
|
||||
#include <Gt911Touch.h>
|
||||
#include <PwmBacklight.h>
|
||||
#include <RgbDisplay.h>
|
||||
#include <tactility/check.h>
|
||||
#include <tactility/device.h>
|
||||
|
||||
std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||
// Note for future changes: Reset pin is 38 and interrupt pin is 18
|
||||
// or INT = NC, schematic and other info floating around is kinda conflicting...
|
||||
auto* i2c = device_find_by_name("i2c_internal");
|
||||
check(i2c);
|
||||
auto configuration = std::make_unique<Gt911Touch::Configuration>(
|
||||
i2c,
|
||||
800,
|
||||
480
|
||||
);
|
||||
|
||||
return std::make_shared<Gt911Touch>(std::move(configuration));
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
auto touch = createTouch();
|
||||
|
||||
constexpr uint32_t bufferPixels = 800 * 10;
|
||||
|
||||
esp_lcd_rgb_panel_config_t rgb_panel_config = {
|
||||
.clk_src = LCD_CLK_SRC_DEFAULT,
|
||||
.timings = {
|
||||
.pclk_hz = 16000000,
|
||||
.h_res = 800,
|
||||
.v_res = 480,
|
||||
.hsync_pulse_width = 4,
|
||||
.hsync_back_porch = 8,
|
||||
.hsync_front_porch = 8,
|
||||
.vsync_pulse_width = 4,
|
||||
.vsync_back_porch = 8,
|
||||
.vsync_front_porch = 8,
|
||||
.flags = {
|
||||
.hsync_idle_low = false,
|
||||
.vsync_idle_low = false,
|
||||
.de_idle_high = false,
|
||||
.pclk_active_neg = true,
|
||||
.pclk_idle_high = false
|
||||
}
|
||||
},
|
||||
.data_width = 16,
|
||||
.bits_per_pixel = 0,
|
||||
.num_fbs = 2,
|
||||
.bounce_buffer_size_px = bufferPixels,
|
||||
.sram_trans_align = 8,
|
||||
.psram_trans_align = 64,
|
||||
.hsync_gpio_num = GPIO_NUM_39,
|
||||
.vsync_gpio_num = GPIO_NUM_41,
|
||||
.de_gpio_num = GPIO_NUM_40 ,
|
||||
.pclk_gpio_num = GPIO_NUM_42,
|
||||
.disp_gpio_num = GPIO_NUM_NC,
|
||||
.data_gpio_nums = {
|
||||
GPIO_NUM_8, // B3
|
||||
GPIO_NUM_3, // B4
|
||||
GPIO_NUM_46, // B5
|
||||
GPIO_NUM_9, // B6
|
||||
GPIO_NUM_1, // B7
|
||||
GPIO_NUM_5, // G2
|
||||
GPIO_NUM_6, // G3
|
||||
GPIO_NUM_7, // G4
|
||||
GPIO_NUM_15, // G5
|
||||
GPIO_NUM_16, // G6
|
||||
GPIO_NUM_4, // G7
|
||||
GPIO_NUM_45, // R3
|
||||
GPIO_NUM_48, // R4
|
||||
GPIO_NUM_47, // R5
|
||||
GPIO_NUM_21, // R6
|
||||
GPIO_NUM_14, // R7
|
||||
},
|
||||
.flags = {
|
||||
.disp_active_low = false,
|
||||
.refresh_on_demand = false,
|
||||
.fb_in_psram = true,
|
||||
.double_fb = true,
|
||||
.no_fb = false,
|
||||
.bb_invalidate_cache = false
|
||||
}
|
||||
};
|
||||
|
||||
RgbDisplay::BufferConfiguration buffer_config = {
|
||||
.size = (800 * 480),
|
||||
.useSpi = true,
|
||||
.doubleBuffer = true,
|
||||
.bounceBufferMode = true,
|
||||
.avoidTearing = false
|
||||
};
|
||||
|
||||
auto configuration = std::make_unique<RgbDisplay::Configuration>(
|
||||
rgb_panel_config,
|
||||
buffer_config,
|
||||
touch,
|
||||
LV_COLOR_FORMAT_RGB565,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
driver::pwmbacklight::setBacklightDuty
|
||||
);
|
||||
|
||||
return std::make_shared<RgbDisplay>(std::move(configuration));
|
||||
}
|
||||
@@ -1,5 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "Tactility/hal/display/DisplayDevice.h"
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
@@ -8,6 +8,10 @@
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/rgb_display.h>
|
||||
#include <bindings/gt911.h>
|
||||
|
||||
/ {
|
||||
compatible = "root";
|
||||
@@ -34,6 +38,16 @@
|
||||
clock-frequency = <400000>;
|
||||
pin-sda = <&gpio0 19 GPIO_FLAG_NONE>;
|
||||
pin-scl = <&gpio0 20 GPIO_FLAG_NONE>;
|
||||
|
||||
touch0 {
|
||||
// Reset pin 38 and interrupt pin 18 (or INT = NC) exist on the board but are not
|
||||
// wired up here - conflicting schematic info, unverified (matches the original
|
||||
// deprecated-HAL config).
|
||||
compatible = "goodix,gt911";
|
||||
reg = <0x5D>;
|
||||
x-max = <800>;
|
||||
y-max = <480>;
|
||||
};
|
||||
};
|
||||
|
||||
i2c_external {
|
||||
@@ -58,6 +72,57 @@
|
||||
};
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 2 GPIO_FLAG_NONE>;
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "pwm-backlight";
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
display0 {
|
||||
compatible = "espressif,esp32-rgb-display";
|
||||
horizontal-resolution = <800>;
|
||||
vertical-resolution = <480>;
|
||||
pixel-clock-hz = <16000000>;
|
||||
hsync-pulse-width = <4>;
|
||||
hsync-back-porch = <8>;
|
||||
hsync-front-porch = <8>;
|
||||
vsync-pulse-width = <4>;
|
||||
vsync-back-porch = <8>;
|
||||
vsync-front-porch = <8>;
|
||||
pclk-active-neg;
|
||||
num-fbs = <2>;
|
||||
double-fb;
|
||||
bounce-buffer-size-px = <8000>;
|
||||
pin-hsync = <&gpio0 39 GPIO_FLAG_NONE>;
|
||||
pin-vsync = <&gpio0 41 GPIO_FLAG_NONE>;
|
||||
pin-de = <&gpio0 40 GPIO_FLAG_NONE>;
|
||||
pin-pclk = <&gpio0 42 GPIO_FLAG_NONE>;
|
||||
pin-data0 = <&gpio0 8 GPIO_FLAG_NONE>; // B3
|
||||
pin-data1 = <&gpio0 3 GPIO_FLAG_NONE>; // B4
|
||||
pin-data2 = <&gpio0 46 GPIO_FLAG_NONE>; // B5
|
||||
pin-data3 = <&gpio0 9 GPIO_FLAG_NONE>; // B6
|
||||
pin-data4 = <&gpio0 1 GPIO_FLAG_NONE>; // B7
|
||||
pin-data5 = <&gpio0 5 GPIO_FLAG_NONE>; // G2
|
||||
pin-data6 = <&gpio0 6 GPIO_FLAG_NONE>; // G3
|
||||
pin-data7 = <&gpio0 7 GPIO_FLAG_NONE>; // G4
|
||||
pin-data8 = <&gpio0 15 GPIO_FLAG_NONE>; // G5
|
||||
pin-data9 = <&gpio0 16 GPIO_FLAG_NONE>; // G6
|
||||
pin-data10 = <&gpio0 4 GPIO_FLAG_NONE>; // G7
|
||||
pin-data11 = <&gpio0 45 GPIO_FLAG_NONE>; // R3
|
||||
pin-data12 = <&gpio0 48 GPIO_FLAG_NONE>; // R4
|
||||
pin-data13 = <&gpio0 47 GPIO_FLAG_NONE>; // R5
|
||||
pin-data14 = <&gpio0 21 GPIO_FLAG_NONE>; // R6
|
||||
pin-data15 = <&gpio0 14 GPIO_FLAG_NONE>; // R7
|
||||
backlight = <&display_backlight>;
|
||||
};
|
||||
|
||||
uart1 {
|
||||
compatible = "espressif,esp32-uart";
|
||||
status = "disabled";
|
||||
|
||||
@@ -12,6 +12,8 @@ hardware.spiRamSpeed=80M
|
||||
hardware.esptoolFlashFreq=80M
|
||||
hardware.bluetooth=true
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=4.3"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
dependencies:
|
||||
- Platforms/platform-esp32
|
||||
- Drivers/rgb-display-module
|
||||
- Drivers/gt911-module
|
||||
dts: cyd,8048s043c.dts
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
#include <tactility/bindings/esp32_gpio.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/ili9341.h>
|
||||
#include <bindings/xpt2046_softspi.h>
|
||||
|
||||
@@ -23,13 +25,58 @@
|
||||
gpio-count = <40>;
|
||||
};
|
||||
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 22 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
touch {
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
#include <bindings/st7789.h>
|
||||
#include <bindings/xpt2046.h>
|
||||
|
||||
@@ -40,6 +42,43 @@
|
||||
channels = <ADC_CHANNEL_6 ADC_ATTEN_DB_12 ADC_BITWIDTH_DEFAULT>;
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 22 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
|
||||
// Matches the deprecated HAL's old ChargeFromAdcVoltage config: adcMultiplier=2.11,
|
||||
// adcRefVoltage=3.3 (default), voltageMin/Max=3.2/4.2 (default, same as battery-sense's own
|
||||
// fixed curve - see TactilityKernel/source/drivers/battery_sense.cpp).
|
||||
@@ -50,13 +89,20 @@
|
||||
multiplier = <2110>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <25000>;
|
||||
ledc-timer = <1>;
|
||||
ledc-channel = <3>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <40000>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility FT5x06 ST7789 PwmBacklight driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#include "PwmBacklight.h"
|
||||
#include "devices/Display.h"
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
static bool initBoot() {
|
||||
return driver::pwmbacklight::init(GPIO_NUM_38);
|
||||
}
|
||||
|
||||
static DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay(),
|
||||
};
|
||||
}
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
@@ -1,46 +0,0 @@
|
||||
#include "Display.h"
|
||||
|
||||
#include <Ft5x06Touch.h>
|
||||
#include <PwmBacklight.h>
|
||||
#include <St7789Display.h>
|
||||
|
||||
static std::shared_ptr<tt::hal::touch::TouchDevice> createTouch() {
|
||||
auto configuration = std::make_unique<Ft5x06Touch::Configuration>(
|
||||
I2C_NUM_0,
|
||||
LCD_HORIZONTAL_RESOLUTION,
|
||||
LCD_VERTICAL_RESOLUTION,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
);
|
||||
|
||||
return std::make_shared<Ft5x06Touch>(std::move(configuration));
|
||||
}
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
St7789Display::Configuration panel_configuration = {
|
||||
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
||||
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
||||
.gapX = 0,
|
||||
.gapY = 0,
|
||||
.swapXY = false,
|
||||
.mirrorX = false,
|
||||
.mirrorY = false,
|
||||
.invertColor = true,
|
||||
.bufferSize = LCD_BUFFER_SIZE,
|
||||
.touch = createTouch(),
|
||||
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
|
||||
.resetPin = GPIO_NUM_NC,
|
||||
.lvglSwapBytes = false
|
||||
};
|
||||
|
||||
auto spi_configuration = std::make_shared<St7789Display::SpiConfiguration>(St7789Display::SpiConfiguration {
|
||||
.spiHostDevice = LCD_SPI_HOST,
|
||||
.csPin = LCD_PIN_CS,
|
||||
.dcPin = LCD_PIN_DC,
|
||||
.pixelClockFrequency = 62'500'000,
|
||||
.transactionQueueDepth = 10
|
||||
});
|
||||
|
||||
return std::make_shared<St7789Display>(panel_configuration, spi_configuration);
|
||||
}
|
||||
@@ -1,16 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
|
||||
#include <driver/gpio.h>
|
||||
#include <driver/spi_common.h>
|
||||
|
||||
constexpr auto LCD_SPI_HOST = SPI2_HOST;
|
||||
constexpr auto LCD_PIN_CS = GPIO_NUM_40;
|
||||
constexpr auto LCD_PIN_DC = GPIO_NUM_41; // RS
|
||||
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
|
||||
constexpr auto LCD_VERTICAL_RESOLUTION = 320;
|
||||
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 10;
|
||||
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
@@ -12,6 +12,8 @@ hardware.tinyUsb=true
|
||||
hardware.esptoolFlashFreq=120M
|
||||
hardware.bluetooth=true
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=2.8"
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
dependencies:
|
||||
- Platforms/platform-esp32
|
||||
- Drivers/st7789-module
|
||||
- Drivers/ft5x06-module
|
||||
dts: elecrow,crowpanel-advance-28.dts
|
||||
|
||||
@@ -8,7 +8,10 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/display_placeholder.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/st7789.h>
|
||||
#include <bindings/ft5x06.h>
|
||||
|
||||
/ {
|
||||
compatible = "root";
|
||||
@@ -35,6 +38,26 @@
|
||||
clock-frequency = <400000>;
|
||||
pin-sda = <&gpio0 15 GPIO_FLAG_NONE>;
|
||||
pin-scl = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
|
||||
touch0 {
|
||||
compatible = "focaltech,ft5x06";
|
||||
reg = <0x38>;
|
||||
x-max = <240>;
|
||||
y-max = <320>;
|
||||
};
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "pwm-backlight";
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
@@ -44,8 +67,14 @@
|
||||
pin-mosi = <&gpio0 39 GPIO_FLAG_NONE>;
|
||||
pin-sclk = <&gpio0 42 GPIO_FLAG_NONE>;
|
||||
|
||||
display {
|
||||
compatible = "display-placeholder";
|
||||
display@0 {
|
||||
compatible = "sitronix,st7789";
|
||||
horizontal-resolution = <240>;
|
||||
vertical-resolution = <320>;
|
||||
invert-color;
|
||||
pixel-clock-hz = <62500000>;
|
||||
pin-dc = <&gpio0 41 GPIO_FLAG_NONE>;
|
||||
backlight = <&display_backlight>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
-2
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/ili9488.h>
|
||||
#include <bindings/gt911.h>
|
||||
|
||||
@@ -46,13 +47,20 @@
|
||||
};
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_gpio_backlight.h>
|
||||
#include <tactility/bindings/gpio_backlight.h>
|
||||
#include <bindings/rgb_display.h>
|
||||
#include <bindings/gt911.h>
|
||||
#include <bindings/tca9534.h>
|
||||
@@ -70,8 +70,8 @@
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-gpio-backlight";
|
||||
pin-backlight = <&io_expander0 1 GPIO_FLAG_NONE>;
|
||||
compatible = "gpio-backlight";
|
||||
pin = <&io_expander0 1 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
display0 {
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/ili9341.h>
|
||||
#include <bindings/xpt2046.h>
|
||||
|
||||
@@ -33,13 +34,20 @@
|
||||
pin-scl = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <25000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <40000>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,5 +2,5 @@ file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
REQUIRES TactilityKernel driver
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/ili9488.h>
|
||||
#include <bindings/xpt2046.h>
|
||||
|
||||
@@ -33,13 +34,20 @@
|
||||
pin-scl = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/rgb_display.h>
|
||||
#include <bindings/gt911.h>
|
||||
|
||||
@@ -63,10 +64,17 @@
|
||||
};
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 2 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
pin-backlight = <&gpio0 2 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
compatible = "pwm-backlight";
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
display0 {
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {};
|
||||
@@ -7,4 +7,6 @@ hardware.target=ESP32
|
||||
hardware.flashSize=8MB
|
||||
hardware.spiRam=false
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=Internal
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {};
|
||||
@@ -7,4 +7,6 @@ hardware.target=ESP32C6
|
||||
hardware.flashSize=8MB
|
||||
hardware.spiRam=false
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=Internal
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {};
|
||||
@@ -7,4 +7,6 @@ hardware.target=ESP32P4
|
||||
hardware.flashSize=8MB
|
||||
hardware.spiRam=false
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=Internal
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility
|
||||
REQUIRES TactilityKernel
|
||||
)
|
||||
|
||||
@@ -1,3 +0,0 @@
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
|
||||
extern const tt::hal::Configuration hardwareConfiguration = {};
|
||||
@@ -7,4 +7,6 @@ hardware.target=ESP32S3
|
||||
hardware.flashSize=8MB
|
||||
hardware.spiRam=false
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=Internal
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
#include "devices/Display.h"
|
||||
#include <driver/gpio.h>
|
||||
|
||||
#include <PwmBacklight.h>
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
@@ -7,16 +6,6 @@
|
||||
using namespace tt::hal;
|
||||
|
||||
static bool initBoot() {
|
||||
//Set the RGB Led Pins to output and turn them off
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_4, GPIO_MODE_OUTPUT)); //Red
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_16, GPIO_MODE_OUTPUT)); //Green
|
||||
ESP_ERROR_CHECK(gpio_set_direction(GPIO_NUM_17, GPIO_MODE_OUTPUT)); //Blue
|
||||
|
||||
//0 on, 1 off... yep it's backwards.
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_4, 1)); //Red
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_16, 1)); //Green
|
||||
ESP_ERROR_CHECK(gpio_set_level(GPIO_NUM_17, 1)); //Blue
|
||||
|
||||
return driver::pwmbacklight::init(LCD_PIN_BACKLIGHT);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
/dts-v1/;
|
||||
|
||||
#include <tactility/bindings/root.h>
|
||||
#include <tactility/bindings/esp32_wifi_pinned.h>
|
||||
#include <tactility/bindings/esp32_gpio.h>
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_wifi_pinned.h>
|
||||
#include <tactility/bindings/display_placeholder.h>
|
||||
#include <tactility/bindings/rgb_led_pwm.h>
|
||||
|
||||
/ {
|
||||
compatible = "root";
|
||||
@@ -74,4 +76,41 @@
|
||||
pin-tx = <&gpio0 22 GPIO_FLAG_NONE>;
|
||||
pin-rx = <&gpio0 21 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
rgb_led_channel_red {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 4 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_green {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 16 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <1>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_channel_blue {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 17 GPIO_FLAG_NONE>;
|
||||
period-ns = <500000>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <2>;
|
||||
inverted;
|
||||
};
|
||||
|
||||
rgb_led_pwm {
|
||||
compatible = "rgb-led-pwm";
|
||||
pwm-red = <&rgb_led_channel_red>;
|
||||
pwm-green = <&rgb_led_channel_green>;
|
||||
pwm-blue = <&rgb_led_channel_blue>;
|
||||
// Default is red, and we want to reset it to off by default
|
||||
default-color = <0 0 0>;
|
||||
enabled;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
#include <tactility/bindings/esp32_grove.h>
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_i2s.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_wifi_pinned.h>
|
||||
@@ -134,15 +135,22 @@
|
||||
};
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 42 GPIO_FLAG_NONE>;
|
||||
// 32 KHz and higher causes the screen to start dimming again above 80% brightness
|
||||
// when moving the brightness slider rapidly from a lower setting to 100% (debug-traced, not a slider bug).
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so dispaly power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 42 GPIO_FLAG_NONE>;
|
||||
// 32 KHz and higher causes the screen to start dimming again above 80% brightness
|
||||
// when moving the brightness slider rapidly from a lower setting to 100% (debug-traced, not a slider bug).
|
||||
frequency-hz = <30000>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -8,7 +8,8 @@
|
||||
#include <tactility/bindings/esp32_grove.h>
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_i2s.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_wifi_pinned.h>
|
||||
@@ -134,15 +135,22 @@
|
||||
};
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 42 GPIO_FLAG_NONE>;
|
||||
// 32 KHz and higher causes the screen to start dimming again above 80% brightness
|
||||
// when moving the brightness slider rapidly from a lower setting to 100% (debug-traced, not a slider bug).
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so dispaly power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 42 GPIO_FLAG_NONE>;
|
||||
// 32 KHz and higher causes the screen to start dimming again above 80% brightness
|
||||
// when moving the brightness slider rapidly from a lower setting to 100% (debug-traced, not a slider bug).
|
||||
frequency-hz = <30000>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
#include <tactility/bindings/esp32_i2c.h>
|
||||
#include <tactility/bindings/esp32_sdmmc.h>
|
||||
#include <tactility/bindings/esp32_i8080.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <tactility/bindings/gpio_hog.h>
|
||||
#include <bindings/button_control.h>
|
||||
#include <bindings/st7789_i8080.h>
|
||||
@@ -39,13 +40,13 @@
|
||||
// HAL's initBoot() used to run. gpio-hog nodes run in declaration order, so they must stay
|
||||
// before the i8080 bus node.
|
||||
power_on {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&gpio0 14 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_OUTPUT_HIGH>;
|
||||
};
|
||||
|
||||
power_en {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&gpio0 10 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_OUTPUT_HIGH>;
|
||||
};
|
||||
@@ -68,13 +69,20 @@
|
||||
multiplier = <2000>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <30000>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
i8080_0 {
|
||||
|
||||
@@ -13,7 +13,8 @@
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <bindings/bmi270.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
|
||||
#include <bindings/st7789.h>
|
||||
#include <bindings/cardputer_adv_keyboard.h>
|
||||
@@ -81,13 +82,20 @@
|
||||
i2cClockFrequency = <400000>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
|
||||
#include <bindings/st7789.h>
|
||||
#include <bindings/cardputer_keyboard.h>
|
||||
@@ -64,13 +65,20 @@
|
||||
i2cClockFrequency = <400000>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -7,7 +7,8 @@
|
||||
#include <tactility/bindings/esp32_uart.h>
|
||||
#include <bindings/mpu6886.h>
|
||||
#include <bindings/bm8563.h>
|
||||
#include <tactility/bindings/esp32_ledc_backlight.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
|
||||
#include <bindings/st7789.h>
|
||||
#include <bindings/button_control.h>
|
||||
@@ -52,13 +53,20 @@
|
||||
pin-scl = <&gpio0 33 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
period-ns = <1953125>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-ledc-backlight";
|
||||
compatible = "pwm-backlight";
|
||||
// Off by default so display power-on won't show the screen from before the last power loss.
|
||||
// The display backlight is turned on during the boot process.
|
||||
status = "disabled";
|
||||
pin-backlight = <&gpio0 27 GPIO_FLAG_NONE>;
|
||||
frequency-hz = <512>;
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include <bindings/bq24295.h>
|
||||
#include <bindings/unphone_power_switch.h>
|
||||
#include <bindings/unphone_nav_buttons.h>
|
||||
#include <tactility/bindings/esp32_gpio_backlight.h>
|
||||
#include <tactility/bindings/gpio_backlight.h>
|
||||
#include <tactility/bindings/gpio_hog.h>
|
||||
|
||||
/ {
|
||||
@@ -66,42 +66,42 @@
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "espressif,esp32-gpio-backlight";
|
||||
pin-backlight = <&tca9535 2 GPIO_FLAG_NONE>;
|
||||
compatible = "gpio-backlight";
|
||||
pin = <&tca9535 2 GPIO_FLAG_NONE>;
|
||||
};
|
||||
|
||||
usb_vsense {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&tca9535 14 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_INPUT>;
|
||||
};
|
||||
|
||||
vibration_motor {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&tca9535 7 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_OUTPUT_LOW>;
|
||||
};
|
||||
|
||||
ir_leds {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&gpio0 12 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_OUTPUT_LOW>;
|
||||
};
|
||||
|
||||
red_led {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&gpio0 13 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_OUTPUT_LOW>;
|
||||
};
|
||||
|
||||
green_led {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&tca9535 9 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_OUTPUT_LOW>;
|
||||
};
|
||||
|
||||
blue_led {
|
||||
compatible = "tactility,gpio-hog";
|
||||
compatible = "gpio-hog";
|
||||
pin = <&tca9535 13 GPIO_FLAG_NONE>;
|
||||
mode = <GPIO_HOG_MODE_OUTPUT_LOW>;
|
||||
};
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
file(GLOB_RECURSE SOURCE_FILES Source/*.c*)
|
||||
file(GLOB_RECURSE SOURCE_FILES source/*.c*)
|
||||
|
||||
idf_component_register(
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility esp_lvgl_port ST7789 CST816S PwmBacklight driver
|
||||
REQUIRES TactilityKernel driver
|
||||
)
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
#include "devices/Display.h"
|
||||
|
||||
#include <Tactility/hal/Configuration.h>
|
||||
#include <PwmBacklight.h>
|
||||
|
||||
using namespace tt::hal;
|
||||
|
||||
static DeviceVector createDevices() {
|
||||
return {
|
||||
createDisplay(),
|
||||
};
|
||||
}
|
||||
|
||||
static bool initBoot() {
|
||||
return driver::pwmbacklight::init(GPIO_NUM_20, 256);
|
||||
}
|
||||
|
||||
extern const Configuration hardwareConfiguration = {
|
||||
.initBoot = initBoot,
|
||||
.createDevices = createDevices
|
||||
};
|
||||
@@ -1,32 +0,0 @@
|
||||
#include "Display.h"
|
||||
|
||||
#include <PwmBacklight.h>
|
||||
#include <St7789Display.h>
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay() {
|
||||
St7789Display::Configuration panel_configuration = {
|
||||
.horizontalResolution = LCD_HORIZONTAL_RESOLUTION,
|
||||
.verticalResolution = LCD_VERTICAL_RESOLUTION,
|
||||
.gapX = 0,
|
||||
.gapY = 0,
|
||||
.swapXY = false,
|
||||
.mirrorX = false,
|
||||
.mirrorY = false,
|
||||
.invertColor = true,
|
||||
.bufferSize = LCD_BUFFER_SIZE,
|
||||
.touch = nullptr,
|
||||
.backlightDutyFunction = driver::pwmbacklight::setBacklightDuty,
|
||||
.resetPin = GPIO_NUM_42,
|
||||
.lvglSwapBytes = false
|
||||
};
|
||||
|
||||
auto spi_configuration = std::make_shared<St7789Display::SpiConfiguration>(St7789Display::SpiConfiguration {
|
||||
.spiHostDevice = SPI2_HOST,
|
||||
.csPin = GPIO_NUM_39,
|
||||
.dcPin = GPIO_NUM_38,
|
||||
.pixelClockFrequency = 62'500'000,
|
||||
.transactionQueueDepth = 10
|
||||
});
|
||||
|
||||
return std::make_shared<St7789Display>(panel_configuration, spi_configuration);
|
||||
}
|
||||
@@ -1,10 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
|
||||
constexpr auto LCD_HORIZONTAL_RESOLUTION = 240;
|
||||
constexpr auto LCD_VERTICAL_RESOLUTION = 240;
|
||||
constexpr auto LCD_BUFFER_HEIGHT = LCD_VERTICAL_RESOLUTION / 3;
|
||||
constexpr auto LCD_BUFFER_SIZE = LCD_HORIZONTAL_RESOLUTION * LCD_BUFFER_HEIGHT;
|
||||
@@ -14,6 +14,8 @@ hardware.tinyUsb=true
|
||||
hardware.esptoolFlashFreq=120M
|
||||
hardware.bluetooth=true
|
||||
|
||||
dependencies.useDeprecatedHal=false
|
||||
|
||||
storage.userDataLocation=SD
|
||||
|
||||
display.size=1.3"
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
dependencies:
|
||||
- Platforms/platform-esp32
|
||||
- Drivers/qmi8658-module
|
||||
- Drivers/st7789-module
|
||||
dts: waveshare,s3-lcd-13.dts
|
||||
|
||||
-2
@@ -3,12 +3,10 @@
|
||||
extern "C" {
|
||||
|
||||
static error_t start() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
static error_t stop() {
|
||||
// Empty for now
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,9 @@
|
||||
#include <tactility/bindings/esp32_spi.h>
|
||||
#include <bindings/qmi8658.h>
|
||||
#include <tactility/bindings/esp32_sdspi.h>
|
||||
#include <tactility/bindings/display_placeholder.h>
|
||||
#include <tactility/bindings/esp32_pwm_ledc.h>
|
||||
#include <tactility/bindings/pwm_backlight.h>
|
||||
#include <bindings/st7789.h>
|
||||
|
||||
// Reference: https://www.waveshare.com/wiki/ESP32-S3-LCD-1.3
|
||||
/ {
|
||||
@@ -43,6 +45,19 @@
|
||||
};
|
||||
};
|
||||
|
||||
display_backlight_pwm {
|
||||
compatible = "espressif,esp32-pwm-ledc";
|
||||
pin = <&gpio0 20 GPIO_FLAG_NONE>;
|
||||
period-ns = <33333>;
|
||||
ledc-timer = <0>;
|
||||
ledc-channel = <0>;
|
||||
};
|
||||
|
||||
display_backlight {
|
||||
compatible = "pwm-backlight";
|
||||
pwm = <&display_backlight_pwm>;
|
||||
};
|
||||
|
||||
spi0 {
|
||||
compatible = "espressif,esp32-spi";
|
||||
host = <SPI2_HOST>;
|
||||
@@ -50,8 +65,15 @@
|
||||
pin-mosi = <&gpio0 41 GPIO_FLAG_NONE>;
|
||||
pin-sclk = <&gpio0 40 GPIO_FLAG_NONE>;
|
||||
|
||||
display {
|
||||
compatible = "display-placeholder";
|
||||
display@0 {
|
||||
compatible = "sitronix,st7789";
|
||||
horizontal-resolution = <240>;
|
||||
vertical-resolution = <240>;
|
||||
invert-color;
|
||||
pixel-clock-hz = <62500000>;
|
||||
pin-dc = <&gpio0 38 GPIO_FLAG_NONE>;
|
||||
pin-reset = <&gpio0 42 GPIO_FLAG_NONE>;
|
||||
backlight = <&display_backlight>;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
idf_component_register(
|
||||
SRC_DIRS "Source"
|
||||
INCLUDE_DIRS "Source"
|
||||
REQUIRES Tactility EspLcdCompat esp_lcd_ili9488 driver
|
||||
)
|
||||
@@ -1,6 +0,0 @@
|
||||
# ILI9488
|
||||
|
||||
A basic Tactility display driver for ILI9488 panels.
|
||||
|
||||
**Warning:** This driver uses 3 or 18 bits per pixel in SPI mode. This requires a software pixel conversion at runtime
|
||||
and comes with a big performance penalty. It lowers the rate of rendering and it also requires an extra display buffer.
|
||||
@@ -1,117 +0,0 @@
|
||||
#include "Ili9488Display.h"
|
||||
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <esp_lcd_ili9488.h>
|
||||
#include <esp_lcd_panel_commands.h>
|
||||
#include <esp_lvgl_port.h>
|
||||
|
||||
constexpr auto* TAG = "ILI9488";
|
||||
|
||||
bool Ili9488Display::createIoHandle(esp_lcd_panel_io_handle_t& outHandle) {
|
||||
const esp_lcd_panel_io_spi_config_t panel_io_config = {
|
||||
.cs_gpio_num = configuration->csPin,
|
||||
.dc_gpio_num = configuration->dcPin,
|
||||
.spi_mode = 0,
|
||||
.pclk_hz = configuration->pixelClockFrequency,
|
||||
.trans_queue_depth = configuration->transactionQueueDepth,
|
||||
.on_color_trans_done = nullptr,
|
||||
.user_ctx = nullptr,
|
||||
.lcd_cmd_bits = 8,
|
||||
.lcd_param_bits = 8,
|
||||
.cs_ena_pretrans = 0,
|
||||
.cs_ena_posttrans = 0,
|
||||
.flags = {
|
||||
.dc_high_on_cmd = 0,
|
||||
.dc_low_on_data = 0,
|
||||
.dc_low_on_param = 0,
|
||||
.octal_mode = 0,
|
||||
.quad_mode = 0,
|
||||
.sio_mode = 0,
|
||||
.lsb_first = 0,
|
||||
.cs_high_active = 0
|
||||
}
|
||||
};
|
||||
|
||||
return esp_lcd_new_panel_io_spi(configuration->spiHostDevice, &panel_io_config, &outHandle) == ESP_OK;
|
||||
}
|
||||
|
||||
bool Ili9488Display::createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) {
|
||||
|
||||
const esp_lcd_panel_dev_config_t panel_config = {
|
||||
.reset_gpio_num = configuration->resetPin,
|
||||
.rgb_ele_order = LCD_RGB_ELEMENT_ORDER_BGR,
|
||||
.data_endian = LCD_RGB_DATA_ENDIAN_LITTLE,
|
||||
.bits_per_pixel = 18,
|
||||
.flags = {
|
||||
.reset_active_high = false
|
||||
},
|
||||
.vendor_config = nullptr
|
||||
};
|
||||
|
||||
if (esp_lcd_new_panel_ili9488(ioHandle, &panel_config, configuration->bufferSize, &panelHandle) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to create panel");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (esp_lcd_panel_reset(panelHandle) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to reset panel");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (esp_lcd_panel_init(panelHandle) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to init panel");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (esp_lcd_panel_swap_xy(panelHandle, configuration->swapXY) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to swap XY ");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (esp_lcd_panel_mirror(panelHandle, configuration->mirrorX, configuration->mirrorY) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to set panel to mirror");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (esp_lcd_panel_invert_color(panelHandle, configuration->invertColor) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to set panel to invert");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (esp_lcd_panel_disp_on_off(panelHandle, true) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to turn display on");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
lvgl_port_display_cfg_t Ili9488Display::getLvglPortDisplayConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) {
|
||||
return {
|
||||
.io_handle = ioHandle,
|
||||
.panel_handle = panelHandle,
|
||||
.control_handle = nullptr,
|
||||
.buffer_size = configuration->bufferSize,
|
||||
.double_buffer = false,
|
||||
.trans_size = 0,
|
||||
.hres = configuration->horizontalResolution,
|
||||
.vres = configuration->verticalResolution,
|
||||
.monochrome = false,
|
||||
.rotation = {
|
||||
.swap_xy = configuration->swapXY,
|
||||
.mirror_x = configuration->mirrorX,
|
||||
.mirror_y = configuration->mirrorY,
|
||||
},
|
||||
.color_format = LV_COLOR_FORMAT_RGB565,
|
||||
.flags = {
|
||||
.buff_dma = true,
|
||||
.buff_spiram = false,
|
||||
.sw_rotate = false,
|
||||
.swap_bytes = false,
|
||||
.full_refresh = false,
|
||||
.direct_mode = false
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include <Tactility/hal/display/DisplayDevice.h>
|
||||
#include <driver/spi_common.h>
|
||||
|
||||
#include <EspLcdDisplay.h>
|
||||
|
||||
#include <driver/gpio.h>
|
||||
#include <functional>
|
||||
#include <lvgl.h>
|
||||
|
||||
class Ili9488Display final : public EspLcdDisplay {
|
||||
|
||||
public:
|
||||
|
||||
class Configuration {
|
||||
|
||||
public:
|
||||
|
||||
Configuration(
|
||||
spi_host_device_t spiHostDevice,
|
||||
gpio_num_t csPin,
|
||||
gpio_num_t dcPin,
|
||||
unsigned int horizontalResolution,
|
||||
unsigned int verticalResolution,
|
||||
std::shared_ptr<tt::hal::touch::TouchDevice> touch,
|
||||
bool swapXY = false,
|
||||
bool mirrorX = false,
|
||||
bool mirrorY = false,
|
||||
bool invertColor = false,
|
||||
uint32_t bufferSize = 0 // Size in pixel count. 0 means default, which is 1/10 of the screen size
|
||||
) : spiHostDevice(spiHostDevice),
|
||||
csPin(csPin),
|
||||
dcPin(dcPin),
|
||||
horizontalResolution(horizontalResolution),
|
||||
verticalResolution(verticalResolution),
|
||||
swapXY(swapXY),
|
||||
mirrorX(mirrorX),
|
||||
mirrorY(mirrorY),
|
||||
invertColor(invertColor),
|
||||
bufferSize(bufferSize),
|
||||
touch(std::move(touch)) {
|
||||
if (this->bufferSize == 0) {
|
||||
this->bufferSize = horizontalResolution * verticalResolution / 10;
|
||||
}
|
||||
}
|
||||
|
||||
spi_host_device_t spiHostDevice;
|
||||
gpio_num_t csPin;
|
||||
gpio_num_t dcPin;
|
||||
gpio_num_t resetPin = GPIO_NUM_NC;
|
||||
unsigned int pixelClockFrequency = 40'000'000; // Hertz
|
||||
size_t transactionQueueDepth = 10;
|
||||
unsigned int horizontalResolution;
|
||||
unsigned int verticalResolution;
|
||||
bool swapXY = false;
|
||||
bool mirrorX = false;
|
||||
bool mirrorY = false;
|
||||
bool invertColor = false;
|
||||
uint32_t bufferSize = 0; // Size in pixel count. 0 means default, which is 1/10 of the screen size
|
||||
std::shared_ptr<tt::hal::touch::TouchDevice> touch;
|
||||
std::function<void(uint8_t)> _Nullable backlightDutyFunction = nullptr;
|
||||
};
|
||||
|
||||
private:
|
||||
|
||||
std::unique_ptr<Configuration> configuration;
|
||||
|
||||
bool createIoHandle(esp_lcd_panel_io_handle_t& outHandle) override;
|
||||
|
||||
bool createPanelHandle(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t& panelHandle) override;
|
||||
|
||||
lvgl_port_display_cfg_t getLvglPortDisplayConfig(esp_lcd_panel_io_handle_t ioHandle, esp_lcd_panel_handle_t panelHandle) override;
|
||||
|
||||
public:
|
||||
|
||||
explicit Ili9488Display(std::unique_ptr<Configuration> inConfiguration) :
|
||||
configuration(std::move(inConfiguration)
|
||||
) {
|
||||
assert(configuration != nullptr);
|
||||
}
|
||||
|
||||
std::string getName() const override { return "ILI9488"; }
|
||||
|
||||
std::string getDescription() const override { return "ILI9488 display"; }
|
||||
|
||||
std::shared_ptr<tt::hal::touch::TouchDevice> _Nullable getTouchDevice() override { return configuration->touch; }
|
||||
|
||||
void setBacklightDuty(uint8_t backlightDuty) override {
|
||||
if (configuration->backlightDutyFunction != nullptr) {
|
||||
configuration->backlightDutyFunction(backlightDuty);
|
||||
}
|
||||
}
|
||||
|
||||
bool supportsBacklightDuty() const override { return configuration->backlightDutyFunction != nullptr; }
|
||||
};
|
||||
|
||||
std::shared_ptr<tt::hal::display::DisplayDevice> createDisplay();
|
||||
@@ -105,22 +105,27 @@ static error_t start(Device* device) {
|
||||
static error_t stop(Device* device) {
|
||||
auto* internal = static_cast<Cst816sInternal*>(device_get_driver_data(device));
|
||||
|
||||
bool ok = true;
|
||||
|
||||
// esp_lcd_touch_del() only releases the touch-side resources; the panel IO handle is owned
|
||||
// separately and needs its own deletion.
|
||||
if (internal->touch_handle != nullptr) {
|
||||
if (esp_lcd_touch_del(internal->touch_handle) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to delete touch handle");
|
||||
ok = false;
|
||||
return ERROR_RESOURCE;
|
||||
}
|
||||
internal->touch_handle = nullptr;
|
||||
}
|
||||
|
||||
if (internal->io_handle != nullptr) {
|
||||
if (esp_lcd_panel_io_del(internal->io_handle) != ESP_OK) {
|
||||
LOG_E(TAG, "Failed to delete panel IO handle");
|
||||
ok = false;
|
||||
return ERROR_RESOURCE;
|
||||
}
|
||||
internal->io_handle = nullptr;
|
||||
}
|
||||
|
||||
free(internal);
|
||||
return ok ? ERROR_NONE : ERROR_RESOURCE;
|
||||
device_set_driver_data(device, nullptr);
|
||||
return ERROR_NONE;
|
||||
}
|
||||
|
||||
// endregion
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
cmake_minimum_required(VERSION 3.20)
|
||||
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/../../Buildscripts/module.cmake")
|
||||
|
||||
file(GLOB_RECURSE SOURCE_FILES "source/*.c*")
|
||||
|
||||
tactility_add_module(ft5x06-module
|
||||
SRCS ${SOURCE_FILES}
|
||||
INCLUDE_DIRS include/
|
||||
REQUIRES TactilityKernel platform-esp32 esp_lcd_touch_ft5x06 esp_lcd driver
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user