lvgl-micropython / lvgl_micropython

LVGL module for MicroPython
MIT License
80 stars 25 forks source link

Adapt XPT2046 driver for custom SPI #47

Closed demitrix closed 5 months ago

demitrix commented 5 months ago

Due to work done under https://github.com/kdschlosser/lvgl_micropython/issues/42 XPT2046 driver needs to be adapted to use new custom SPI implementation. Creating this issue as a place to track that progress.

kdschlosser commented 5 months ago

OK cool. I am working on it now. I am updating the lcd_bus driver so instead of passing pin numbers to it you are going to pass an spi.Bus instance to it. I am also going to do the same thing for any touch drivers that use SPI. I have to figure out a way to stall the main loop until a response is gotten form the SPI. I am thinking a lock object will do the trick but the issue there is that ends up being ESP specific python code. I have to figure out what MCU's support the threading module.

demitrix commented 5 months ago

Quite a bit of low level protocol is over my head, but I have noticed that CircuitPython has a try_lock() method of their SPI class. Might be able to lend you some insight.

kdschlosser commented 5 months ago

I have pushed some code changes is you want to give it a try. I am sure there is bound to be errors and I will fix those as we come across them. It is compiling as per the CI.

demitrix commented 5 months ago

Firmware builds. Screen is working and xpt2046 seems to init okay. Need to dig in on how to test further. Calling indev.calibrate crashes with OverflowError: overflow converting long int to machine word which I believe is related to https://github.com/kdschlosser/lvgl_micropython/discussions/43

calibrate was actually preventing me from getting to the crash. Adding

from xpt2046 import XPT2046
indev = XPT2046(spi_bus, cs=5)

Just before task handler causes a crash

D (3600) nvs: nvs_open_from_partition XPT2046_2 1
D (3600) nvs: nvs_get left 4
D (3600) nvs: nvs_get right 4
D (3600) nvs: nvs_get top 4
D (3600) nvs: nvs_get bottom 4
D (3600) spi_hal: eff: 1000, limit: 80000k(/0), 0 dummy, -1 delay
D (3610) spi_master: SPI2: New device added to CS1, effective clock: 1000kHz
D (3650) intr_alloc: Connected src 50 to int 13 (cpu 1)
main(): drop to repl
MicroPython v1.22.2-dirty on 2024-05-31; Generic ESP32S3 module with Octal-SPIRAM with ESP32S3
Type "help()" for more information.
>>> Guru Meditation Error: Core  1 panic'ed (IntegerDivideByZero). Exception was unhandled.

Core  1 register dump:
PC      : 0x420adc48  PS      : 0x00060e30  A0      : 0x820c9b50  A1      : 0x3fced3f0  
A2      : 0x00000000  A3      : 0x00000010  A4      : 0x3fced4a0  A5      : 0x00000000
A6      : 0x3c265ce4  A7      : 0x3fced3f0  A8      : 0x820adc3d  A9      : 0x3fced3c0  
A10     : 0x00000006  A11     : 0x00000002  A12     : 0x00000002  A13     : 0x00000008
A14     : 0x00000001  A15     : 0x3fced3c0  SAR     : 0x0000001a  EXCCAUSE: 0x00000006  
EXCVADDR: 0x00000000  LBEG    : 0x40056f5c  LEND    : 0x40056f72  LCOUNT  : 0xffffffff

Backtrace: 0x420adc45:0x3fced3f0 0x420c9b4d:0x3fced4a0 0x420d0909:0x3fced4d0 0x420d09cd:0x3fced4f0 0x4037b0a9:0x3fced510 0x420c9aec:0x3fced5b0 0x420d0909:0x3fced5e0 0x420d09cd:0x3fced600 0x4037b0a9:0x3fced620 0x420c9aec:0x3fced6c0 0x420d0909:0x3fced6f0 0x420d09cd:0x3fced710 0x4037b0a9:0x3fced730 0x420c9aec:0x3fced7d0 0x420d0909:0x3fced800 0x420fc6ab:0x3fced820 0x420fc6fd:0x3fced860 0x420d0909:0x3fced880 0x420270a1:0x3fced8a0 0x42051a6b:0x3fced8e0 0x42051aca:0x3fced910 0x42051a81:0x3fced960 0x420839f1:0x3fced990 0x420835e1:0x3fced9d0 0x42006bdd:0x3fceda10 0x42027f2d:0x3fceda30 0x42006d13:0x3fceda70 0x420d0909:0x3fcedab0 0x420d09cd:0x3fcedad0 0x4037b0a9:0x3fcedaf0 0x420c9aec:0x3fcedb90 0x420d0909:0x3fcedbc0 0x420fc6ab:0x3fcedbe0 0x420fc6fd:0x3fcedc20 0x420d0909:0x3fcedc40 0x420d098d:0x3fcedc60 0x420d1530:0x3fcedc90 0x420d16a5:0x3fcedd10 0x420e4c04:0x3fcedd30 0x421044ed:0x3fcedd50 0x420dd143:0x3fcedd70 0x420e4924:0x3fceddb0

ELF file SHA256: ca0687b2ae1b32a8

Rebooting...
kdschlosser commented 5 months ago

OoOO you have backtrace data. That's good. Lets decode that and see what it says.

~/.espressif/tools/xtensa-esp32s3-elf/esp-2022r1-11.2.0/xtensa-esp32s3-elf/bin/xtensa-esp32s3-elf-addr2line -fe lib/micropython/ports/esp32/build-ESP32_GENERIC_S3-SPIRAM_OCT/micropython.elf 0x420adc45:0x3fced3f0 0x420c9b4d:0x3fced4a0 0x420d0909:0x3fced4d0 0x420d09cd:0x3fced4f0 0x4037b0a9:0x3fced510 0x420c9aec:0x3fced5b0 0x420d0909:0x3fced5e0 0x420d09cd:0x3fced600 0x4037b0a9:0x3fced620 0x420c9aec:0x3fced6c0 0x420d0909:0x3fced6f0 0x420d09cd:0x3fced710 0x4037b0a9:0x3fced730 0x420c9aec:0x3fced7d0 0x420d0909:0x3fced800 0x420fc6ab:0x3fced820 0x420fc6fd:0x3fced860 0x420d0909:0x3fced880 0x420270a1:0x3fced8a0 0x42051a6b:0x3fced8e0 0x42051aca:0x3fced910 0x42051a81:0x3fced960 0x420839f1:0x3fced990 0x420835e1:0x3fced9d0 0x42006bdd:0x3fceda10 0x42027f2d:0x3fceda30 0x42006d13:0x3fceda70 0x420d0909:0x3fcedab0 0x420d09cd:0x3fcedad0 0x4037b0a9:0x3fcedaf0 0x420c9aec:0x3fcedb90 0x420d0909:0x3fcedbc0 0x420fc6ab:0x3fcedbe0 0x420fc6fd:0x3fcedc20 0x420d0909:0x3fcedc40 0x420d098d:0x3fcedc60 0x420d1530:0x3fcedc90 0x420d16a5:0x3fcedd10 0x420e4c04:0x3fcedd30 0x421044ed:0x3fcedd50 0x420dd143:0x3fcedd70 0x420e4924:0x3fceddb0

copy and paste the above line to the shell prompt. This needs to be done from the root directory of the repo. Then paste the output to me and lets see what it says.

demitrix commented 5 months ago
esp32_hw_spi_dev_comm
??:?
fun_builtin_var_call
/home/demitrix/lvgl_micropython/lib/micropython/py/objfun.c:114
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
mp_call_method_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:729
mp_execute_bytecode
/home/demitrix/lvgl_micropython/lib/micropython/py/vm.c:1042
fun_bc_call
/home/demitrix/lvgl_micropython/lib/micropython/py/objfun.c:273
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
mp_call_method_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:729
mp_execute_bytecode
/home/demitrix/lvgl_micropython/lib/micropython/py/vm.c:1042
fun_bc_call
/home/demitrix/lvgl_micropython/lib/micropython/py/objfun.c:273
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
mp_call_method_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:729
mp_execute_bytecode
/home/demitrix/lvgl_micropython/lib/micropython/py/vm.c:1042
fun_bc_call
/home/demitrix/lvgl_micropython/lib/micropython/py/objfun.c:273
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
mp_call_method_self_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/objboundmeth.c:70
bound_meth_call
/home/demitrix/lvgl_micropython/lib/micropython/py/objboundmeth.c:83
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
lv_indev_t_read_cb_callback
lv_mp.c:?
indev_read_core
lv_indev.c:?
lv_indev_read
??:?
lv_indev_read_timer_cb
??:?
lv_timer_exec
lv_timer.c:?
lv_timer_handler
??:?
lv_task_handler
lv_mp.c:?
mp_lv_task_handler
lv_mp.c:?
lv_fun_builtin_var_call
lv_mp.c:?
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
mp_call_method_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:729
mp_execute_bytecode
/home/demitrix/lvgl_micropython/lib/micropython/py/vm.c:1042
fun_bc_call
/home/demitrix/lvgl_micropython/lib/micropython/py/objfun.c:273
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
mp_call_method_self_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/objboundmeth.c:70
bound_meth_call
/home/demitrix/lvgl_micropython/lib/micropython/py/objboundmeth.c:83
mp_call_function_n_kw
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:713
mp_call_function_1
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime.c:691
mp_call_function_1_protected
/home/demitrix/lvgl_micropython/lib/micropython/py/runtime_utils.c:33
mp_sched_run_pending
/home/demitrix/lvgl_micropython/lib/micropython/py/scheduler.c:111
mp_hal_stdin_rx_chr
/home/demitrix/lvgl_micropython/lib/micropython/ports/esp32/mphalport.c:124
readline
/home/demitrix/lvgl_micropython/lib/micropython/shared/readline/readline.c:560
pyexec_friendly_repl
/home/demitrix/lvgl_micropython/lib/micropython/shared/runtime/pyexec.c:610
mp_task
/home/demitrix/lvgl_micropython/lib/micropython/ports/esp32/main.c:159
kdschlosser commented 5 months ago

OK so the error is happening in the esp32_hw_spi_dev_comm function.

kdschlosser commented 5 months ago

hey, I made some changes to how things work. I am attempting to work around the issues with the SPI. I believe this should work.

Here is some example code. Things need to be done in this exact order so don't move anything around at all. You need to set the CS and the interrupt pins for the touch IC, if applicable.

from micropython import const  # NOQA
import machine # NOQA

_WIDTH = const(320)
_HEIGHT = const(240)

_TP_FREQ = const(1_000_000)
_TP_CS = const(-1)  # CHANGE THIS TO THE CS PIN FOR THE TOUCH PANEL
_TP_INT = const(-1)  # CHANGE THIS TO THE INTERRUPT PIN FOR THE TOUCH PANEL

_SPI_HOST = const(1)
_DC_PIN = const(7)
_MOSI_PIN = const(11)
_MISO_PIN = const(13)
_SCLK_PIN = const(12)
_CS_PIN = const(10)
_RESET_PIN = const(6)
_BACKLIGHT_PIN = const(5)
_FREQ = const(40_000_000)

import lcd_bus  # NOQA

spi_bus = machine.SPI(
    _SPI_HOST,
    _TP_FREQ,
    miso=_MISO_PIN,
    mosi=_MOSI_PIN,
    sck=_SCLK_PIN,
)

display_bus = lcd_bus.SPIBus(
    dc=_DC_PIN,
    host=_SPI_HOST,
    sclk=_SCLK_PIN,
    freq=_FREQ,
    mosi=_MOSI_PIN,
    miso=_MISO_PIN,
    cs=_CS_PIN,
)

import ili9341  # NOQA

display = ili9341.ILI9341(
    data_bus=display_bus,
    display_width=_WIDTH,
    display_height=_HEIGHT,
    reset_pin=_RESET_PIN,
    backlight_pin=_BACKLIGHT_PIN,
    backlight_on_state=ili9341.STATE_HIGH,
)

display.init()
display.set_backlight(100)

import xpt2046  # NOQA

indev = xpt2046.XPT2046(spi_bus, _TP_CS, _TP_INT)

import lvgl as lv  # NOQA

scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0x000000), 0)

