Skip to content

Conversation

@hemonu
Copy link

@hemonu hemonu commented Dec 8, 2025

Fix for lcd_bus to make it available for rp2 port:

I have tested it for an ili9341 display with xpt2046 touch via SPI and
an ili9486 display without touch via 16 bit i80 bus.

Main changes:

micropy_updates/common/mp_spi_common.h:
Separate definition for bus/device for ESP32 port and common (other) ports to make it compatible with machine_spi.c in micropy_updates/rp2

ext_mod/lcd_bus/common_include/spi_bus.h and i80_bus.h:
buffer_flags in struct definition, as otherwise the pointers are no more aligned

ext_mod/lcd_bus/common_src/spi_bus.c:
as a spi device is already given to the constructor for the creation of the mp_lcd_spi_bus_obj, I have eliminated that from the
s_spi_init function and use the already existing bus.
Workaround for the different naming for the SPI device inside machine_spi.c and this file

ext_mod/lcd_bus_common_src/i80_bus.c:
NULL pointer in the code for CMD sending eliminated
code for parameter sending corrected for all 4 possible combinations of parameter_bits and bus_width

I tried to compile also for STM32, but it first failed because "LV_USE_TINY_TTF" was redefined. When I corrected that I got many errors like this:

build-STM32F439/lv_mpy.c:36775:17: error: 'mp_lv_funcptr_lv_iter_next_cb' defined but not used [-Werror=unused-function]
36775 | static mp_obj_t mp_lv_funcptr_lv_iter_next_cb(void *func){ return mp_lv_funcptr(&mp_funcptr_lv_iter_next_cb_mpobj, func, NULL, MP_QSTR_, NULL); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~

So I gave up. But at least the bitbang i80_bus should work for stm32 too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant