Comments (21)
Hi @ndunello,
About the change on .pin_bit_mask
i think this is better:
diff --git a/components/lvgl_esp32_drivers/lvgl_touch/xpt2046.c b/components/lvgl_esp32_drivers/lvgl_touch/xpt2046.c
index 6425030..2c1901b 100644
--- a/components/lvgl_esp32_drivers/lvgl_touch/xpt2046.c
+++ b/components/lvgl_esp32_drivers/lvgl_touch/xpt2046.c
@@ -52,7 +52,7 @@ uint8_t avg_last;
void xpt2046_init(void)
{
gpio_config_t irq_config = {
- .pin_bit_mask = 1UL << XPT2046_IRQ,
+ .pin_bit_mask = BIT64(XPT2046_IRQ),
.mode = GPIO_MODE_INPUT,
.pull_up_en = GPIO_PULLUP_DISABLE,
.pull_down_en = GPIO_PULLDOWN_DISABLE,
Thanks for the report, I will try to replicate it later today, were you using 30cc022?. What SPI were you using?
What do you mean by the touch doesn't work
? Does the touch is not calibrated? You touch the screen but it doesn't do anything?
Regards
from lv_port_esp32.
Hi @C47D,
I use HSPI_HOST.
About "30cc022", forgive me, but I can't answer. how do i get it?
Yesterday I downloaded master "zip" file from the repository.
Regards
from lv_port_esp32.
About "30cc022", forgive me, but I can't answer. how do i get it?
Yesterday I downloaded master "zip" file from the repository.
30cc022 is the commit you're working on, if you downloaded master zip file then yes, you're using 30cc022 :), please let me test it later today and see why the touch controller isn't working.
from lv_port_esp32.
I found a problem in xpt2046_init function in xpt2046.c file.
I modified
.pin_bit_mask = 1UL << XPT2046_IRQ,
to
.pin_bit_mask = 1ULL << XPT2046_IRQ,
This issue is solved with 5dfc897.
I wired up the ILI9341 based display I have at hand and couldn´t make the IRQ pin signal of the touch sensor go low when I touch the screen, it only worked once and then I couldn't get it working again, do you also have this issue? Is it a known problem?
from lv_port_esp32.
I wired up the ILI9341 based display I have at hand and couldn´t make the IRQ pin signal of the touch sensor go low when I touch the screen, it only worked once and then I couldn't get it working again, do you also have this issue? Is it a known problem?
Same here.
In my case it only works in this sequence:
- board must be disconnected for few seconds (around 30s)
- connect the board to computer (do not touch display)
- flash new program to the board (even if there are no changes)
- everything works well
But if you reset the board or disconnect the power and than reconnect it again it works only for one click.
from lv_port_esp32.
Hi,
I will try your sequence, yesterday I ended up searching the problem on arduino forums and found nothing related, do you think this is an issue with the touch controller or maybe we're configuring wrong the IRQ pin on the esp32 side?
from lv_port_esp32.
Commit 0de169d
works fine for me (i am not testing on shared SPI).
I am still trying to figure out what could be the cause of the problem.
from lv_port_esp32.
I can try bisecting until find the faulty commit.
This lines aren't commented out on 0de169d
https://github.com/littlevgl/lv_port_esp32/blob/5dfc897a3769380869014d132dc3b62f064ab4f2/components/lvgl_esp32_drivers/lvgl_tft/disp_spi.c#L135-L136
from lv_port_esp32.
I think I found the solution with the help of logic analyzer. The problem was in tp_spi.c
file. SPI configuration was set to full duplex mode and the attempt to set it to SPI_DEVICE_HALFDUPLEX
in spi_transaction_t
instead in spi_device_interface_config_t
.
The two functions i changed.
void tp_spi_add_device(spi_host_device_t host)
{
spi_device_interface_config_t devcfg={
#if CONFIG_LVGL_TOUCH_CONTROLLER == TOUCH_CONTROLLER_STMPE610
.clock_speed_hz=1*1000*1000, //Clock out at 1 MHz
.mode=1, //SPI mode 1
#else
.clock_speed_hz=2*1000*1000, //Clock out at 2 MHz
.mode=0, //SPI mode 0
#endif
.spics_io_num=TP_SPI_CS, //CS pin
.queue_size=1,
.pre_cb=NULL,
.post_cb=NULL,
.command_bits = 8,
.address_bits = 0,
.dummy_bits = 0,
.flags = SPI_DEVICE_HALFDUPLEX | SPI_DEVICE_NO_DUMMY,
};
//Attach the Touch controller to the SPI bus
tp_spi_add_device_config(host, &devcfg);
}
and
void tp_spi_read_reg(uint8_t reg, uint8_t* data, uint8_t byte_count)
{
spi_transaction_t t;
// spi_transaction_ext_t et;
memset(&t, 0, sizeof(t));
// Read - send first byte as command
t.length = byte_count * 8 + sizeof(reg);
t.rxlength = byte_count * 8;
t.cmd = reg;
t.rx_buffer = data;
t.flags = 0;
esp_err_t ret = spi_device_transmit(spi, &t);
assert(ret == ESP_OK);
}
I noticed that tp_spi_write_reg()
function also has this error.
from lv_port_esp32.
@bzgec I've added your modifications to this branch https://github.com/littlevgl/lv_port_esp32/tree/fix_70 could you test it? I didn't had time to solve the IRQ pin working only once.
from lv_port_esp32.
I was too fast and made a mistake.
t.length = byte_count * 8 + sizeof(reg);
should be changed to
t.length = (byte_count + sizeof(reg)) * 8;
from lv_port_esp32.
I just tried https://github.com/littlevgl/lv_port_esp32/tree/fix_70 and I can see the print of the coordinates on the console.
Now, if i touch on "Write", "List" and "Chart" tab nothing is happening. Its coordinates are (approximately in the center):
"Write": x = 104, y = 191
"List": x = 73, y = 188
"Chart": x = 45, y = 190
did I make any mistakes in the configuration?
The touch display I use is this
from lv_port_esp32.
I created the pull request to fix this:
I was too fast and made a mistake.
t.length = byte_count * 8 + sizeof(reg);
should be changed to
t.length = (byte_count + sizeof(reg)) * 8;
On branch fix_70
, it is working ok for me, but i did not test for shared SPI.
from lv_port_esp32.
"Write": x = 104, y = 191
"List": x = 73, y = 188
"Chart": x = 45, y = 190
did I make any mistakes in the configuration?
I guess that you need to change Touchpanel Configuration
.
Here is my configuration (note that i have 3.2 inch display):
from lv_port_esp32.
OK, works "almost" well.
the last problem is in partial display, as in the figure.
Display Configuration is
Touch Configurazion is
@bzgec what resolution does your 3.2 inch display have?
from lv_port_esp32.
@ndunello You have wrong configuration in the display
correct setting :-
(320) TFT display width in pixels.
(240) TFT display height in pixels.
from lv_port_esp32.
thank @pratikmokashi, you are perfectly right!
Now everything works fine
Thank you all
from lv_port_esp32.
@bzgec can you test it with shared SPI buses?
@ndunello great, is the touch working properly? Are you still using the same pinout as your first post?
from lv_port_esp32.
- yes, touch working properly!
- yes, I use same pinout as my first post (SHARED_SPI_BUS)
from lv_port_esp32.
@ndunello can you help me how to use the touch with this display?
And all the setting you used for it work.
It would be great if you can add the pins you configured
from lv_port_esp32.
@bzgec @pratikmokashi @ndunello thanks everyone for the help to close this issue :)
@pratikmokashi the pins used are listed on the first message of the issue
from lv_port_esp32.
Related Issues (20)
- Cannot build project with LVGL as component HOT 1
- SPI display drivers do not play nice with other spi devices
- esp32-s3 invalid dma channel HOT 1
- Portrait mode of demos doesn't display correctly
- The link to the forum when you write a PR/issue is incorrect HOT 1
- build with esp-idf-4.4.3 fails HOT 1
- failed to run idf.py menuconfig HOT 3
- updated LVGL+squareline studio+ ESP32 HOT 2
- Demo on older esp-wrover-kit board ( not v4.1) HOT 2
- Display not showing the correct windows while running this example HOT 2
- Sunton ESP32-8048S070 board HOT 8
- How can I add my own components to the project
- Unable to compile on esp-idf version 5.0 HOT 4
- undefined reference to `lv_obj_set_scroll_propagation'
- Cant turn off LV_USE_FLEX
- Horizontal scrolling HOT 4
- fatal error: Arduino_H7_Video.h: No such file or directory
- ESP32C3 - non-LVGL task (temp reading) causes TFT display to go blank and stay blank on second run of task HOT 1
- ssd1306 driver
- ssd1306
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lv_port_esp32.