slider = lv.slider(scrn)
slider.set_size(_WIDTH - 50, 50)
slider.center()

import task_handler  # NOQA

th = task_handler.TaskHandler()
demitrix commented 5 months ago

Everything runs, but I can't tell if touch is doing anything, There is no console output when touching the screen. I assume at the least I should see some SPI debug output for devices locking and releasing the bus.

D (7320) gdma: new group (0) at 0x3c270ac0
D (7320) gdma: new pair (0,0) at 0x3c270b04
D (7320) gdma: new tx channel (0,0) at 0x3c270a90
D (7320) gdma: new rx channel (0,0) at 0x3c270b24
D (7320) spi: SPI2 use iomux pins.
D (7330) intr_alloc: Connected src 21 to int 12 (cpu 1)
D (7330) spi_hal: eff: 1000, limit: 80000k(/0), 0 dummy, -1 delay
D (7340) spi_master: SPI2: New device added to CS5, effective clock: 1000kHz
host=1
sclk_io_num=12
mosi_io_num=11
miso_io_num=13
quadwp_io_num=-1
quadhd_io_num=-1
cs_gpio_num=10
dc_gpio_num=7
spi_mode=0
pclk_hz=40000000
lcd_cmd_bits=8
lcd_param_bits=8
dc_low_on_data=0
sio_mode=0
lsb_first=0
cs_high_active=0
octal_mode=0
DisplayDriver: __init__
DisplayDriver: if not lv.is_initialized()
DisplayDriver: if not lv.init()
DisplayDriver: data_bus is not None
DisplayDriver: self._reset_pin = machine.Pin(reset_pin, machine.Pin.OUT)
DisplayDriver: self._backlight_pin = machine.Pin(backlight_pin, machine.Pin.OUT)
DisplayDriver: self._disp_drv = lv.display_create(display_width, display_height)
DisplayDriver: self._disp_drv.set_color_format(color_space)
DisplayDriver: self._disp_drv.set_driver_data(self)
DisplayDriver: frame_buffer1 is None
DisplayDriver: frame_buffer1 = data_bus.allocate_framebuffer(buf_size, flags)
lcd_panel_io_allocate_framebuffer(self, size=15360, caps=2056)
DisplayDriver: frame_buffer2 = data_bus.allocate_framebuffer(buf_size, flags)
lcd_panel_io_allocate_framebuffer(self, size=15360, caps=2056)
DisplayDriver: data_bus.init()
spi_init(self, width=240, height=320, bpp=16, buffer_size=15360, rgb565_byte_swap=1)
rgb565_byte_swap=1
trans_queue_depth=10
max_transfer_sz=15360
dma_chan=3
E (7520) spi: spi_bus_initialize(758): SPI bus already initialized.
D (7530) spi_hal: eff: 40000, limit: 80000k(/0), 0 dummy, -1 delay
D (7530) spi_master: SPI2: New device added to CS0, effective clock: 40000kHz
I (7540) gpio: GPIO[7]| InputEn: 0| OutputEn: 1| OpenDrain: 0| Pullup: 0| Pulldown: 0| Intr:0 
D (7550) lcd_panel.io.spi: new spi lcd panel io @0x3fcee95c, max_trans_bytes: 4092
DisplayDriver: self._disp_drv.set_flush_cb(self._flush_cb)
DisplayDriver: self._disp_drv.set_buffers()
DisplayDriver: data_bus.register_callback(self._flush_ready_cb)
DisplayDriver: self.set_default()
DisplayDriver: self._disp_drv.add_event_cb(self._on_size_change, lv.EVENT.RESOLUTION_CHANGED, None)
lcd_panel_io_tx_param(self, lcd_cmd=239, param, param_size=3)
D (7590) spi_master: device0 locked the bus
D (7590) spi_master: Allocate TX buffer for DMA
D (7600) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=207, param, param_size=3)
D (7610) spi_master: device0 locked the bus
D (7610) spi_master: Allocate TX buffer for DMA
D (7620) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=237, param, param_size=4)
D (7630) spi_master: device0 locked the bus
D (7630) spi_master: Allocate TX buffer for DMA
D (7640) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=232, param, param_size=3)
D (7650) spi_master: device0 locked the bus
D (7650) spi_master: Allocate TX buffer for DMA
D (7650) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=203, param, param_size=5)
D (7660) spi_master: device0 locked the bus
D (7670) spi_master: Allocate TX buffer for DMA
D (7670) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=247, param, param_size=1)
D (7680) spi_master: device0 locked the bus
D (7690) spi_master: Allocate TX buffer for DMA
D (7690) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=234, param, param_size=2)
D (7700) spi_master: device0 locked the bus
D (7700) spi_master: Allocate TX buffer for DMA
D (7710) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=192, param, param_size=1)
D (7720) spi_master: device0 locked the bus
D (7720) spi_master: Allocate TX buffer for DMA
D (7730) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=193, param, param_size=1)
D (7740) spi_master: device0 locked the bus
D (7740) spi_master: Allocate TX buffer for DMA
D (7750) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=197, param, param_size=2)
D (7760) spi_master: device0 locked the bus
D (7760) spi_master: Allocate TX buffer for DMA
D (7760) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=199, param, param_size=1)
D (7770) spi_master: device0 locked the bus
D (7780) spi_master: Allocate TX buffer for DMA
D (7780) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=54, param, param_size=1)
D (7790) spi_master: device0 locked the bus
D (7800) spi_master: Allocate TX buffer for DMA
D (7800) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=58, param, param_size=1)
D (7810) spi_master: device0 locked the bus
D (7810) spi_master: Allocate TX buffer for DMA
D (7820) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=177, param, param_size=2)
D (7830) spi_master: device0 locked the bus
D (7830) spi_master: Allocate TX buffer for DMA
D (7840) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=182, param, param_size=3)
D (7850) spi_master: device0 locked the bus
D (7850) spi_master: Allocate TX buffer for DMA
D (7860) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=242, param, param_size=1)
D (7870) spi_master: device0 locked the bus
D (7870) spi_master: Allocate TX buffer for DMA
D (7870) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=38, param, param_size=1)
D (7880) spi_master: device0 locked the bus
D (7890) spi_master: Allocate TX buffer for DMA
D (7890) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=224, param, param_size=15)
D (7900) spi_master: device0 locked the bus
D (7910) spi_master: Allocate TX buffer for DMA
D (7910) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=225, param, param_size=15)
D (7920) spi_master: device0 locked the bus
D (7920) spi_master: Allocate TX buffer for DMA
D (7930) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=17, param, param_size=0)
D (7940) spi_master: device0 locked the bus
D (7940) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=41, param, param_size=0)
D (8070) spi_master: device0 locked the bus
D (8070) spi_master: device0 release bus
D (8180) nvs: nvs_open_from_partition XPT2046_2 1
D (8180) nvs: nvs_get left 4
D (8180) nvs: nvs_get right 4
D (8180) nvs: nvs_get top 4
D (8180) nvs: nvs_get bottom 4
lcd_panel_io_tx_param(self, lcd_cmd=54, param, param_size=1)
D (8190) spi_master: device0 locked the bus
D (8200) spi_master: Allocate TX buffer for DMA
D (8200) spi_master: device0 release bus
D (8250) intr_alloc: Connected src 50 to int 13 (cpu 1)
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8300) spi_master: device0 locked the bus
D (8300) spi_master: Allocate TX buffer for DMA
D (8310) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8320) spi_master: device0 locked the bus
D (8320) spi_master: Allocate TX buffer for DMA
D (8320) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8330) spi_master: device0 locked the bus
D (8340) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8350) spi_master: device0 locked the bus
D (8350) spi_master: Allocate TX buffer for DMA
D (8360) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8370) spi_master: device0 locked the bus
D (8370) spi_master: Allocate TX buffer for DMA
D (8380) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8380) spi_master: device0 locked the bus
D (8390) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8400) spi_master: device0 locked the bus
D (8400) spi_master: Allocate TX buffer for DMA
D (8410) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8420) spi_master: device0 locked the bus
D (8420) spi_master: Allocate TX buffer for DMA
D (8430) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8440) spi_master: device0 locked the bus
D (8440) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8450) spi_master: device0 locked the bus
D (8450) spi_master: Allocate TX buffer for DMA
D (8460) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8470) spi_master: device0 locked the bus
D (8470) spi_master: Allocate TX buffer for DMA
D (8480) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8490) spi_master: device0 locked the bus
D (8490) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8500) spi_master: device0 locked the bus
D (8500) spi_master: Allocate TX buffer for DMA
D (8510) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8520) spi_master: device0 locked the bus
D (8520) spi_master: Allocate TX buffer for DMA
D (8530) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8540) spi_master: device0 locked the bus
D (8540) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8550) spi_master: device0 locked the bus
D (8550) spi_master: Allocate TX buffer for DMA
D (8560) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8570) spi_master: device0 locked the bus
D (8570) spi_master: Allocate TX buffer for DMA
D (8580) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8590) spi_master: device0 locked the bus
D (8590) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8600) spi_master: device0 locked the bus
D (8600) spi_master: Allocate TX buffer for DMA
D (8610) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8620) spi_master: device0 locked the bus
D (8620) spi_master: Allocate TX buffer for DMA
D (8630) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8640) spi_master: device0 locked the bus
D (8640) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8650) spi_master: device0 locked the bus
D (8650) spi_master: Allocate TX buffer for DMA
D (8660) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8670) spi_master: device0 locked the bus
D (8670) spi_master: Allocate TX buffer for DMA
D (8680) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8690) spi_master: device0 locked the bus
D (8690) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8700) spi_master: device0 locked the bus
D (8710) spi_master: Allocate TX buffer for DMA
D (8710) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8720) spi_master: device0 locked the bus
D (8720) spi_master: Allocate TX buffer for DMA
D (8730) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8740) spi_master: device0 locked the bus
D (8740) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=42, param, param_size=4)
D (8750) spi_master: device0 locked the bus
D (8760) spi_master: Allocate TX buffer for DMA
D (8760) spi_master: device0 release bus
lcd_panel_io_tx_param(self, lcd_cmd=43, param, param_size=4)
D (8770) spi_master: device0 locked the bus
D (8770) spi_master: Allocate TX buffer for DMA
D (8780) spi_master: device0 release bus
lcd_panel_io_tx_color(self, lcd_cmd=44, color, color_size=15360)
D (8790) spi_master: device0 locked the bus
D (8790) spi_master: device0 release bus
kdschlosser commented 5 months ago

Please copy and paste the code you are running into a post here.

kdschlosser commented 5 months ago

and are you getting anything on the display? can you see the slider being displayed when running the code?

demitrix commented 5 months ago

Yeah slider loads on the screen. I'm using the code you posted above, only I swapped height and width and added rotation.

Just tested everything with TFT_eSPI through Arduino and hardware is all good.

kdschlosser commented 5 months ago

don't add any rotation at all.

is the height and width correct if you don't change the rotation

kdschlosser commented 5 months ago

the slider might not be working because of a glitch in the rotation end of things. I just want to know at this point is the touch is working or not. I will deal with the rotation later on.

kdschlosser commented 5 months ago

I have no doubt the hardware works fine. I am working through bugs in the binding. Things are handled differently in this binding then using something like the Arduino IDE. That's because there is no DMA memory use and the espiodf port for the arduino IDE is an antique so the esp_lcd component is not being used. A lot of the code in the tft_espi library is not going to offer the best performance wise.

demitrix commented 5 months ago

PXL_20240603_145155671.MP.jpg

This is the result with no changes to code.

PXL_20240603_145335095.jpg

Flipping width and height, no rotation applied.

Touch still seems to do nothing. No console output, no response on screen.

kdschlosser commented 5 months ago

OK then that is what the native width and height are with the rotation set to 0 degrees. That is what your code should be always when you start the display.

Now.. There is still no touch inputs taking place. Are you using the interrupt pin?

demitrix commented 5 months ago

Yes, I tried with interrupt defined and set to -1. I haven't looked to see if theres any logging around the interrupt function, so I'm not sure its being caught. Tested that the pin value is flipping with a simple while loop to print pin value to insure that the pin wasn't misbehaving. Can see the pin pulled to gnd when screen it touched. Also added a print line to _on_interrupt in xpt2046.py and the function is never called.

