Replies: 5 comments 24 replies
-
| what version of that display do you have? |
Beta Was this translation helpful? Give feedback.
-
| It looks like no matter the version they use the same io expander which is the tca9535. I am in the process of making modifications to add io expanders to the firmware. I already had written a framework for it so that is already done. II have written the driver for your expander so that is also done. I also have to modify the display driver framework, the pointer framework and the 3 wire SPI so they can accept an io expander pin. The io expander framework mimics the machine.Pin framework so it is not going to be too much work to update things to be able to use it. |
Beta Was this translation helpful? Give feedback.
-
| This is my current version of this file, it still seems to only turn on the backlight: print("INITIALISING SCREEN") from micropython import const # NOQA _WIDTH = const(480) _HEIGHT = const(480) import lcd_bus # NOQA # File with custom init code from init_code import init_screen from spi3wire import Spi3Wire # NOQA import gc gc.collect() import i2c import tca9535 expander_bus = i2c.I2C.Bus(host=1, scl=40, sda=39) tca9535.Pin.set_device(i2c.I2C.Device(expander_bus, tca9535.I2C_ADDR, tca9535.BITS)) lcd_cs_pin = tca9535.Pin(tca9535.EXIO4, tca9535.Pin.OUT, value=0) lcd_rest_pin = tca9535.Pin(tca9535.EXIO5, tca9535.Pin.OUT, value=0) spi3wire = Spi3Wire( sck=41, miso=48, cs=lcd_cs_pin, cs_active_high=False, ) print("SPI WIRE DONE") display_bus = lcd_bus.RGBBus( hsync=16, vsync=17, de=18, pclk=21, data0=4, data1=3, data2=2, data3=1, data4=0, data5=10, data6=9, data7=8, data8=7, data9=6, data10=5, data11=15, data12=14, data13=13, data14=12, data15=11, freq=13 * 1000 * 1000, hsync_back_porch=50, hsync_front_porch=10, hsync_pulse_width=8, vsync_back_porch=20, vsync_front_porch=10, vsync_pulse_width=8, ) print("RGB BUS DONE") import st7701 import lvgl as lv # NOQA sz = int(_WIDTH * _HEIGHT * 2 / 10) fb1 = display_bus.allocate_framebuffer(sz, lcd_bus.MEMORY_SPIRAM) fb2 = display_bus.allocate_framebuffer(sz, lcd_bus.MEMORY_SPIRAM) print("BUFFER ALLOCATED") class CustomST7701(st7701.ST7701): def _spi_3wire_init(self, type): # NOQA # Overriding to run my version of the init sequence init_screen(self) display = CustomST7701( data_bus=display_bus, spi_3wire=spi3wire, display_width=_WIDTH, display_height=_HEIGHT, frame_buffer1=fb1, frame_buffer2=fb2, backlight_pin=45, reset_pin=lcd_rest_pin, color_space=lv.COLOR_FORMAT.RGB565, bus_shared_pins=False ) display.set_power(True) display.init(1) display.set_backlight(100) import task_handler th = task_handler.TaskHandler() scrn = lv.screen_active() scrn.set_style_bg_color(lv.color_hex(0x000000), 0) slider = lv.slider(scrn) slider.set_size(300, 50) slider.center() label = lv.label(scrn) label.set_text('HELLO WORLD!') label.align(lv.ALIGN.CENTER, 0, -50) |
Beta Was this translation helpful? Give feedback.
-
| Experimented with the new spi3wire a bit, I made a few changes to resolve some compilation issues (https://github.com/grafail/lvgl_micropython/tree/esp3wire-test), but it seems I am still not getting something except backlight. print("INITIALISING SCREEN") from micropython import const # NOQA _WIDTH = const(480) _HEIGHT = const(480) import lcd_bus # NOQA # File with custom init code from init_code import init_screen from spi3wire import Spi3Wire # NOQA import gc gc.collect() spi3wire = Spi3Wire( scl=40, sda=39, cs=4, freq=4 * 100 * 1000, spi_mode=3 ) print("SPI WIRE DONE") display_bus = lcd_bus.RGBBus( hsync=16, vsync=17, de=18, pclk=21, data0=4, data1=3, data2=2, data3=1, data4=0, data5=10, data6=9, data7=8, data8=7, data9=6, data10=5, data11=15, data12=14, data13=13, data14=12, data15=11, freq=13 * 1000 * 1000, hsync_back_porch=50, hsync_front_porch=10, hsync_pulse_width=8, vsync_back_porch=20, vsync_front_porch=10, vsync_pulse_width=8, ) print("RGB BUS DONE") import st7701 import lvgl as lv # NOQA sz = int(_WIDTH * _HEIGHT * 2 / 10) fb1 = display_bus.allocate_framebuffer(sz, lcd_bus.MEMORY_SPIRAM) fb2 = display_bus.allocate_framebuffer(sz, lcd_bus.MEMORY_SPIRAM) print("BUFFER ALLOCATED") class CustomST7701(st7701.ST7701): def _spi_3wire_init(self, type): # NOQA # Overriding to run my version of the init sequence init_screen(self) display = CustomST7701( data_bus=display_bus, spi_3wire=spi3wire, display_width=_WIDTH, display_height=_HEIGHT, frame_buffer1=fb1, frame_buffer2=fb2, backlight_pin=45, color_space=lv.COLOR_FORMAT.RGB565, bus_shared_pins=False ) display.set_power(True) display.init(1) display.set_backlight(100) import task_handler th = task_handler.TaskHandler() scrn = lv.screen_active() scrn.set_style_bg_color(lv.color_hex(0x000000), 0) slider = lv.slider(scrn) slider.set_size(300, 50) slider.center() label = lv.label(scrn) label.set_text('HELLO WORLD!') label.align(lv.ALIGN.CENTER, 0, -50)Feel this is fairly close to working, but it is quite hard to debug. I suspect |
Beta Was this translation helpful? Give feedback.
-
| Just got my hands on an indicator and would love to do some things in micropython on it. Is there a possibility to use the display from it by now? If not, no worries, I don't want to pressure anyone :-) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have a Sensecap Indicator D1(https://wiki.seeedstudio.com/SenseCAP_Indicator_Dive_into_the_Hardware/) and I am having trouble getting one of the sample scripts to work.
I have implemented a custom type to initialise ST7701 to match the sample repo of the device:
https://github.com/Seeed-Solution/SenseCAP_Indicator_ESP32/blob/c16c51a0d87abae1f86c6bdf209f45a3d12283d8/components/bsp/src/boards/lcd_panel_config.c#L854
I feel I am getting the Spi3Wire configuration wrong. It seems that the screen is on a PCA9535 expander. I am not sure if that is meant to be used with Spi3Wire or how to reference its internal port as SPI and I2C seem to be different.
Any help or pointers would be greatly appreciated. Currently only the backlight seems to turn on. I would love to get this working.
My current code:
Beta Was this translation helpful? Give feedback.
All reactions