Tab5 ST7121 variant + fixes (#605)
Added the newest variant to the tab5, St7121. Fixed variant detection reliability Fixed tab5 camera WHO_AM_I failing sometimes Fixed tab5 keyboard live rotation on boot and after stopping/starting lvgl
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "devices_v2.h"
|
||||
|
||||
#include "devices_common.h"
|
||||
#include "devices_v2_v3_touch.h"
|
||||
#include "st7123_init_data.h"
|
||||
|
||||
#include <tactility/device.h>
|
||||
@@ -8,7 +9,6 @@
|
||||
#include <tactility/log.h>
|
||||
|
||||
#include <drivers/st7123.h>
|
||||
#include <drivers/st7123_touch.h>
|
||||
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
@@ -19,43 +19,6 @@ static std::vector<uint8_t> display_init_bytes;
|
||||
static St7123Config st7123_config {};
|
||||
static Device display_device {};
|
||||
|
||||
static St7123TouchConfig st7123_touch_config {};
|
||||
static Device st7123_touch_device {};
|
||||
|
||||
static void create_st7123_touch(Device* i2c0) {
|
||||
st7123_touch_device = Device {
|
||||
.address = 0,
|
||||
.name = "touch0",
|
||||
.config = nullptr,
|
||||
.parent = nullptr,
|
||||
.internal = nullptr,
|
||||
};
|
||||
|
||||
GpioPinSpec pin_interrupt = GPIO_PIN_SPEC_NONE;
|
||||
Device* gpio0 = nullptr;
|
||||
if (device_get_by_name("gpio0", &gpio0) == ERROR_NONE) {
|
||||
pin_interrupt = GpioPinSpec { gpio0, 23, GPIO_FLAG_NONE };
|
||||
device_put(gpio0);
|
||||
} else {
|
||||
LOG_W(TAG, "display_detect: gpio0 not found, touch interrupt pin will not be wired");
|
||||
}
|
||||
|
||||
st7123_touch_config = St7123TouchConfig {
|
||||
.address = 0x55, // fixed - see ESP_LCD_TOUCH_IO_I2C_ST7123_ADDRESS
|
||||
.x_max = 720,
|
||||
.y_max = 1280,
|
||||
.swap_xy = false,
|
||||
.mirror_x = false,
|
||||
.mirror_y = false,
|
||||
// Reset is pulsed via io_expander0 (detect.cpp's pulse_display_reset_pins), not a direct SoC GPIO.
|
||||
.pin_reset = GPIO_PIN_SPEC_NONE,
|
||||
.pin_interrupt = pin_interrupt,
|
||||
};
|
||||
st7123_touch_device.config = &st7123_touch_config;
|
||||
|
||||
construct_add_start(&st7123_touch_device, i2c0, "sitronix,st7123-touch");
|
||||
}
|
||||
|
||||
void tab5_create_devices_v2(Device* i2c0) {
|
||||
display_device = Device {
|
||||
.address = 0,
|
||||
|
||||
Reference in New Issue
Block a user