kdschlosser commented 5 months ago

OK we are going to mess around with the driver some.

run this code to test if we get anything on the touch. The display will be blank but you should still be able to get touch input

"""XPT2046 Touch module."""
from time import sleep
from micropython import const

_WIDTH = const(240)
_HEIGHT = const(320)

_TP_FREQ = const(1_000_000)
_TP_CS = const(-1)  # CHANGE THIS TO THE CS PIN FOR THE TOUCH PANEL
_TP_INT = const(-1)  # CHANGE THIS TO THE INTERRUPT PIN FOR THE TOUCH PANEL

_SPI_HOST = const(1)
_MOSI_PIN = const(11)
_MISO_PIN = const(13)
_SCLK_PIN = const(12)

class Touch(object):
    """Serial interface for XPT2046 Touch Screen Controller."""

    # Command constants from ILI9341 datasheet
    GET_X = const(0xD0)  # X position
    GET_Y = const(0x90)  # Y position
    GET_Z1 = const(0xB0)  # Z1 position
    GET_Z2 = const(0xC0)  # Z2 position
    GET_TEMP0 = const(0x80)  # Temperature 0
    GET_TEMP1 = const(0xF0)  # Temperature 1
    GET_BATTERY = const(0xA0)  # Battery monitor
    GET_AUX = const(0xE0)  # Auxiliary input to ADC

    def __init__(self, spi, cs, int_pin=None, int_handler=None,
                 width=240, height=320,
                 x_min=100, x_max=1962, y_min=100, y_max=1900):
        """Initialize touch screen controller.

        Args:
            spi (Class Spi):  SPI interface for OLED
            cs (Class Pin):  Chip select pin
            int_pin (Class Pin):  Touch controller interrupt pin
            int_handler (function): Handler for screen interrupt
            width (int): Width of LCD screen
            height (int): Height of LCD screen
            x_min (int): Minimum x coordinate
            x_max (int): Maximum x coordinate
            y_min (int): Minimum Y coordinate
            y_max (int): Maximum Y coordinate
        """
        self.spi = spi
        self.cs = cs
        self.cs.init(self.cs.OUT, value=1)
        self.rx_buf = bytearray(3)  # Receive buffer
        self.tx_buf = bytearray(3)  # Transmit buffer
        self.width = width
        self.height = height
        # Set calibration
        self.x_min = x_min
        self.x_max = x_max
        self.y_min = y_min
        self.y_max = y_max
        self.x_multiplier = width / (x_max - x_min)
        self.x_add = x_min * -self.x_multiplier
        self.y_multiplier = height / (y_max - y_min)
        self.y_add = y_min * -self.y_multiplier

        if int_pin is not None:
            self.int_pin = int_pin
            self.int_pin.init(int_pin.IN)
            self.int_handler = int_handler
            self.int_locked = False
            int_pin.irq(trigger=int_pin.IRQ_FALLING | int_pin.IRQ_RISING,
                        handler=self.int_press)

    def get_touch(self):
        """Take multiple samples to get accurate touch reading."""
        timeout = 2  # set timeout to 2 seconds
        confidence = 5
        buff = [[0, 0] for x in range(confidence)]
        buf_length = confidence  # Require a confidence of 5 good samples
        buffptr = 0  # Track current buffer position
        nsamples = 0  # Count samples
        while timeout > 0:
            if nsamples == buf_length:
                meanx = sum([c[0] for c in buff]) // buf_length
                meany = sum([c[1] for c in buff]) // buf_length
                dev = sum([(c[0] - meanx)**2 +
                          (c[1] - meany)**2 for c in buff]) / buf_length
                if dev <= 50:  # Deviation should be under margin of 50
                    return self.normalize(meanx, meany)
            # get a new value
            sample = self.raw_touch()  # get a touch
            if sample is None:
                nsamples = 0    # Invalidate buff
            else:
                buff[buffptr] = sample  # put in buff
                buffptr = (buffptr + 1) % buf_length  # Incr, until rollover
                nsamples = min(nsamples + 1, buf_length)  # Incr. until max

            sleep(.05)
            timeout -= .05
        return None

    def int_press(self, pin):
        """Send X,Y values to passed interrupt handler."""
        if not pin.value() and not self.int_locked:
            self.int_locked = True  # Lock Interrupt
            buff = self.raw_touch()

            if buff is not None:
                x, y = self.normalize(*buff)
                self.int_handler(x, y)
            sleep(.1)  # Debounce falling edge
        elif pin.value() and self.int_locked:
            sleep(.1)  # Debounce rising edge
            self.int_locked = False  # Unlock interrupt

    def normalize(self, x, y):
        """Normalize mean X,Y values to match LCD screen."""
        x = int(self.x_multiplier * x + self.x_add)
        y = int(self.y_multiplier * y + self.y_add)
        return x, y

    def raw_touch(self):
        """Read raw X,Y touch values.

        Returns:
            tuple(int, int): X, Y
        """
        x = self.send_command(self.GET_X)
        y = self.send_command(self.GET_Y)
        if self.x_min <= x <= self.x_max and self.y_min <= y <= self.y_max:
            return (x, y)
        else:
            return None

    def send_command(self, command):
        """Write command to XT2046 (MicroPython).

        Args:
            command (byte): XT2046 command code.
        Returns:
            int: 12 bit response
        """
        self.tx_buf[0] = command
        self.cs(0)
        self.spi.write_readinto(self.tx_buf, self.rx_buf)
        self.cs(1)

        return (self.rx_buf[1] << 4) | (self.rx_buf[2] >> 4)

import machine

if _TP_INT != -1:
    i_pin = machine.Pin(_TP_INT, machine.Pin.IN)
else:
    i_pin = None

if _TP_CS != -1:
    cs_pin = machine.Pin(_TP_CS, machine.Pin.OUT)
    cs_pin.value(1)
else:
    cs_pin = None

def callback(x, y):
    print(x, y)

spi_bus = machine.SPI(_SPI_HOST, _TP_FREQ, miso=_MISO_PIN, mosi=_MOSI_PIN, sck=_SCLK_PIN)
tp = Touch(spi_bus, cs_pin, i_pin, callback, width=_WIDTH, height=_HEIGHT)
demitrix commented 5 months ago

Nothing other than the init function is called.

I lied. Possibly a bad connection or something. While it was running I reseated the int wire and that test code is working now.

Popping the original example back in to see if thats all it was.

In the original example, if I reseat the interrupt pin the event fires, no coordinates are returned but it fires. Touching the screen after results in no events.

Something weird is going on, if I upload the code with the display as main.py and reset. Interrupt is dead. If I reseat the wire, the interrupt fires, but the screen doesn't fire it. If I then upload the touch example as main.py and reset, the int doesn't work via the screen. If I reseat the wire, the int fires, and then works from the screen as well. I can even reset and not touch the wire, and the int via screen keeps working. Same behavior when choosing other pins.

kdschlosser commented 5 months ago

does your touch screen have a reset pin?

demitrix commented 5 months ago

No, its just the generic red ili9341/xpt2046 combo http://www.lcdwiki.com/2.8inch_SPI_Module_ILI9341_SKU:MSP2807

kdschlosser commented 5 months ago

ok I updates the repo again. clone it and recompile and then run it again using the code below and see if it works

from micropython import const  # NOQA
import machine # NOQA

_WIDTH = const(240) 
_HEIGHT = const(320)

_TP_FREQ = const(1_000_000)
_TP_CS = const(-1)  # CHANGE THIS TO THE CS PIN FOR THE TOUCH PANEL

_SPI_HOST = const(1)
_DC_PIN = const(7)
_MOSI_PIN = const(11)
_MISO_PIN = const(13)
_SCLK_PIN = const(12)
_CS_PIN = const(10)
_RESET_PIN = const(6)
_BACKLIGHT_PIN = const(5)
_FREQ = const(40_000_000)

import lcd_bus  # NOQA

spi_bus = machine.SPI(
    _SPI_HOST,
    _TP_FREQ,
    miso=_MISO_PIN,
    mosi=_MOSI_PIN,
    sck=_SCLK_PIN,
    cs=_TP_CS
)

display_bus = lcd_bus.SPIBus(
    dc=_DC_PIN,
    host=_SPI_HOST,
    sclk=_SCLK_PIN,
    freq=_FREQ,
    mosi=_MOSI_PIN,
    miso=_MISO_PIN,
    cs=_CS_PIN,
)

import ili9341  # NOQA

display = ili9341.ILI9341(
    data_bus=display_bus,
    display_width=_WIDTH,
    display_height=_HEIGHT,
    reset_pin=_RESET_PIN,
    backlight_pin=_BACKLIGHT_PIN,
    backlight_on_state=ili9341.STATE_HIGH,
)

display.init()
display.set_backlight(100)

import xpt2046  # NOQA

indev = xpt2046.XPT2046(spi_bus)

import lvgl as lv  # NOQA

scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0x000000), 0)

slider = lv.slider(scrn)
slider.set_size(_WIDTH - 50, 50)
slider.center()

import task_handler  # NOQA

th = task_handler.TaskHandler()
kdschlosser commented 5 months ago

I changed the code to use polling instead of interrupt based. The interrupt adds a layer of complexity that is hard to work around. So lets give this a try and see if it works.

demitrix commented 5 months ago

Small typo on line 252 of micropy_updates/esp32/machine_hw_spi.c, you have : at the end.

No-go on that. The xpt device is locking the SPI and not releasing it. D (3148) spi_master: device0 locked the bus Is the last console line, nothing gets drawn on the screen and console is unresponsive.

kdschlosser commented 5 months ago

ahh ok I forgot to free the bus.

kdschlosser commented 5 months ago

ok I just pushed a commit that should fix those issues.

ikkesia commented 5 months ago

I uploaded this latest commit and ran the code above. I get the following error

Traceback (most recent call last):
  File "task_handler.py", line 135, in _task_handler
  File "pointer_framework.py", line 63, in _read
  File "xpt2046.py", line 54, in _get_coords
AttributeError: 'module' object has no attribute 'ticks_ns' 
demitrix commented 5 months ago

Same issues here. I changed out for ticks.us() and set time to the equivalent 5000. Everything runs, I added logging to get_coords, and it is returning coords. Can't interact with the slider though, not sure if its a calibration issue, screen update issue, or something else. Might try to replcae the slider with a button and see if even a simple click registers.

kdschlosser commented 5 months ago

So you are seeing the driver respond to touches now? Correct?

If yes that is a step in the right direction and the problem isn't going to be specific to that driver anymore. I should be able to test locally now and see what is going on and if the problem is happening with other drivers.

You aren't rotating the screen are you? I know that the rotation is not working properly at the moment and that does need fixing I am trying to just get the touch working and then I will mess with why it's breaking when rotating.

demitrix commented 5 months ago

Yeah I had to throw in a print line in get_coords to catch it, but its sending back values and not Nones so its working. No rotation set, wasn't really expecting touch interactivity to work anyhow, theres calibration and other other issues at play. I need to put together a trial to make sure the screen can still update while touch is working.

kdschlosser commented 5 months ago

I am curious to know what is being recorded as the touch coordinates. Do you have an example of that?

demitrix commented 5 months ago
print(self.PRESSED, x, y)
return self.PRESSED, x, y
Just added the print statement to see under the hood. Using my displays "native" orientation image Position Approximate X Approximate Y
TL 20 295
TR 210 295
BR 210 40
BL 20 40

Each touch returns quite a set of value no matter how quickly I try to tap.

1 22 40
1 22 40
1 21 40
1 21 40
1 20 40
1 20 40
1 21 40
1 21 40
1 21 40
kdschlosser commented 5 months ago

It's not supposed to be returning values if you are not touching the display. So that's an issue I need to figure out why it is doing it.

It has to be something with setting up the touch panel. I have to dig through the data sheet for the touch IC to see how to turn off interrupt mode or how to check to see if there is touch that is actually taking place.

demitrix commented 5 months ago

It's not sending anything without touches. It seems to be working just fine.

kdschlosser commented 5 months ago

Just to confirm. When you touch the display you don't get any coordinates?

