R128适配SPI LCD+LVGL
-
硬件
- 板子: 全志R128开发板
- 屏幕:SPI LCD 1.54寸 240x240分辨率
效果演示
[Video] -
这个面包板插上去就挺好的
-
大佬能看看sys_config.fex怎么配置吗,驱动是用的nv3029s还是st7789。
-
这是我的一些笔记:
所使用的补丁:spilcd2.0.zip
![ecd799ae-c9d0-46f1-8314-65f191526151-image.png](/assets/uploads/files/1700016539588-ecd799ae-c9d0-46f1-8314-65f191526151-image.png) 修改默认clk /home/book/work/allwinner/R128-FreeRTOS/lichee/rtos-hal/hal/source/spi/common_spi.h #define SPI_MOD_CLK 40000000 /* sample mode frequency */
修改调试等级
/home/book/work/allwinner/R128-FreeRTOS/lichee/rtos-hal/hal/source/spi/hal_spi.c #define SPI_INFO_LEVEL #define SPI_DATA_LEVEL #define SPI_DUMPREG_LEVEL
修改默认DMA buffer size
/home/book/work/allwinner/R128-FreeRTOS/lichee/rtos-hal/include/hal/sunxi_hal_spi.h //#define ALIGN_DMA_BUF_SIZE (4096 + 64) #ifdef CONFIG_USE_100ASK_DISPLAY_SCREEN_240X240 #define ALIGN_DMA_BUF_SIZE ((240*240*4) + 64) #elif CONFIG_USE_100ASK_DISPLAY_SCREEN_320X480 #define ALIGN_DMA_BUF_SIZE ((320*480*4) + 64) #else #define ALIGN_DMA_BUF_SIZE (4096 + 64) #endif
修改SPI引脚配置
/home/book/work/allwinner/R128-FreeRTOS/lichee/rtos-hal/hal/source/spi/platform/spi_sun20iw2.h #define SPI1_PARAMS \ { .port = 1, \ .reg_base = SUNXI_SPI1_PBASE, .irq_num = SUNXI_IRQ_SPI1, .gpio_num = 3, \ .pclk_pll_type = HAL_SUNXI_AON_CCU, .pclk_pll_id = CLK_DEVICE, \ .pclk_hosc_type = HAL_SUNXI_AON_CCU, .pclk_hosc_id = CLK_HOSC, \ .bus_type = HAL_SUNXI_CCU, .bus_id = CLK_BUS_SPI1, \ .mclk_type = HAL_SUNXI_CCU, .mclk_id = CLK_SPI1, \ .reset_type = HAL_SUNXI_RESET, .reset_id = RST_SPI1, \ .gpio_clk = GPIOA(13), .gpio_mosi = GPIOA(18), .gpio_miso = -1, \ .gpio_cs0 = GPIOA(12), .gpio_wp = -1, .gpio_hold = -1, \ .mux = 6, .driv_level = GPIO_DRIVING_LEVEL2, \ }
注释SUPPORT_DBI_IF
/home/book/work/allwinner/R128-FreeRTOS/lichee/rtos-hal/hal/source/spilcd/lcd_fb/lcd_fb_feature.h #if defined (CONFIG_ARCH_SUN50IW11) || defined(CONFIG_ARCH_SUN8IW20) || defined(CONFIG_ARCH_SUN20IW1) \ || defined(CONFIG_ARCH_SUN20IW2) //#define SUPPORT_DBI_IF #endif
sys_config.fex配置
/home/book/work/allwinner/R128-FreeRTOS/board/r128s2/pro/configs/sys_config.fex ;---------------------------------------------------------------------------------- ;SPI controller configuration ;---------------------------------------------------------------------------------- ;Please config spi in dts [spi1] spi1_used = 1 spi1_cs_number = 1 spi1_cs_bitmap = 1 spi1_cs0 = port:PA12<6><0><3><default> spi1_sclk = port:PA13<6><0><3><default> spi1_mosi = port:PA18<6><0><3><default> spi1_miso = port:PA21<6><0><3><default> ;spi1_hold = port:PA19<6><0><2><default> ;spi1_wp = port:PA20<6><0><2><default> [pwm6] pwm_used = 1 pwm_positive = port:PA26<4><0><3><default> ;---------------------------------------------------------------------------------- ;lcd_fb0 configuration ;---------------------------------------------------------------------------------- [lcd_fb0] lcd_used = 1 lcd_model_name = "spilcd" lcd_driver_name = "lcd_100ask_240x240" lcd_x = 240 lcd_y = 240 lcd_width = 28 lcd_height = 28 lcd_data_speed = 40 lcd_pwm_used = 1 lcd_pwm_ch = 6 lcd_pwm_freq = 5000 lcd_pwm_pol = 0 lcd_if = 0 lcd_pixel_fmt = 11 lcd_dbi_fmt = 2 lcd_dbi_clk_mode = 1 lcd_dbi_te = 1 fb_buffer_num = 2 lcd_dbi_if = 4 lcd_rgb_order = 0 lcd_fps = 10 lcd_spi_bus_num = 1 lcd_frm = 2 lcd_gamma_en = 1 lcd_backlight = 100 lcd_power_num = 0 lcd_gpio_regu_num = 0 lcd_bl_percent_num = 0 lcd_spi_dc_pin = port:PA19<1><0><3><0> ;lcd_gpio_0 = port:PA12<1><0><2><0>
-
-
请教一下,韦东山的R128S2驱屏套件如何驱动韦东山的7寸50PIN RGB888屏幕?能出个教程吗?谢谢!
-
@akimizu 他们正在录视频。下下周应该会有。
-
@wj8331585 下周应该就有了,今天刚好录制了5节:https://www.bilibili.com/video/BV1oC4y1w7AH
Copyright © 2023 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号