Show me the output from you moving your finger across the screen horizontally. I want to see what the coordinates are and if they are being calculated properly.

kdschlosser commented 5 months ago

I did update the driver so now it will check to see if there is a Z axis. If there is no Z axis above a certain threshold then it will not register as a touch input.

As far as a string of coordinates being generated that is fine to have happen. What happens is LVGL loops checking the touch panel and updating the display on each loop. It doesn't redraw the display on each loop it will only read the input and change values for widgets etc... I can tell it not to do this but I want to see how it performs the way that it is now. If the touch input is kind of crappy then I will tell it to exit the loop.

ste7anste7an commented 5 months ago

I tried to build the latest clean repo this morning using this command:

python3 make.py esp32 submodules clean mpy_cross BOARD=ESP32_GENERIC BOARD_VARIANT=SPIRAM DISPLAY=ili9341 INDEV=xpt2046

and I get this error:

MPY pointer_framework.py
error compiling pointer_framework.py:
Traceback (most recent call last):
  File "pointer_framework.py", line 12, in _remap
ViperTypeError: binary op  not implemented

Any suggestions what could be wrong?

kdschlosser commented 5 months ago

You need to pull the latest updates. I have fixed that issue not too long ago..

ikkesia commented 5 months ago

Error with last commit and the usual "slider" test code

Traceback (most recent call last):
  File "<stdin>", line 66, in <module>
  File "xpt2046.py", line 4, in <module>
  File "pointer_framework.py", line 4, in <module>
ImportError: no module named 'lcd_utils'
demitrix commented 5 months ago

So the new xpt2046 module doesn't work for me at all. I added a line to print coords got nothing, so I added a line to print the z value before comparing it to the threshold. That ran once and then everything hangs. I rolled xpt2046.py back to https://github.com/kdschlosser/lvgl_micropython/blob/e10678cb7feb975712e3813a18af0f368253f9a4/api_drivers/common_api_drivers/indev/xpt2046.py and ran the demo and now the slider is working.

These are the coords that I dumped for sliding the slider back and forth once.

Coords ``` 1 47 182 1 46 183 1 46 182 1 46 182 1 47 182 1 46 182 1 50 183 1 46 184 1 46 184 1 46 182 1 46 182 1 46 182 1 46 182 1 46 183 1 46 182 1 46 183 1 52 183 1 46 183 1 45 183 1 45 182 1 46 182 1 46 183 1 46 183 1 46 182 1 46 182 1 46 183 1 46 183 1 47 182 1 47 182 1 46 183 1 46 182 1 46 182 1 46 182 1 46 184 1 46 183 1 45 182 1 44 182 1 46 182 1 48 182 1 47 183 1 47 182 1 48 182 1 46 182 1 49 182 1 49 182 1 48 183 1 55 181 1 55 181 1 63 179 1 64 179 1 72 180 1 73 179 1 73 179 1 83 178 1 84 178 1 92 178 1 93 177 1 93 178 1 93 178 1 94 178 1 94 178 1 95 178 1 96 177 1 96 177 1 98 177 1 99 177 1 97 177 1 98 179 1 99 177 1 101 177 1 100 177 1 101 179 1 101 177 1 102 177 1 103 178 1 107 177 1 104 177 1 105 176 1 107 176 1 107 177 1 108 177 1 109 177 1 109 177 1 110 176 1 122 176 1 134 176 1 134 176 1 135 176 1 135 176 1 137 176 1 138 176 1 138 176 1 138 177 1 139 177 1 140 176 1 140 176 1 149 174 1 150 174 1 152 173 1 151 174 1 153 174 1 153 176 1 153 173 1 158 173 1 155 173 1 154 173 1 162 172 1 155 172 1 155 172 1 156 172 1 156 172 1 157 171 1 158 170 1 160 170 1 166 168 1 168 168 1 167 168 1 170 167 1 168 167 1 168 168 1 169 167 1 170 167 1 171 166 1 171 166 1 172 167 1 172 166 1 173 166 1 174 166 1 174 165 1 175 165 1 177 164 1 176 165 1 176 165 1 176 165 1 178 164 1 178 164 1 178 164 1 179 164 1 181 164 1 180 163 1 181 163 1 182 164 1 181 164 1 183 163 1 183 164 1 192 164 1 193 164 1 194 163 1 196 163 1 194 163 1 194 163 1 195 164 1 195 163 1 197 163 1 196 163 1 197 162 1 197 163 1 198 163 1 199 164 1 200 163 1 202 162 1 200 164 1 204 163 1 203 163 1 204 165 1 204 164 1 210 165 1 211 165 1 211 166 1 214 165 1 213 165 1 213 165 1 214 165 1 214 165 1 216 165 1 214 164 1 214 165 1 214 165 1 213 165 1 214 165 1 213 165 1 216 164 1 214 165 1 213 165 1 214 166 1 213 165 1 214 166 1 212 165 1 213 165 1 213 165 1 212 165 1 214 166 1 204 165 1 203 165 1 202 165 1 201 165 1 201 165 1 200 165 1 197 165 1 197 165 1 195 165 1 194 165 1 192 165 1 192 165 1 190 165 1 189 165 1 188 165 1 187 165 1 186 166 1 185 166 1 185 166 1 183 165 1 181 165 1 180 166 1 179 165 1 165 165 1 164 166 1 163 165 1 102 166 1 100 166 1 100 166 1 99 166 1 79 171 1 78 171 1 79 171 1 80 168 1 56 170 1 57 170 1 54 170 1 55 170 1 55 169 1 39 169 1 40 169 1 38 169 1 39 168 1 37 168 1 37 170 1 36 169 1 37 169 1 36 170 1 36 169 1 36 169 1 35 169 1 34 169 ```
ikkesia commented 5 months ago

@demitrix didn't you have a run time error on 'lcd utils'?

demitrix commented 5 months ago

@demitrix didn't you have a run time error on 'lcd utils'?

I did not. Make sure you have a clean pull, or delete and reclone the repo.

kdschlosser commented 5 months ago

OK I rolled the driver back to that PR and fixed the ticks_ns problem.

Let me know if the slider now works properly.

kdschlosser commented 5 months ago

If the slider is working then try adding the rotate to it. You have to do this after the touch driver has been created. I am trying to set the rotation up so it is something that can be done real time. so if someone wanted to add a mems sensor to detect orientation they could and it would rotate the screen based on the device position.

demitrix commented 5 months ago
display.init()
display.set_backlight(100)

import xpt2046  # NOQA

indev = xpt2046.XPT2046(spi_bus)

import lvgl as lv  # NOQA

display.set_rotation(lv.DISPLAY_ROTATION._90)

scrn = lv.screen_active()
scrn.set_style_bg_color(lv.color_hex(0x000000), 0)

slider = lv.slider(scrn)
slider.set_size(_WIDTH - 50, 50)
slider.center()

import task_handler  # NOQA

th = task_handler.TaskHandler()

Touch is working but is not rotated. I can move the slider by sliding where it was before rotation. Also I was incorrect, the previous version of xpt2046 is reporting phantom touches. While I was typing up this reply and not touching anything. It is incredibly sporadic and I can't find anything that influences it.

1 240 0
1 466 4
1 29 1
1 180 24
1 481 0
1 2 0
1 481 0
1 481 80
1 481 0
1 119 39
1 6 0
1 119 0
1 481 310
1 25 0
1 79 4
1 320 1
1 160 39
1 5 0
1 481 0
1 0 310
1 481 0
1 119 106
1 481 0
1 3 0
1 361 19
1 29 12
1 481 0
1 129 39
1 19 0
1 1 0
1 1 0
1 4 0
1 360 0
kdschlosser commented 5 months ago

OK I updated the driver again. I added in the z axis but I used different registers and hopefully that will do the trick. I also added to it debugging output so to enable that add debug=True to the arguments when constructing the driver instance. This is going to print out the RAW data received by the driver as well as the data after it has been normalized to the display resolution and it will also include the data after rotation has been applied as well. This is going to stream a lot of data out including when the display is not touched at all.

If you can give me a copy of that data so I can check it out without any rotation being applied and also when rotation is applied that would be really helpful. I would like to see data when touching and when not touching with and without rotation,

demitrix commented 5 months ago

Phantom touches are resolved for sure. Rotation behavior remains the same. No rotation works as expected. Rotation applied and the slider responds to where it is when not rotated.

However, rotation seems like it should be working.

No rotation touching what is the native Top Right corner of the screen XPT2046(raw_x=214, raw_y=294, x=214, y=294, state=PRESSED) With rotation touching the same corner XPT2046(raw_x=215, raw_y=298, x=22, y=215, state=PRESSED)

So the coords are being transposed.

Here are dumps from both states.

No rotation ``` XPT2046(raw_x=-1, raw_y=-1, x=-1, y=-1, state=RELEASED) XPT2046_TP_DATA(x=666, y=2092, z=1409) XPT2046(raw_x=38, raw_y=163, x=38, y=163, state=PRESSED) XPT2046_TP_DATA(x=668, y=2097, z=1420) XPT2046(raw_x=38, raw_y=163, x=38, y=163, state=PRESSED) XPT2046_TP_DATA(x=667, y=2090, z=1433) XPT2046(raw_x=38, raw_y=163, x=38, y=163, state=PRESSED) XPT2046_TP_DATA(x=653, y=2102, z=1422) XPT2046(raw_x=37, raw_y=164, x=37, y=164, state=PRESSED) XPT2046_TP_DATA(x=657, y=2098, z=1417) XPT2046(raw_x=38, raw_y=163, x=38, y=163, state=PRESSED) XPT2046_TP_DATA(x=692, y=2117, z=1449) XPT2046(raw_x=40, raw_y=165, x=40, y=165, state=PRESSED) XPT2046_TP_DATA(x=701, y=2116, z=1474) XPT2046(raw_x=40, raw_y=165, x=40, y=165, state=PRESSED) XPT2046_TP_DATA(x=734, y=2137, z=1462) XPT2046(raw_x=42, raw_y=166, x=42, y=166, state=PRESSED) XPT2046_TP_DATA(x=793, y=2163, z=1485) XPT2046(raw_x=46, raw_y=168, x=46, y=168, state=PRESSED) XPT2046_TP_DATA(x=792, y=2166, z=1494) XPT2046(raw_x=46, raw_y=169, x=46, y=169, state=PRESSED) XPT2046_TP_DATA(x=837, y=2190, z=1489) XPT2046(raw_x=48, raw_y=170, x=48, y=170, state=PRESSED) XPT2046_TP_DATA(x=853, y=2197, z=1479) XPT2046(raw_x=49, raw_y=171, x=49, y=171, state=PRESSED) XPT2046_TP_DATA(x=864, y=2209, z=1501) XPT2046(raw_x=50, raw_y=172, x=50, y=172, state=PRESSED) XPT2046(raw_x=50, raw_y=172, x=50, y=172, state=RELEASED) XPT2046_TP_DATA(x=969, y=2221, z=1427) XPT2046(raw_x=56, raw_y=173, x=56, y=173, state=PRESSED) XPT2046_TP_DATA(x=955, y=2218, z=1437) XPT2046(raw_x=55, raw_y=173, x=55, y=173, state=PRESSED) XPT2046(raw_x=55, raw_y=173, x=55, y=173, state=RELEASED) XPT2046_TP_DATA(x=1118, y=2213, z=1265) XPT2046(raw_x=65, raw_y=172, x=65, y=172, state=PRESSED) XPT2046_TP_DATA(x=1141, y=2210, z=1465) XPT2046(raw_x=66, raw_y=172, x=66, y=172, state=PRESSED) XPT2046_TP_DATA(x=1177, y=2205, z=1579) XPT2046(raw_x=68, raw_y=172, x=68, y=172, state=PRESSED) XPT2046(raw_x=68, raw_y=172, x=68, y=172, state=RELEASED) XPT2046_TP_DATA(x=1224, y=2229, z=1123) XPT2046(raw_x=71, raw_y=174, x=71, y=174, state=PRESSED) XPT2046_TP_DATA(x=1258, y=2219, z=1383) XPT2046(raw_x=73, raw_y=173, x=73, y=173, state=PRESSED) XPT2046_TP_DATA(x=1283, y=2232, z=1590) XPT2046(raw_x=74, raw_y=174, x=74, y=174, state=PRESSED) XPT2046_TP_DATA(x=1285, y=2243, z=1586) XPT2046(raw_x=75, raw_y=175, x=75, y=175, state=PRESSED) XPT2046_TP_DATA(x=1293, y=2236, z=1633) XPT2046(raw_x=75, raw_y=174, x=75, y=174, state=PRESSED) XPT2046_TP_DATA(x=1302, y=2240, z=1625) XPT2046(raw_x=76, raw_y=174, x=76, y=174, state=PRESSED) XPT2046_TP_DATA(x=1334, y=2232, z=1627) XPT2046(raw_x=77, raw_y=174, x=77, y=174, state=PRESSED) XPT2046_TP_DATA(x=1346, y=2239, z=1670) XPT2046(raw_x=78, raw_y=174, x=78, y=174, state=PRESSED) XPT2046_TP_DATA(x=1362, y=2235, z=1707) XPT2046(raw_x=79, raw_y=174, x=79, y=174, state=PRESSED) XPT2046_TP_DATA(x=1395, y=2237, z=1699) XPT2046(raw_x=81, raw_y=174, x=81, y=174, state=PRESSED) XPT2046_TP_DATA(x=1439, y=2239, z=1580) XPT2046(raw_x=84, raw_y=174, x=84, y=174, state=PRESSED) XPT2046_TP_DATA(x=1446, y=2228, z=1593) XPT2046(raw_x=84, raw_y=173, x=84, y=173, state=PRESSED) XPT2046(raw_x=84, raw_y=173, x=84, y=173, state=RELEASED) XPT2046_TP_DATA(x=1682, y=2182, z=1840) XPT2046(raw_x=98, raw_y=170, x=98, y=170, state=PRESSED) XPT2046_TP_DATA(x=1700, y=2167, z=1740) XPT2046(raw_x=99, raw_y=169, x=99, y=169, state=PRESSED) XPT2046_TP_DATA(x=1725, y=2159, z=1776) XPT2046(raw_x=100, raw_y=168, x=100, y=168, state=PRESSED) XPT2046_TP_DATA(x=1735, y=2160, z=1771) XPT2046(raw_x=101, raw_y=168, x=101, y=168, state=PRESSED) XPT2046_TP_DATA(x=1767, y=2155, z=1753) XPT2046(raw_x=103, raw_y=168, x=103, y=168, state=PRESSED) XPT2046_TP_DATA(x=1761, y=2151, z=1720) XPT2046(raw_x=103, raw_y=167, x=103, y=167, state=PRESSED) XPT2046_TP_DATA(x=1789, y=2160, z=1770) XPT2046(raw_x=104, raw_y=168, x=104, y=168, state=PRESSED) XPT2046(raw_x=104, raw_y=168, x=104, y=168, state=RELEASED) XPT2046_TP_DATA(x=1889, y=2184, z=1691) XPT2046(raw_x=110, raw_y=170, x=110, y=170, state=PRESSED) XPT2046_TP_DATA(x=1902, y=2189, z=1732) XPT2046(raw_x=111, raw_y=170, x=111, y=170, state=PRESSED) XPT2046_TP_DATA(x=1934, y=2187, z=1713) XPT2046(raw_x=113, raw_y=170, x=113, y=170, state=PRESSED) XPT2046_TP_DATA(x=1989, y=2184, z=1724) XPT2046(raw_x=116, raw_y=170, x=116, y=170, state=PRESSED) XPT2046_TP_DATA(x=1994, y=2182, z=1734) XPT2046(raw_x=116, raw_y=170, x=116, y=170, state=PRESSED) XPT2046(raw_x=116, raw_y=170, x=116, y=170, state=RELEASED) XPT2046_TP_DATA(x=2118, y=2156, z=1762) XPT2046(raw_x=124, raw_y=168, x=124, y=168, state=PRESSED) XPT2046_TP_DATA(x=2127, y=2152, z=1736) XPT2046(raw_x=124, raw_y=168, x=124, y=168, state=PRESSED) XPT2046(raw_x=124, raw_y=168, x=124, y=168, state=RELEASED) XPT2046(raw_x=124, raw_y=168, x=124, y=168, state=RELEASED) XPT2046_TP_DATA(x=2335, y=2131, z=1794) XPT2046(raw_x=136, raw_y=166, x=136, y=166, state=PRESSED) XPT2046_TP_DATA(x=2358, y=2136, z=1797) XPT2046(raw_x=138, raw_y=166, x=138, y=166, state=PRESSED) XPT2046_TP_DATA(x=2394, y=2134, z=1805) XPT2046(raw_x=140, raw_y=166, x=140, y=166, state=PRESSED) XPT2046_TP_DATA(x=2394, y=2129, z=1803) XPT2046(raw_x=140, raw_y=166, x=140, y=166, state=PRESSED) XPT2046_TP_DATA(x=2431, y=2117, z=1811) XPT2046(raw_x=142, raw_y=165, x=142, y=165, state=PRESSED) XPT2046_TP_DATA(x=2436, y=2122, z=1780) XPT2046(raw_x=142, raw_y=165, x=142, y=165, state=PRESSED) XPT2046_TP_DATA(x=2442, y=2103, z=1769) XPT2046(raw_x=143, raw_y=164, x=143, y=164, state=PRESSED) XPT2046_TP_DATA(x=2460, y=2103, z=1729) XPT2046(raw_x=144, raw_y=164, x=144, y=164, state=PRESSED) XPT2046_TP_DATA(x=2459, y=2094, z=1788) XPT2046(raw_x=144, raw_y=163, x=144, y=163, state=PRESSED) XPT2046_TP_DATA(x=2488, y=2098, z=1828) XPT2046(raw_x=145, raw_y=163, x=145, y=163, state=PRESSED) XPT2046_TP_DATA(x=2498, y=2113, z=1860) XPT2046(raw_x=146, raw_y=164, x=146, y=164, state=PRESSED) XPT2046_TP_DATA(x=2516, y=2104, z=1814) XPT2046(raw_x=147, raw_y=164, x=147, y=164, state=PRESSED) XPT2046_TP_DATA(x=2560, y=2105, z=1834) XPT2046(raw_x=150, raw_y=164, x=150, y=164, state=PRESSED) XPT2046_TP_DATA(x=2578, y=2111, z=1815) XPT2046(raw_x=151, raw_y=164, x=151, y=164, state=PRESSED) XPT2046_TP_DATA(x=2553, y=2113, z=1829) XPT2046(raw_x=149, raw_y=164, x=149, y=164, state=PRESSED) XPT2046_TP_DATA(x=2595, y=2117, z=1837) XPT2046(raw_x=152, raw_y=165, x=152, y=165, state=PRESSED) XPT2046_TP_DATA(x=2609, y=2108, z=1811) XPT2046(raw_x=152, raw_y=164, x=152, y=164, state=PRESSED) XPT2046_TP_DATA(x=2623, y=2108, z=1821) XPT2046(raw_x=153, raw_y=164, x=153, y=164, state=PRESSED) XPT2046_TP_DATA(x=2634, y=2121, z=1894) XPT2046(raw_x=154, raw_y=165, x=154, y=165, state=PRESSED) XPT2046_TP_DATA(x=2682, y=2120, z=1895) XPT2046(raw_x=157, raw_y=165, x=157, y=165, state=PRESSED) XPT2046_TP_DATA(x=2674, y=2123, z=1902) XPT2046(raw_x=156, raw_y=165, x=156, y=165, state=PRESSED) XPT2046_TP_DATA(x=2676, y=2128, z=1903) XPT2046(raw_x=156, raw_y=166, x=156, y=166, state=PRESSED) XPT2046_TP_DATA(x=2715, y=2134, z=1888) XPT2046(raw_x=159, raw_y=166, x=159, y=166, state=PRESSED) XPT2046_TP_DATA(x=2769, y=2134, z=1898) XPT2046(raw_x=162, raw_y=166, x=162, y=166, state=PRESSED) XPT2046_TP_DATA(x=2819, y=2141, z=1944) XPT2046(raw_x=165, raw_y=167, x=165, y=167, state=PRESSED) XPT2046_TP_DATA(x=2856, y=2124, z=1922) XPT2046(raw_x=167, raw_y=165, x=167, y=165, state=PRESSED) XPT2046_TP_DATA(x=2859, y=2137, z=1904) XPT2046(raw_x=167, raw_y=166, x=167, y=166, state=PRESSED) XPT2046_TP_DATA(x=2909, y=2135, z=1904) XPT2046(raw_x=170, raw_y=166, x=170, y=166, state=PRESSED) XPT2046(raw_x=170, raw_y=166, x=170, y=166, state=RELEASED) XPT2046_TP_DATA(x=3026, y=2134, z=1943) XPT2046(raw_x=177, raw_y=166, x=177, y=166, state=PRESSED) XPT2046_TP_DATA(x=3043, y=2136, z=1943) XPT2046(raw_x=178, raw_y=166, x=178, y=166, state=PRESSED) XPT2046_TP_DATA(x=3034, y=2127, z=1950) XPT2046(raw_x=177, raw_y=166, x=177, y=166, state=PRESSED) XPT2046_TP_DATA(x=3047, y=2132, z=1916) XPT2046(raw_x=178, raw_y=166, x=178, y=166, state=PRESSED) XPT2046_TP_DATA(x=3066, y=2127, z=1917) XPT2046(raw_x=179, raw_y=166, x=179, y=166, state=PRESSED) XPT2046(raw_x=179, raw_y=166, x=179, y=166, state=RELEASED) XPT2046_TP_DATA(x=3094, y=2129, z=1953) XPT2046(raw_x=181, raw_y=166, x=181, y=166, state=PRESSED) XPT2046_TP_DATA(x=3124, y=2129, z=1960) XPT2046(raw_x=183, raw_y=166, x=183, y=166, state=PRESSED) XPT2046_TP_DATA(x=3170, y=2132, z=1948) XPT2046(raw_x=185, raw_y=166, x=185, y=166, state=PRESSED) XPT2046_TP_DATA(x=3163, y=2129, z=1931) XPT2046(raw_x=185, raw_y=166, x=185, y=166, state=PRESSED) XPT2046_TP_DATA(x=3207, y=2141, z=1939) XPT2046(raw_x=188, raw_y=167, x=188, y=167, state=PRESSED) XPT2046_TP_DATA(x=3227, y=2148, z=1957) XPT2046(raw_x=189, raw_y=167, x=189, y=167, state=PRESSED) XPT2046_TP_DATA(x=3277, y=2122, z=1936) XPT2046(raw_x=192, raw_y=165, x=192, y=165, state=PRESSED) XPT2046_TP_DATA(x=3296, y=2116, z=1921) XPT2046(raw_x=193, raw_y=165, x=193, y=165, state=PRESSED) XPT2046(raw_x=193, raw_y=165, x=193, y=165, state=RELEASED) XPT2046(raw_x=193, raw_y=165, x=193, y=165, state=RELEASED) XPT2046_TP_DATA(x=3497, y=2130, z=1897) XPT2046(raw_x=205, raw_y=166, x=205, y=166, state=PRESSED) XPT2046_TP_DATA(x=3516, y=2124, z=1913) XPT2046(raw_x=206, raw_y=165, x=206, y=165, state=PRESSED) XPT2046_TP_DATA(x=3539, y=2134, z=1901) XPT2046(raw_x=207, raw_y=166, x=207, y=166, state=PRESSED) XPT2046_TP_DATA(x=3552, y=2135, z=1904) XPT2046(raw_x=208, raw_y=166, x=208, y=166, state=PRESSED) XPT2046_TP_DATA(x=3566, y=2127, z=1886) XPT2046(raw_x=209, raw_y=166, x=209, y=166, state=PRESSED) XPT2046_TP_DATA(x=3584, y=2139, z=1916) XPT2046(raw_x=210, raw_y=166, x=210, y=166, state=PRESSED) XPT2046(raw_x=210, raw_y=166, x=210, y=166, state=RELEASED) XPT2046_TP_DATA(x=3648, y=2117, z=1871) XPT2046(raw_x=214, raw_y=165, x=214, y=165, state=PRESSED) XPT2046_TP_DATA(x=3637, y=2123, z=1868) XPT2046(raw_x=213, raw_y=165, x=213, y=165, state=PRESSED) XPT2046_TP_DATA(x=3675, y=2112, z=1854) XPT2046(raw_x=215, raw_y=164, x=215, y=164, state=PRESSED) XPT2046_TP_DATA(x=3681, y=2119, z=1857) XPT2046(raw_x=215, raw_y=165, x=215, y=165, state=PRESSED) XPT2046_TP_DATA(x=3700, y=2109, z=1899) XPT2046(raw_x=217, raw_y=164, x=217, y=164, state=PRESSED) XPT2046_TP_DATA(x=3699, y=2110, z=1901) XPT2046(raw_x=217, raw_y=164, x=217, y=164, state=PRESSED) XPT2046_TP_DATA(x=3696, y=2116, z=1920) XPT2046(raw_x=216, raw_y=165, x=216, y=165, state=PRESSED) XPT2046_TP_DATA(x=3690, y=2109, z=1908) XPT2046(raw_x=216, raw_y=164, x=216, y=164, state=PRESSED) XPT2046_TP_DATA(x=3682, y=2119, z=1909) XPT2046(raw_x=216, raw_y=165, x=216, y=165, state=PRESSED) XPT2046_TP_DATA(x=3736, y=2122, z=1925) XPT2046(raw_x=219, raw_y=165, x=219, y=165, state=PRESSED) XPT2046_TP_DATA(x=3757, y=2128, z=1945) XPT2046(raw_x=220, raw_y=166, x=220, y=166, state=PRESSED) XPT2046_TP_DATA(x=3774, y=2133, z=1708) XPT2046(raw_x=221, raw_y=166, x=221, y=166, state=PRESSED) XPT2046(raw_x=221, raw_y=166, x=221, y=166, state=RELEASED) XPT2046(raw_x=221, raw_y=166, x=221, y=166, state=RELEASED) XPT2046_TP_DATA(x=3628, y=2066, z=1885) XPT2046(raw_x=212, raw_y=161, x=212, y=161, state=PRESSED) XPT2046_TP_DATA(x=3606, y=2080, z=1891) XPT2046(raw_x=211, raw_y=162, x=211, y=162, state=PRESSED) XPT2046_TP_DATA(x=3575, y=2086, z=1917) XPT2046(raw_x=209, raw_y=162, x=209, y=162, state=PRESSED) XPT2046_TP_DATA(x=3555, y=2093, z=1930) XPT2046(raw_x=208, raw_y=163, x=208, y=163, state=PRESSED) XPT2046_TP_DATA(x=3547, y=2101, z=1947) XPT2046(raw_x=208, raw_y=164, x=208, y=164, state=PRESSED) XPT2046_TP_DATA(x=3559, y=2102, z=1960) XPT2046(raw_x=208, raw_y=164, x=208, y=164, state=PRESSED) XPT2046_TP_DATA(x=3542, y=2097, z=1981) XPT2046(raw_x=207, raw_y=163, x=207, y=163, state=PRESSED) XPT2046_TP_DATA(x=3552, y=2096, z=1945) XPT2046(raw_x=208, raw_y=163, x=208, y=163, state=PRESSED) XPT2046_TP_DATA(x=3546, y=2096, z=1959) XPT2046(raw_x=208, raw_y=163, x=208, y=163, state=PRESSED) XPT2046(raw_x=208, raw_y=163, x=208, y=163, state=RELEASED) XPT2046_TP_DATA(x=3373, y=2109, z=2022) XPT2046(raw_x=197, raw_y=164, x=197, y=164, state=PRESSED) XPT2046_TP_DATA(x=3338, y=2111, z=2006) XPT2046(raw_x=195, raw_y=164, x=195, y=164, state=PRESSED) XPT2046_TP_DATA(x=3263, y=2135, z=1993) XPT2046(raw_x=191, raw_y=166, x=191, y=166, state=PRESSED) XPT2046(raw_x=191, raw_y=166, x=191, y=166, state=RELEASED) XPT2046_TP_DATA(x=3093, y=2177, z=1991) XPT2046(raw_x=181, raw_y=169, x=181, y=169, state=PRESSED) XPT2046_TP_DATA(x=3059, y=2180, z=1974) XPT2046(raw_x=179, raw_y=170, x=179, y=170, state=PRESSED) XPT2046(raw_x=179, raw_y=170, x=179, y=170, state=RELEASED) XPT2046(raw_x=179, raw_y=170, x=179, y=170, state=RELEASED) XPT2046_TP_DATA(x=2825, y=2228, z=1924) XPT2046(raw_x=165, raw_y=173, x=165, y=173, state=PRESSED) XPT2046_TP_DATA(x=2803, y=2230, z=1988) XPT2046(raw_x=164, raw_y=174, x=164, y=174, state=PRESSED) XPT2046_TP_DATA(x=2689, y=2235, z=1916) XPT2046(raw_x=157, raw_y=174, x=157, y=174, state=PRESSED) XPT2046_TP_DATA(x=2693, y=2237, z=1948) XPT2046(raw_x=157, raw_y=174, x=157, y=174, state=PRESSED) XPT2046_TP_DATA(x=2592, y=2241, z=1839) XPT2046(raw_x=151, raw_y=174, x=151, y=174, state=PRESSED) XPT2046_TP_DATA(x=2574, y=2236, z=1865) XPT2046(raw_x=150, raw_y=174, x=150, y=174, state=PRESSED) XPT2046_TP_DATA(x=2507, y=2234, z=1876) XPT2046(raw_x=146, raw_y=174, x=146, y=174, state=PRESSED) XPT2046(raw_x=146, raw_y=174, x=146, y=174, state=RELEASED) XPT2046(raw_x=146, raw_y=174, x=146, y=174, state=RELEASED) XPT2046_TP_DATA(x=2015, y=2221, z=1722) XPT2046(raw_x=117, raw_y=173, x=117, y=173, state=PRESSED) XPT2046(raw_x=117, raw_y=173, x=117, y=173, state=RELEASED) XPT2046_TP_DATA(x=1881, y=2238, z=1725) XPT2046(raw_x=110, raw_y=174, x=110, y=174, state=PRESSED) XPT2046_TP_DATA(x=1883, y=2241, z=1754) XPT2046(raw_x=110, raw_y=174, x=110, y=174, state=PRESSED) XPT2046_TP_DATA(x=1845, y=2239, z=1704) XPT2046(raw_x=107, raw_y=174, x=107, y=174, state=PRESSED) XPT2046(raw_x=107, raw_y=174, x=107, y=174, state=RELEASED) XPT2046_TP_DATA(x=1555, y=2307, z=1639) XPT2046(raw_x=90, raw_y=180, x=90, y=180, state=PRESSED) XPT2046_TP_DATA(x=1540, y=2310, z=1661) XPT2046(raw_x=90, raw_y=180, x=90, y=180, state=PRESSED) XPT2046_TP_DATA(x=1455, y=2324, z=1591) XPT2046(raw_x=85, raw_y=181, x=85, y=181, state=PRESSED) XPT2046_TP_DATA(x=1431, y=2304, z=1524) XPT2046(raw_x=83, raw_y=179, x=83, y=179, state=PRESSED) XPT2046_TP_DATA(x=1372, y=2325, z=1646) XPT2046(raw_x=80, raw_y=181, x=80, y=181, state=PRESSED) XPT2046_TP_DATA(x=1350, y=2329, z=1595) XPT2046(raw_x=78, raw_y=181, x=78, y=181, state=PRESSED) XPT2046_TP_DATA(x=1387, y=2328, z=1601) XPT2046(raw_x=81, raw_y=181, x=81, y=181, state=PRESSED) XPT2046_TP_DATA(x=1351, y=2335, z=1619) XPT2046(raw_x=78, raw_y=182, x=78, y=182, state=PRESSED) XPT2046_TP_DATA(x=1361, y=2343, z=1592) XPT2046(raw_x=79, raw_y=182, x=79, y=182, state=PRESSED) XPT2046(raw_x=79, raw_y=182, x=79, y=182, state=RELEASED) XPT2046_TP_DATA(x=1185, y=2329, z=1528) XPT2046(raw_x=69, raw_y=181, x=69, y=181, state=PRESSED) XPT2046_TP_DATA(x=1174, y=2323, z=1517) XPT2046(raw_x=68, raw_y=181, x=68, y=181, state=PRESSED) XPT2046_TP_DATA(x=1127, y=2327, z=1579) XPT2046(raw_x=65, raw_y=181, x=65, y=181, state=PRESSED) XPT2046_TP_DATA(x=1078, y=2312, z=1538) XPT2046(raw_x=62, raw_y=180, x=62, y=180, state=PRESSED) XPT2046_TP_DATA(x=1051, y=2315, z=1528) XPT2046(raw_x=61, raw_y=180, x=61, y=180, state=PRESSED) XPT2046_TP_DATA(x=1003, y=2311, z=1474) XPT2046(raw_x=58, raw_y=180, x=58, y=180, state=PRESSED) XPT2046_TP_DATA(x=987, y=2323, z=1470) XPT2046(raw_x=57, raw_y=181, x=57, y=181, state=PRESSED) XPT2046_TP_DATA(x=956, y=2322, z=1474) XPT2046(raw_x=55, raw_y=181, x=55, y=181, state=PRESSED) XPT2046(raw_x=55, raw_y=181, x=55, y=181, state=RELEASED) XPT2046(raw_x=55, raw_y=181, x=55, y=181, state=RELEASED) XPT2046(raw_x=55, raw_y=181, x=55, y=181, state=RELEASED) XPT2046_TP_DATA(x=650, y=2341, z=1431) XPT2046(raw_x=37, raw_y=182, x=37, y=182, state=PRESSED) XPT2046_TP_DATA(x=629, y=2335, z=1422) XPT2046(raw_x=36, raw_y=182, x=36, y=182, state=PRESSED) XPT2046(raw_x=36, raw_y=182, x=36, y=182, state=RELEASED) XPT2046_TP_DATA(x=544, y=2324, z=1347) XPT2046(raw_x=31, raw_y=181, x=31, y=181, state=PRESSED) XPT2046_TP_DATA(x=545, y=2325, z=1378) XPT2046(raw_x=31, raw_y=181, x=31, y=181, state=PRESSED) XPT2046_TP_DATA(x=517, y=2321, z=1380) XPT2046(raw_x=29, raw_y=181, x=29, y=181, state=PRESSED) XPT2046_TP_DATA(x=505, y=2331, z=1392) XPT2046(raw_x=29, raw_y=182, x=29, y=182, state=PRESSED) XPT2046_TP_DATA(x=496, y=2322, z=1388) XPT2046(raw_x=28, raw_y=181, x=28, y=181, state=PRESSED) XPT2046_TP_DATA(x=500, y=2327, z=1388) XPT2046(raw_x=28, raw_y=181, x=28, y=181, state=PRESSED) XPT2046_TP_DATA(x=498, y=2330, z=1256) XPT2046(raw_x=28, raw_y=181, x=28, y=181, state=PRESSED) XPT2046_TP_DATA(x=496, y=2323, z=1347) XPT2046(raw_x=28, raw_y=181, x=28, y=181, state=PRESSED) XPT2046_TP_DATA(x=506, y=2318, z=1171) XPT2046(raw_x=29, raw_y=181, x=29, y=181, state=PRESSED) ```
Rotated ``` XPT2046(raw_x=22, raw_y=200, x=120, y=22, state=RELEASED) XPT2046(raw_x=22, raw_y=200, x=120, y=22, state=RELEASED) XPT2046(raw_x=22, raw_y=200, x=120, y=22, state=RELEASED) XPT2046_TP_DATA(x=655, y=2531, z=1309) XPT2046(raw_x=37, raw_y=197, x=123, y=37, state=PRESSED) XPT2046_TP_DATA(x=659, y=2526, z=1283) XPT2046(raw_x=38, raw_y=197, x=123, y=38, state=PRESSED) XPT2046_TP_DATA(x=662, y=2529, z=1285) XPT2046(raw_x=38, raw_y=197, x=123, y=38, state=PRESSED) XPT2046_TP_DATA(x=667, y=2530, z=1267) XPT2046(raw_x=38, raw_y=197, x=123, y=38, state=PRESSED) XPT2046_TP_DATA(x=661, y=2525, z=1286) XPT2046(raw_x=38, raw_y=197, x=123, y=38, state=PRESSED) XPT2046(raw_x=38, raw_y=197, x=123, y=38, state=RELEASED) XPT2046_TP_DATA(x=817, y=2563, z=1329) XPT2046(raw_x=47, raw_y=200, x=120, y=47, state=PRESSED) XPT2046_TP_DATA(x=833, y=2557, z=1361) XPT2046(raw_x=48, raw_y=199, x=121, y=48, state=PRESSED) XPT2046_TP_DATA(x=861, y=2551, z=1425) XPT2046(raw_x=50, raw_y=199, x=121, y=50, state=PRESSED) XPT2046_TP_DATA(x=988, y=2540, z=1403) XPT2046(raw_x=57, raw_y=198, x=122, y=57, state=PRESSED) XPT2046_TP_DATA(x=1030, y=2531, z=1424) XPT2046(raw_x=60, raw_y=197, x=123, y=60, state=PRESSED) XPT2046_TP_DATA(x=1091, y=2538, z=1455) XPT2046(raw_x=63, raw_y=198, x=122, y=63, state=PRESSED) XPT2046_TP_DATA(x=1129, y=2556, z=1438) XPT2046(raw_x=65, raw_y=199, x=121, y=65, state=PRESSED) XPT2046_TP_DATA(x=1174, y=2581, z=1466) XPT2046(raw_x=68, raw_y=201, x=119, y=68, state=PRESSED) XPT2046_TP_DATA(x=1185, y=2583, z=1473) XPT2046(raw_x=69, raw_y=201, x=119, y=69, state=PRESSED) XPT2046(raw_x=69, raw_y=201, x=119, y=69, state=RELEASED) XPT2046(raw_x=69, raw_y=201, x=119, y=69, state=RELEASED) XPT2046(raw_x=69, raw_y=201, x=119, y=69, state=RELEASED) XPT2046_TP_DATA(x=1719, y=2604, z=1592) XPT2046(raw_x=100, raw_y=203, x=117, y=100, state=PRESSED) XPT2046_TP_DATA(x=1726, y=2603, z=1582) XPT2046(raw_x=100, raw_y=203, x=117, y=100, state=PRESSED) XPT2046_TP_DATA(x=1835, y=2597, z=1550) XPT2046(raw_x=107, raw_y=202, x=118, y=107, state=PRESSED) XPT2046(raw_x=107, raw_y=202, x=118, y=107, state=RELEASED) XPT2046(raw_x=107, raw_y=202, x=118, y=107, state=RELEASED) XPT2046_TP_DATA(x=2169, y=2555, z=1703) XPT2046(raw_x=127, raw_y=199, x=121, y=127, state=PRESSED) XPT2046_TP_DATA(x=2191, y=2551, z=1689) XPT2046(raw_x=128, raw_y=199, x=121, y=128, state=PRESSED) XPT2046_TP_DATA(x=2212, y=2558, z=1693) XPT2046(raw_x=129, raw_y=199, x=121, y=129, state=PRESSED) XPT2046_TP_DATA(x=2291, y=2555, z=1650) XPT2046(raw_x=134, raw_y=199, x=121, y=134, state=PRESSED) XPT2046_TP_DATA(x=2309, y=2545, z=1663) XPT2046(raw_x=135, raw_y=198, x=122, y=135, state=PRESSED) XPT2046_TP_DATA(x=2328, y=2544, z=1712) XPT2046(raw_x=136, raw_y=198, x=122, y=136, state=PRESSED) XPT2046_TP_DATA(x=2354, y=2548, z=1711) XPT2046(raw_x=137, raw_y=199, x=121, y=137, state=PRESSED) XPT2046_TP_DATA(x=2402, y=2550, z=1706) XPT2046(raw_x=140, raw_y=199, x=121, y=140, state=PRESSED) XPT2046_TP_DATA(x=2476, y=2537, z=1721) XPT2046(raw_x=145, raw_y=198, x=122, y=145, state=PRESSED) XPT2046_TP_DATA(x=2522, y=2532, z=1761) XPT2046(raw_x=147, raw_y=197, x=123, y=147, state=PRESSED) XPT2046_TP_DATA(x=2585, y=2543, z=1741) XPT2046(raw_x=151, raw_y=198, x=122, y=151, state=PRESSED) XPT2046(raw_x=151, raw_y=198, x=122, y=151, state=RELEASED) XPT2046_TP_DATA(x=2728, y=2529, z=1773) XPT2046(raw_x=159, raw_y=197, x=123, y=159, state=PRESSED) XPT2046_TP_DATA(x=2721, y=2523, z=1735) XPT2046(raw_x=159, raw_y=197, x=123, y=159, state=PRESSED) XPT2046_TP_DATA(x=2798, y=2517, z=1821) XPT2046(raw_x=164, raw_y=196, x=124, y=164, state=PRESSED) XPT2046_TP_DATA(x=2797, y=2516, z=1841) XPT2046(raw_x=163, raw_y=196, x=124, y=163, state=PRESSED) XPT2046_TP_DATA(x=2859, y=2521, z=1822) XPT2046(raw_x=167, raw_y=196, x=124, y=167, state=PRESSED) XPT2046_TP_DATA(x=2881, y=2521, z=1800) XPT2046(raw_x=168, raw_y=196, x=124, y=168, state=PRESSED) XPT2046_TP_DATA(x=2940, y=2517, z=1808) XPT2046(raw_x=172, raw_y=196, x=124, y=172, state=PRESSED) XPT2046_TP_DATA(x=2965, y=2527, z=1839) XPT2046(raw_x=173, raw_y=197, x=123, y=173, state=PRESSED) XPT2046_TP_DATA(x=2989, y=2518, z=1853) XPT2046(raw_x=175, raw_y=196, x=124, y=175, state=PRESSED) XPT2046_TP_DATA(x=2980, y=2520, z=1822) XPT2046(raw_x=174, raw_y=196, x=124, y=174, state=PRESSED) XPT2046(raw_x=174, raw_y=196, x=124, y=174, state=RELEASED) XPT2046_TP_DATA(x=3229, y=2547, z=1878) XPT2046(raw_x=189, raw_y=198, x=122, y=189, state=PRESSED) XPT2046(raw_x=189, raw_y=198, x=122, y=189, state=RELEASED) XPT2046_TP_DATA(x=3312, y=2520, z=1791) XPT2046(raw_x=194, raw_y=196, x=124, y=194, state=PRESSED) XPT2046_TP_DATA(x=3334, y=2517, z=1811) XPT2046(raw_x=195, raw_y=196, x=124, y=195, state=PRESSED) XPT2046_TP_DATA(x=3344, y=2518, z=1828) XPT2046(raw_x=196, raw_y=196, x=124, y=196, state=PRESSED) XPT2046_TP_DATA(x=3354, y=2513, z=1828) XPT2046(raw_x=196, raw_y=196, x=124, y=196, state=PRESSED) XPT2046(raw_x=196, raw_y=196, x=124, y=196, state=RELEASED) XPT2046_TP_DATA(x=3480, y=2491, z=1825) XPT2046(raw_x=204, raw_y=194, x=126, y=204, state=PRESSED) XPT2046_TP_DATA(x=3476, y=2494, z=1837) XPT2046(raw_x=203, raw_y=194, x=126, y=203, state=PRESSED) XPT2046_TP_DATA(x=3466, y=2507, z=1839) XPT2046(raw_x=203, raw_y=195, x=125, y=203, state=PRESSED) XPT2046_TP_DATA(x=3494, y=2495, z=1820) XPT2046(raw_x=204, raw_y=194, x=126, y=204, state=PRESSED) XPT2046_TP_DATA(x=3529, y=2498, z=1840) XPT2046(raw_x=207, raw_y=195, x=125, y=207, state=PRESSED) XPT2046_TP_DATA(x=3516, y=2497, z=1836) XPT2046(raw_x=206, raw_y=195, x=125, y=206, state=PRESSED) XPT2046_TP_DATA(x=3560, y=2502, z=1844) XPT2046(raw_x=208, raw_y=195, x=125, y=208, state=PRESSED) XPT2046_TP_DATA(x=3544, y=2497, z=1837) XPT2046(raw_x=207, raw_y=195, x=125, y=207, state=PRESSED) XPT2046(raw_x=207, raw_y=195, x=125, y=207, state=RELEASED) XPT2046(raw_x=207, raw_y=195, x=125, y=207, state=RELEASED) XPT2046_TP_DATA(x=3753, y=2511, z=1734) XPT2046(raw_x=220, raw_y=196, x=124, y=220, state=PRESSED) XPT2046_TP_DATA(x=3752, y=2506, z=1640) XPT2046(raw_x=220, raw_y=195, x=125, y=220, state=PRESSED) XPT2046_TP_DATA(x=3803, y=2501, z=905) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=PRESSED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046(raw_x=223, raw_y=195, x=125, y=223, state=RELEASED) XPT2046_TP_DATA(x=3693, y=2578, z=1748) XPT2046(raw_x=216, raw_y=201, x=119, y=216, state=PRESSED) XPT2046_TP_DATA(x=3657, y=2576, z=1771) XPT2046(raw_x=214, raw_y=201, x=119, y=214, state=PRESSED) XPT2046_TP_DATA(x=3508, y=2610, z=1806) XPT2046(raw_x=205, raw_y=203, x=117, y=205, state=PRESSED) XPT2046_TP_DATA(x=3475, y=2609, z=1806) XPT2046(raw_x=203, raw_y=203, x=117, y=203, state=PRESSED) XPT2046(raw_x=203, raw_y=203, x=117, y=203, state=RELEASED) XPT2046_TP_DATA(x=2965, y=2626, z=1869) XPT2046(raw_x=173, raw_y=205, x=115, y=173, state=PRESSED) XPT2046_TP_DATA(x=2897, y=2631, z=1820) XPT2046(raw_x=169, raw_y=205, x=115, y=169, state=PRESSED) XPT2046_TP_DATA(x=2791, y=2645, z=1849) XPT2046(raw_x=163, raw_y=206, x=114, y=163, state=PRESSED) XPT2046_TP_DATA(x=2745, y=2649, z=1860) XPT2046(raw_x=160, raw_y=206, x=114, y=160, state=PRESSED) XPT2046_TP_DATA(x=2629, y=2679, z=1796) XPT2046(raw_x=154, raw_y=209, x=111, y=154, state=PRESSED) XPT2046_TP_DATA(x=2587, y=2681, z=1708) XPT2046(raw_x=151, raw_y=209, x=111, y=151, state=PRESSED) XPT2046_TP_DATA(x=2516, y=2711, z=1756) XPT2046(raw_x=147, raw_y=211, x=109, y=147, state=PRESSED) XPT2046_TP_DATA(x=2323, y=2738, z=1671) XPT2046(raw_x=136, raw_y=213, x=107, y=136, state=PRESSED) XPT2046_TP_DATA(x=2323, y=2758, z=1689) XPT2046(raw_x=136, raw_y=215, x=105, y=136, state=PRESSED) XPT2046(raw_x=136, raw_y=215, x=105, y=136, state=RELEASED) XPT2046(raw_x=136, raw_y=215, x=105, y=136, state=RELEASED) XPT2046_TP_DATA(x=1740, y=2798, z=1498) XPT2046(raw_x=101, raw_y=218, x=102, y=101, state=PRESSED) XPT2046_TP_DATA(x=1709, y=2798, z=1483) XPT2046(raw_x=99, raw_y=218, x=102, y=99, state=PRESSED) XPT2046_TP_DATA(x=1574, y=2811, z=1393) XPT2046(raw_x=92, raw_y=219, x=101, y=92, state=PRESSED) XPT2046_TP_DATA(x=1534, y=2837, z=1467) XPT2046(raw_x=89, raw_y=221, x=99, y=89, state=PRESSED) XPT2046_TP_DATA(x=1445, y=2861, z=1461) XPT2046(raw_x=84, raw_y=223, x=97, y=84, state=PRESSED) XPT2046_TP_DATA(x=1404, y=2869, z=1466) XPT2046(raw_x=82, raw_y=224, x=96, y=82, state=PRESSED) XPT2046_TP_DATA(x=1301, y=2875, z=1380) XPT2046(raw_x=75, raw_y=224, x=96, y=75, state=PRESSED) XPT2046_TP_DATA(x=1224, y=2877, z=1366) XPT2046(raw_x=71, raw_y=224, x=96, y=71, state=PRESSED) XPT2046_TP_DATA(x=1192, y=2876, z=1392) XPT2046(raw_x=69, raw_y=224, x=96, y=69, state=PRESSED) XPT2046_TP_DATA(x=1072, y=2902, z=1285) XPT2046(raw_x=62, raw_y=226, x=94, y=62, state=PRESSED) XPT2046_TP_DATA(x=1053, y=2899, z=1207) XPT2046(raw_x=61, raw_y=226, x=94, y=61, state=PRESSED) XPT2046_TP_DATA(x=972, y=2912, z=1261) XPT2046(raw_x=56, raw_y=227, x=93, y=56, state=PRESSED) XPT2046_TP_DATA(x=978, y=2905, z=1229) XPT2046(raw_x=56, raw_y=227, x=93, y=56, state=PRESSED) XPT2046(raw_x=56, raw_y=227, x=93, y=56, state=RELEASED) XPT2046(raw_x=56, raw_y=227, x=93, y=56, state=RELEASED) XPT2046_TP_DATA(x=708, y=2889, z=1207) XPT2046(raw_x=41, raw_y=225, x=95, y=41, state=PRESSED) XPT2046_TP_DATA(x=720, y=2873, z=1224) XPT2046(raw_x=41, raw_y=224, x=96, y=41, state=PRESSED) XPT2046_TP_DATA(x=677, y=2863, z=1198) XPT2046(raw_x=39, raw_y=223, x=97, y=39, state=PRESSED) XPT2046_TP_DATA(x=649, y=2859, z=1213) XPT2046(raw_x=37, raw_y=223, x=97, y=37, state=PRESSED) XPT2046_TP_DATA(x=626, y=2840, z=1225) XPT2046(raw_x=36, raw_y=221, x=99, y=36, state=PRESSED) XPT2046_TP_DATA(x=616, y=2834, z=1216) XPT2046(raw_x=35, raw_y=221, x=99, y=35, state=PRESSED) XPT2046_TP_DATA(x=601, y=2824, z=1184) XPT2046(raw_x=34, raw_y=220, x=100, y=34, state=PRESSED) XPT2046_TP_DATA(x=538, y=2817, z=1129) XPT2046(raw_x=31, raw_y=220, x=100, y=31, state=PRESSED) XPT2046(raw_x=31, raw_y=220, x=100, y=31, state=RELEASED) XPT2046(raw_x=31, raw_y=220, x=100, y=31, state=RELEASED) XPT2046_TP_DATA(x=294, y=2759, z=1140) XPT2046(raw_x=16, raw_y=215, x=105, y=16, state=PRESSED) XPT2046_TP_DATA(x=286, y=2743, z=1076) XPT2046(raw_x=16, raw_y=214, x=106, y=16, state=PRESSED) XPT2046_TP_DATA(x=290, y=2742, z=1161) XPT2046(raw_x=16, raw_y=214, x=106, y=16, state=PRESSED) XPT2046_TP_DATA(x=296, y=2749, z=1167) XPT2046(raw_x=16, raw_y=214, x=106, y=16, state=PRESSED) XPT2046_TP_DATA(x=305, y=2753, z=1154) XPT2046(raw_x=17, raw_y=215, x=105, y=17, state=PRESSED) XPT2046_TP_DATA(x=299, y=2753, z=1106) XPT2046(raw_x=17, raw_y=215, x=105, y=17, state=PRESSED) XPT2046(raw_x=17, raw_y=215, x=105, y=17, state=RELEASED) XPT2046_TP_DATA(x=624, y=2644, z=1305) XPT2046(raw_x=36, raw_y=206, x=114, y=36, state=PRESSED) XPT2046_TP_DATA(x=653, y=2638, z=1329) XPT2046(raw_x=37, raw_y=206, x=114, y=37, state=PRESSED) XPT2046_TP_DATA(x=754, y=2618, z=1395) XPT2046(raw_x=43, raw_y=204, x=116, y=43, state=PRESSED) XPT2046_TP_DATA(x=779, y=2616, z=1399) XPT2046(raw_x=45, raw_y=204, x=116, y=45, state=PRESSED) XPT2046_TP_DATA(x=883, y=2606, z=1472) XPT2046(raw_x=51, raw_y=203, x=117, y=51, state=PRESSED) XPT2046_TP_DATA(x=909, y=2612, z=1468) XPT2046(raw_x=52, raw_y=204, x=116, y=52, state=PRESSED) XPT2046_TP_DATA(x=985, y=2604, z=1479) XPT2046(raw_x=57, raw_y=203, x=117, y=57, state=PRESSED) XPT2046_TP_DATA(x=1127, y=2606, z=1521) XPT2046(raw_x=65, raw_y=203, x=117, y=65, state=PRESSED) XPT2046(raw_x=65, raw_y=203, x=117, y=65, state=RELEASED) XPT2046_TP_DATA(x=1404, y=2625, z=1620) XPT2046(raw_x=82, raw_y=205, x=115, y=82, state=PRESSED) XPT2046_TP_DATA(x=1455, y=2621, z=1573) XPT2046(raw_x=85, raw_y=204, x=116, y=85, state=PRESSED) XPT2046(raw_x=85, raw_y=204, x=116, y=85, state=RELEASED) XPT2046(raw_x=85, raw_y=204, x=116, y=85, state=RELEASED) XPT2046_TP_DATA(x=2281, y=2490, z=1722) XPT2046(raw_x=133, raw_y=194, x=126, y=133, state=PRESSED) XPT2046_TP_DATA(x=2292, y=2483, z=1728) XPT2046(raw_x=134, raw_y=193, x=127, y=134, state=PRESSED) XPT2046(raw_x=134, raw_y=193, x=127, y=134, state=RELEASED) XPT2046(raw_x=134, raw_y=193, x=127, y=134, state=RELEASED) XPT2046_TP_DATA(x=2742, y=2430, z=1759) XPT2046(raw_x=160, raw_y=189, x=131, y=160, state=PRESSED) XPT2046_TP_DATA(x=2790, y=2419, z=1791) XPT2046(raw_x=163, raw_y=188, x=132, y=163, state=PRESSED) XPT2046_TP_DATA(x=2894, y=2430, z=1807) XPT2046(raw_x=169, raw_y=189, x=131, y=169, state=PRESSED) XPT2046_TP_DATA(x=2917, y=2427, z=1843) XPT2046(raw_x=171, raw_y=189, x=131, y=171, state=PRESSED) XPT2046_TP_DATA(x=2975, y=2429, z=1841) XPT2046(raw_x=174, raw_y=189, x=131, y=174, state=PRESSED) XPT2046_TP_DATA(x=2979, y=2425, z=1839) XPT2046(raw_x=174, raw_y=189, x=131, y=174, state=PRESSED) XPT2046_TP_DATA(x=3006, y=2435, z=1881) XPT2046(raw_x=176, raw_y=190, x=130, y=176, state=PRESSED) XPT2046_TP_DATA(x=3060, y=2449, z=1844) XPT2046(raw_x=179, raw_y=191, x=129, y=179, state=PRESSED) XPT2046_TP_DATA(x=3042, y=2450, z=1807) XPT2046(raw_x=178, raw_y=191, x=129, y=178, state=PRESSED) XPT2046_TP_DATA(x=3051, y=2461, z=1815) XPT2046(raw_x=178, raw_y=192, x=128, y=178, state=PRESSED) XPT2046_TP_DATA(x=3105, y=2459, z=1826) XPT2046(raw_x=182, raw_y=192, x=128, y=182, state=PRESSED) XPT2046_TP_DATA(x=3111, y=2452, z=1811) XPT2046(raw_x=182, raw_y=191, x=129, y=182, state=PRESSED) XPT2046_TP_DATA(x=3141, y=2461, z=1809) XPT2046(raw_x=184, raw_y=192, x=128, y=184, state=PRESSED) XPT2046(raw_x=184, raw_y=192, x=128, y=184, state=RELEASED) XPT2046_TP_DATA(x=3323, y=2461, z=1833) XPT2046(raw_x=194, raw_y=192, x=128, y=194, state=PRESSED) XPT2046_TP_DATA(x=3348, y=2445, z=1849) XPT2046(raw_x=196, raw_y=190, x=130, y=196, state=PRESSED) XPT2046_TP_DATA(x=3414, y=2455, z=1868) XPT2046(raw_x=200, raw_y=191, x=129, y=200, state=PRESSED) XPT2046_TP_DATA(x=3442, y=2446, z=1871) XPT2046(raw_x=201, raw_y=191, x=129, y=201, state=PRESSED) XPT2046(raw_x=201, raw_y=191, x=129, y=201, state=RELEASED) XPT2046_TP_DATA(x=3653, y=2414, z=1893) XPT2046(raw_x=214, raw_y=188, x=132, y=214, state=PRESSED) XPT2046_TP_DATA(x=3652, y=2419, z=1887) XPT2046(raw_x=214, raw_y=188, x=132, y=214, state=PRESSED) XPT2046_TP_DATA(x=3681, y=2401, z=1895) XPT2046(raw_x=215, raw_y=187, x=133, y=215, state=PRESSED) XPT2046_TP_DATA(x=3664, y=2405, z=1908) XPT2046(raw_x=214, raw_y=187, x=133, y=214, state=PRESSED) XPT2046_TP_DATA(x=3684, y=2399, z=2047) XPT2046(raw_x=216, raw_y=187, x=133, y=216, state=PRESSED) XPT2046_TP_DATA(x=3688, y=2394, z=1915) XPT2046(raw_x=216, raw_y=186, x=134, y=216, state=PRESSED) XPT2046_TP_DATA(x=3702, y=2395, z=1925) XPT2046(raw_x=217, raw_y=187, x=133, y=217, state=PRESSED) XPT2046_TP_DATA(x=3698, y=2390, z=1840) XPT2046(raw_x=216, raw_y=186, x=134, y=216, state=PRESSED) XPT2046_TP_DATA(x=3687, y=2384, z=1895) XPT2046(raw_x=216, raw_y=186, x=134, y=216, state=PRESSED) XPT2046_TP_DATA(x=3726, y=2389, z=1904) XPT2046(raw_x=218, raw_y=186, x=134, y=218, state=PRESSED) XPT2046_TP_DATA(x=3713, y=2385, z=1920) XPT2046(raw_x=217, raw_y=186, x=134, y=217, state=PRESSED) XPT2046_TP_DATA(x=3756, y=2383, z=1916) XPT2046(raw_x=220, raw_y=186, x=134, y=220, state=PRESSED) XPT2046_TP_DATA(x=3751, y=2380, z=1883) XPT2046(raw_x=220, raw_y=185, x=135, y=220, state=PRESSED) XPT2046_TP_DATA(x=3786, y=2368, z=1817) XPT2046(raw_x=222, raw_y=184, x=136, y=222, state=PRESSED) XPT2046(raw_x=222, raw_y=184, x=136, y=222, state=RELEASED) XPT2046(raw_x=222, raw_y=184, x=136, y=222, state=RELEASED) XPT2046(raw_x=222, raw_y=184, x=136, y=222, state=RELEASED) XPT2046(raw_x=222, raw_y=184, x=136, y=222, state=RELEASED) ```
kdschlosser commented 5 months ago

rotated what degree?

kdschlosser commented 5 months ago

from what I am seeing is you have rotated the display 90° and the numbers are aligning properly.. if you have a native resolution of 240 x 320 and you touch the display at position 20, 200 that would translate to position 120, 20 when rotating the display 90°

What I am wondering is if LVGL is handling the change to the indev. I have to look at the code in LVGL to see what it is doing with respect to the indev drivers.