导航

    全志在线开发者论坛

    • 注册
    • 登录
    • 搜索
    • 版块
    • 话题
    • 在线文档
    • 社区主页
    1. 主页
    2. hsinyuwang
    3. 最佳
    • 资料
    • 关注 0
    • 粉丝 2
    • 我的积分 3389
    • 主题 7
    • 帖子 27
    • 最佳 10
    • 群组 0

    hsinyuwang 发布的最佳帖子

    • 萌新基于全志V3s自制GBA游戏机

      视频介绍 https://www.bilibili.com/video/BV1JP4y1X7Uz

      开源地址https://github.com/hsinyuwang/X-Boy

      非常感谢哇酷网和司徒大佬开源的资料!!!

      图片展示

      95a61a09-1334-40a1-8465-0b4fb08388a5-6.jpg

      0e94997b-e9a3-4ab4-8554-7b660281ec4c-7.jpg

      电路板
      3cd7c294-5dc5-4e54-9df4-a6ef88a9942c-核心板.png

      e14e1e17-9608-4df8-970b-bfdeadf3d8e0-左.png

      a47a26ab-552a-4d36-82c2-3f329eb1e3b5-右.png

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • T113 tina linux 移植 gpsp 模拟器

      gpsp 依赖 SDL 和 SDL_TTF

      • SDL 1.2.5 的移植可以看这篇文章 d1s移植sdl1-2-15版本,makefile中需要关掉 directfb 和 tslib
      CONFIGURE_ARGS += \
      		--enable-static=no \
      		--disable-video-directfb \
      		--enable-input-tslib=no \
      

      同时在 menuconfig 中也关掉 directfb

      19bb0f3f-9053-4895-86c2-4bbce62310cc-image.png

      • SDL_TTF 可以在 openwrt 的 package 中找到 https://github.com/robbie-cao/openwrt-packages-kyak 直接将 libsdl-ttf 复制到 tina linux 的 package/libs 目录下,这个 makefile 里面是 2.0.9 的版本,可以修改到 2.0.11 ,对应修改 md5sum 为 61e29bd9da8d245bc2471d1b2ce591aa
      PKG_NAME:=libsdl-ttf
      PKG_VERSION:=2.0.11
      PKG_RELEASE:=2
      
      PKG_SOURCE:=SDL_ttf-$(PKG_VERSION).tar.gz
      PKG_SOURCE_URL:=http://www.libsdl.org/projects/SDL_ttf/release/
      PKG_MD5SUM:=61e29bd9da8d245bc2471d1b2ce591aa
      PKG_BUILD_DIR:=$(COMPILE_DIR)/SDL_ttf-$(PKG_VERSION)
      

      编译好之后 开始编译 gpsp

      • 修改 CFLAGS 添加头文件路径
      -I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include/SDL -I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include
      
      • 修改 LDFLAGS 添加库文件路径
      -L/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/lib
      
      • 修改 LIBS 添加需要链接的库文件
      -lfreetype -lbz2
      

      完整的 makefile

      TARGET  = gpsp
      CC      = arm-openwrt-linux-gnueabi-gcc-6.4.1
      VPATH   = .. ../arm
      OBJS    = main.o cpu.o memory.o video.o input.o sound.o cheats.o zip.o  arm_stub.o  warm.o cpu_threaded.o video_blend.o sha1.o imageio.o gui_xboy.o #gui.o
      CFLAGS  = -DARM_ARCH -DPC_BUILD -march=armv7-a -mtune=cortex-a7 -mfloat-abi=hard -mfpu=neon -ffast-math -Ofast -I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include/SDL -I/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/include
      LDFLAGS = -L/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/target/usr/lib
      LIBS    = -lSDL -lSDL_ttf -lz -lpng -lfreetype -lbz2
      
      all: $(TARGET)
      
      $(TARGET): $(OBJS)
      	$(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
      
      %.o: %.S
      	$(CC) $(CFLAGS) -c -o $@ $<
      
      clean:
      	rm -f *.o $(TARGET)
      

      导入环境变量后编译

      export PATH=$PATH:/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/toolchain/bin/
      export STAGING_DIR=/home/hsinyuwang/t113/tina-d1-h/out/t113-nezha/staging_dir/
      

      OK了

      d55cf8ce-a0e3-4744-bcb2-5487d4adb555-image.png

      因为 t113 的屏幕驱动没有调,所以还没办法验证
      完整的 gpsp 代码 https://github.com/hsinyuwang/gpsp 切换到 t113 分支
      过程遇到了很多问题,感谢司徒大佬指点!

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 开源一个低成本的V3s掌机方案(未验证)

      主控:全志V3s
      屏幕:2.4寸 320x240 SPI+RGB666 驱动方案
      PCB尺寸:10x6.8cm 双层板
      PCB打样中,暂未验证

      微信截图_20230813120056.png

      微信截图_20230813120648.png

      原理图

      Schematic_allwinner-v3s-game-handheld_2023-08-13.png

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 回复: Gaviar Handheld (小志掌機)

      支持司徒大佬!!!

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 回复: Gaviar Handheld (小志掌機)

      @steward 那这个屏没有TE脚,传送过程的撕裂还有办法解决吗
      20180213231002635.gif

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 回复: T113 tina linux 移植 gpsp 模拟器

      sdl_ttf 的完整 makefile

      # 
      # Copyright (C) 2010 OpenWrt.org
      #
      # This is free software, licensed under the GNU General Public License v2.
      # See /LICENSE for more information.
      #
      
      include $(TOPDIR)/rules.mk
      
      PKG_NAME:=libsdl-ttf
      PKG_VERSION:=2.0.11
      PKG_RELEASE:=2
      
      PKG_SOURCE:=SDL_ttf-$(PKG_VERSION).tar.gz
      PKG_SOURCE_URL:=http://www.libsdl.org/projects/SDL_ttf/release/
      PKG_MD5SUM:=61e29bd9da8d245bc2471d1b2ce591aa
      PKG_BUILD_DIR:=$(COMPILE_DIR)/SDL_ttf-$(PKG_VERSION)
      
      PKG_INSTALL:=1
      
      include $(BUILD_DIR)/package.mk
      include $(BUILD_DIR)/nls.mk
      
      define Package/libsdl-ttf
        SECTION:=libs
        CATEGORY:=Libraries
        TITLE:=Simple DirectMedia Layer True Font
        URL:=http://www.libsdl.org/projects/SDL_ttf/
        DEPENDS:=+sdl +libfreetype $(ICONV_DEPENDS) $(INTL_DEPENDS)
      endef
      
      define Package/libsdl-ttf/description
        SDL_ttf is a TrueType font rendering library that is used with the SDL library, and almost as portable. It depends on freetype2 to handle the TrueType font data. It allows a programmer to use multiple TrueType fonts without having to code a font rendering routine themselves. With the power of outline fonts and antialiasing, high quality text output can be obtained without much effort.
      endef
      
      PKG_FIXUP:=libtool
      
      TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/SDL
      
      CONFIGURE_ARGS += \
             --with-sdl-exec-prefix=$(STAGING_DIR) \
             --without-x \
             LIBS="-lSDL -liconv"
      
      TARGET_LDFLAGS+= \
             -Wl,-rpath-link=$(STAGING_DIR)/usr/lib
      
      define Build/InstallDev
      	$(INSTALL_DIR) \
      		$(1)/usr/include/SDL \
      		$(1)/usr/lib
      
      	$(CP) \
      		$(PKG_INSTALL_DIR)/usr/include/SDL/SDL_ttf.h \
      		$(1)/usr/include/SDL/
      
      	$(CP) \
      		$(PKG_INSTALL_DIR)/usr/lib/libSDL_ttf*.{a,so*} \
      		$(1)/usr/lib/
      endef
      
      define Package/libsdl-ttf/install
      	$(INSTALL_DIR) \
      		$(1)/usr/lib
      
      	$(CP) \
      		$(PKG_INSTALL_DIR)/usr/lib/libSDL_ttf*.so* \
      		$(1)/usr/lib/
      endef
      
      $(eval $(call BuildPackage,libsdl-ttf))
      
      
      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 回复: T113 tina linux 移植 gpsp 模拟器

      补充:sdl_ttf 的 makefile 需要把 DEPENDS:=+libsdl 改成 DEPENDS:=+sdl +libfreetype

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 回复: T113 tina linux 适配 ili9488 屏幕 i80 16bit

      尚未解决问题

      • fb0_format 修改为10 后启动 log 是绿色
      fb0_format = <10>;
      

      E682965F3BAED8FE731BE29E9A3AD129.png

      • 屏幕实时帧率与期望帧率相差较大
      	lcd_x               = <480>;
      	lcd_y               = <320>;
      	lcd_width           = <72>;
      	lcd_height          = <48>;
      	lcd_dclk_freq       = <10>;
      	lcd_hbp             = <2>;
      	lcd_ht              = <486>;
      	lcd_hspw            = <2>;
      	lcd_vbp             = <20>;
      	lcd_vt              = <342>;
      	lcd_vspw            = <2>;
      
              lcd_cpu_mode        = <1>;
      	lcd_cpu_te          = <1>;
      

      QQ截图20230624193313.png

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 萌新自制GBA游戏机(第二弹)

      前言

      紧跟晕哥和司徒大佬的脚步
      基于全志T113-S3自制GBA游戏机
      视频介绍 https://www.bilibili.com/video/BV1Gu411V7ar
      开源地址 https://github.com/hsinyuwang/X-Boy-Plus

      图片展示

      为了方便使用嘉立创免费打样,依旧分开设计PCB,每块PCB尺寸都在10x10cm以内
      因为时间有限还没有画3D外壳

      IMG_1041.JPG

      IMG_1033.JPG

      DD1A77BA30A9CB63279C1934F8965D1B.png

      0638c239-9cc5-4223-85b1-a497b6a45bdc-image.png

      0e0e199b-f6f9-4004-9fa4-dee119e3fe6f-image.png

      3bfc09b0-4c02-4928-9dba-d844e98d3f17-image.png

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • T113 tina linux 适配 ili9488 屏幕 i80 16bit

      前言

      在上一篇文章已经搞定了 T113 tina linux 移植 gpsp 模拟器 接下来适配屏幕驱动。
      因为 GBA 原生分辨率是 240x160,所以屏幕选用的是 480x320 的 ili9488,正好可以整数倍缩放。

      初始化屏幕

      先从 tina linux 自带的驱动中 copy 一份 st7789v_cpu 的代码,然后对照 ili9488 屏幕厂商提供的初始化代码做修改

      a17e9449-0aef-4c18-b866-6d4fcde83329-image.png
      完整代码

      /*
       * drivers/video/fbdev/sunxi/disp2/disp/lcd/ili9488_cpu.c
       *
       * Copyright (c) 2007-2018 Allwinnertech Co., Ltd.
       * Author: zhengxiaobin <zhengxiaobin@allwinnertech.com>
       *
       * This software is licensed under the terms of the GNU General Public
       * License version 2, as published by the Free Software Foundation, and
       * may be copied, distributed, and modified under those terms.
       *
       * This program is distributed in the hope that it will be useful,
       * but WITHOUT ANY WARRANTY; without even the implied warranty of
       * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       * GNU General Public License for more details.
       *
       *
       */
      
      #include "ili9488_cpu.h"
      
      #define CPU_TRI_MODE
      
      #define DBG_INFO(format, args...) (printk("[ILI9488 LCD INFO] LINE:%04d-->%s:"format, __LINE__, __func__, ##args))
      #define DBG_ERR(format, args...) (printk("[ILI9488 LCD ERR] LINE:%04d-->%s:"format, __LINE__, __func__, ##args))
      #define panel_reset(val) sunxi_lcd_gpio_set_value(sel, 0, val)
      #define lcd_cs(val)  sunxi_lcd_gpio_set_value(sel, 1, val)
      
      static void lcd_panel_ili9488_init(u32 sel, struct disp_panel_para *info);
      static void LCD_power_on(u32 sel);
      static void LCD_power_off(u32 sel);
      static void LCD_bl_open(u32 sel);
      static void LCD_bl_close(u32 sel);
      
      static void LCD_panel_init(u32 sel);
      static void LCD_panel_exit(u32 sel);
      
      static void LCD_cfg_panel_info(struct panel_extend_para *info)
      {
      #if 0
      	u32 i = 0, j = 0;
      	u32 items;
      	u8 lcd_gamma_tbl[][2] = {
      	    //{input value, corrected value}
      	    {0, 0},     {15, 15},   {30, 30},   {45, 45},   {60, 60},
      	    {75, 75},   {90, 90},   {105, 105}, {120, 120}, {135, 135},
      	    {150, 150}, {165, 165}, {180, 180}, {195, 195}, {210, 210},
      	    {225, 225}, {240, 240}, {255, 255},
      	};
      
      	u32 lcd_cmap_tbl[2][3][4] = {
      	    {
      		{LCD_CMAP_G0, LCD_CMAP_B1, LCD_CMAP_G2, LCD_CMAP_B3},
      		{LCD_CMAP_B0, LCD_CMAP_R1, LCD_CMAP_B2, LCD_CMAP_R3},
      		{LCD_CMAP_R0, LCD_CMAP_G1, LCD_CMAP_R2, LCD_CMAP_G3},
      	    },
      	    {
      		{LCD_CMAP_B3, LCD_CMAP_G2, LCD_CMAP_B1, LCD_CMAP_G0},
      		{LCD_CMAP_R3, LCD_CMAP_B2, LCD_CMAP_R1, LCD_CMAP_B0},
      		{LCD_CMAP_G3, LCD_CMAP_R2, LCD_CMAP_G1, LCD_CMAP_R0},
      	    },
      	};
      
      	items = sizeof(lcd_gamma_tbl) / 2;
      	for (i = 0; i < items - 1; i++) {
      		u32 num = lcd_gamma_tbl[i + 1][0] - lcd_gamma_tbl[i][0];
      
      		for (j = 0; j < num; j++) {
      			u32 value = 0;
      
      			value =
      			    lcd_gamma_tbl[i][1] +
      			    ((lcd_gamma_tbl[i + 1][1] - lcd_gamma_tbl[i][1]) *
      			     j) /
      				num;
      			info->lcd_gamma_tbl[lcd_gamma_tbl[i][0] + j] =
      			    (value << 16) + (value << 8) + value;
      		}
      	}
      	info->lcd_gamma_tbl[255] = (lcd_gamma_tbl[items - 1][1] << 16) +
      				   (lcd_gamma_tbl[items - 1][1] << 8) +
      				   lcd_gamma_tbl[items - 1][1];
      
      	memcpy(info->lcd_cmap_tbl, lcd_cmap_tbl, sizeof(lcd_cmap_tbl));
      #endif
      }
      
      static s32 LCD_open_flow(u32 sel)
      {
      	LCD_OPEN_FUNC(sel, LCD_power_on, 120);
      #ifdef CPU_TRI_MODE
      	LCD_OPEN_FUNC(sel, LCD_panel_init, 100);
      	LCD_OPEN_FUNC(sel, sunxi_lcd_tcon_enable, 50);
      #else
      	LCD_OPEN_FUNC(sel, sunxi_lcd_tcon_enable, 100);
      	LCD_OPEN_FUNC(sel, LCD_panel_init, 50);
      #endif
      	LCD_OPEN_FUNC(sel, LCD_bl_open, 0);
      
      	return 0;
      }
      
      static s32 LCD_close_flow(u32 sel)
      {
      	LCD_CLOSE_FUNC(sel, LCD_bl_close, 20);
      #ifdef CPU_TRI_MODE
      	LCD_CLOSE_FUNC(sel, sunxi_lcd_tcon_disable, 10);
      	LCD_CLOSE_FUNC(sel, LCD_panel_exit, 50);
      #else
      	LCD_CLOSE_FUNC(sel, LCD_panel_exit, 10);
      	LCD_CLOSE_FUNC(sel, sunxi_lcd_tcon_disable, 10);
      #endif
      	LCD_CLOSE_FUNC(sel, LCD_power_off, 0);
      
      	return 0;
      }
      
      static void LCD_power_on(u32 sel)
      {
      	/*config lcd_power pin to open lcd power0 */
      	sunxi_lcd_power_enable(sel, 0);
      	sunxi_lcd_pin_cfg(sel, 1);
      
      }
      
      static void LCD_power_off(u32 sel)
      {
      	/*lcd_cs, active low */
      	lcd_cs(1);
      	sunxi_lcd_delay_ms(10);
      	/*lcd_rst, active hight */
      	panel_reset(1);
      	sunxi_lcd_delay_ms(10);
      
      	sunxi_lcd_pin_cfg(sel, 0);
      	/*config lcd_power pin to close lcd power0 */
      	sunxi_lcd_power_disable(sel, 0);
      }
      
      static void LCD_bl_open(u32 sel)
      {
      	sunxi_lcd_pwm_enable(sel);
      	/*config lcd_bl_en pin to open lcd backlight */
      	sunxi_lcd_backlight_enable(sel);
      }
      
      static void LCD_bl_close(u32 sel)
      {
      	/*config lcd_bl_en pin to close lcd backlight */
      	sunxi_lcd_backlight_disable(sel);
      	sunxi_lcd_pwm_disable(sel);
      }
      
      /*static int bootup_flag = 0;*/
      static void LCD_panel_init(u32 sel)
      {
      	struct disp_panel_para *info =
      	    kmalloc(sizeof(struct disp_panel_para), GFP_KERNEL);
      
      	DBG_INFO("\n");
      	bsp_disp_get_panel_info(sel, info);
      	lcd_panel_ili9488_init(sel, info);
      
      	kfree(info);
      	return;
      }
      
      static void LCD_panel_exit(u32 sel)
      {
      	sunxi_lcd_cpu_write_index(0, 0x28);
          sunxi_lcd_delay_ms(10);
      	sunxi_lcd_cpu_write_index(0, 0x10);
          sunxi_lcd_delay_ms(120);
      }
      
      
      static void lcd_panel_ili9488_init(u32 sel, struct disp_panel_para *info)
      {
      	DBG_INFO("\n");
      	/*lcd_cs, active low */
      	lcd_cs(0);
      	sunxi_lcd_delay_ms(10);
      	panel_reset(1);
      	sunxi_lcd_delay_ms(20);
      	panel_reset(0);
      	sunxi_lcd_delay_ms(20);
      	panel_reset(1);
      	sunxi_lcd_delay_ms(120);
      
      	sunxi_lcd_cpu_write_index(0, 0xF7);
      	sunxi_lcd_cpu_write_data(0, 0xA9);
      	sunxi_lcd_cpu_write_data(0, 0x51);
      	sunxi_lcd_cpu_write_data(0, 0x2C);
      	sunxi_lcd_cpu_write_data(0, 0x82);
      
      	sunxi_lcd_cpu_write_index(0, 0xC0);
      	sunxi_lcd_cpu_write_data(0, 0x11);
      	sunxi_lcd_cpu_write_data(0, 0x09);
      
      	sunxi_lcd_cpu_write_index(0, 0xC1);
      	sunxi_lcd_cpu_write_data(0, 0x41);
      
      	sunxi_lcd_cpu_write_index(0, 0xC5);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x2A);
      	sunxi_lcd_cpu_write_data(0, 0x80);
      
      	sunxi_lcd_cpu_write_index(0, 0xB1);
      	sunxi_lcd_cpu_write_data(0, 0xB0);
      	sunxi_lcd_cpu_write_data(0, 0x11);
      
      	sunxi_lcd_cpu_write_index(0, 0xB4);
      	sunxi_lcd_cpu_write_data(0, 0x02);
      
      	sunxi_lcd_cpu_write_index(0, 0xB6);
      	sunxi_lcd_cpu_write_data(0, 0x02);
      	sunxi_lcd_cpu_write_data(0, 0x22);
      
      	sunxi_lcd_cpu_write_index(0, 0xB7);
      	sunxi_lcd_cpu_write_data(0, 0xC6);
      
      	sunxi_lcd_cpu_write_index(0, 0xBE);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x04);
      
      	sunxi_lcd_cpu_write_index(0, 0xE9);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      
      	sunxi_lcd_cpu_write_index(0, 0x3A);
      	sunxi_lcd_cpu_write_data(0, 0x55);
      
      	sunxi_lcd_cpu_write_index(0, 0xE0);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x07);
      	sunxi_lcd_cpu_write_data(0, 0x12);
      	sunxi_lcd_cpu_write_data(0, 0x0B);
      	sunxi_lcd_cpu_write_data(0, 0x18);
      	sunxi_lcd_cpu_write_data(0, 0x0B);
      	sunxi_lcd_cpu_write_data(0, 0x3F);
      	sunxi_lcd_cpu_write_data(0, 0x9B);
      	sunxi_lcd_cpu_write_data(0, 0x4B);
      	sunxi_lcd_cpu_write_data(0, 0x0B);
      	sunxi_lcd_cpu_write_data(0, 0x0F);
      	sunxi_lcd_cpu_write_data(0, 0x0B);
      	sunxi_lcd_cpu_write_data(0, 0x15);
      	sunxi_lcd_cpu_write_data(0, 0x17);
      	sunxi_lcd_cpu_write_data(0, 0x0F);
      
      	sunxi_lcd_cpu_write_index(0, 0xE1);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x16);
      	sunxi_lcd_cpu_write_data(0, 0x1B);
      	sunxi_lcd_cpu_write_data(0, 0x02);
      	sunxi_lcd_cpu_write_data(0, 0x0F);
      	sunxi_lcd_cpu_write_data(0, 0x06);
      	sunxi_lcd_cpu_write_data(0, 0x34);
      	sunxi_lcd_cpu_write_data(0, 0x46);
      	sunxi_lcd_cpu_write_data(0, 0x48);
      	sunxi_lcd_cpu_write_data(0, 0x04);
      	sunxi_lcd_cpu_write_data(0, 0x0D);
      	sunxi_lcd_cpu_write_data(0, 0x0D);
      	sunxi_lcd_cpu_write_data(0, 0x35);
      	sunxi_lcd_cpu_write_data(0, 0x36);
      	sunxi_lcd_cpu_write_data(0, 0x0F);
      
      	sunxi_lcd_cpu_write_index(0, 0x2A);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x01);
      	sunxi_lcd_cpu_write_data(0, 0xDF);
      
      	sunxi_lcd_cpu_write_index(0, 0x2B);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      	sunxi_lcd_cpu_write_data(0, 0x01);
      	sunxi_lcd_cpu_write_data(0, 0x3F);
      
      	sunxi_lcd_cpu_write_index(0, 0x36);
      	sunxi_lcd_cpu_write_data(0, 0x68);
      
      
      #if defined(CPU_TRI_MODE)
      	/* enable te, mode 0 */
      
      	sunxi_lcd_cpu_write_index(0, 0x35);
      	sunxi_lcd_cpu_write_data(0, 0x00);
      
      #endif
      	sunxi_lcd_cpu_write_index(0, 0x11);
      	sunxi_lcd_delay_ms(120);
      	sunxi_lcd_cpu_write_index(0, 0x29);
      	sunxi_lcd_cpu_write_index(0, 0x2c);
      }
      
      
      /* panel driver name, must mach the name of lcd_drv_name in sys_config.fex */
      struct __lcd_panel ili9488_cpu_panel = {
      	.name = "ili9488_cpu",
      	.func = {
      		.cfg_panel_info = LCD_cfg_panel_info,
      		.cfg_open_flow = LCD_open_flow,
      		.cfg_close_flow = LCD_close_flow,
      	},
      };
      
      

      Kconfig 添加

      config LCD_SUPPORT_ILI9488_CPU
      	bool "LCD support ili9488_cpu panel"
      	default n
      	---help---
      		If you want to support ili9488_cpu panel for display driver, select it.
      
      

      Makefile 添加

      disp-$(CONFIG_LCD_SUPPORT_ILI9488_CPU) += lcd/ili9488_cpu.o
      

      panels.c 添加

      #ifdef CONFIG_LCD_SUPPORT_ILI9488_CPU
      	&ili9488_cpu_panel,
      #endif
      

      panels.h 添加

      #ifdef CONFIG_LCD_SUPPORT_ILI9488_CPU
      extern struct __lcd_panel ili9488_cpu_panel;
      #endif
      

      再打开 m kernel_menuconfig

      Device Drivers  --->
      	Graphics support  ---> 
      		Frame buffer Devices  --->
      			Video support for sunxi  --->
      				LCD panels select  --->
      					 [*] LCD support ili9488_cpu panel   
      

      修改 board.dts

      disp

      &disp {
      	disp_init_enable         = <1>;
      	disp_mode                = <0>;
      
      	screen0_output_type      = <1>;
      	screen0_output_mode      = <4>;
      
      	screen1_output_type      = <3>;
      	screen1_output_mode      = <4>;
      	
      	screen1_output_format    = <0>;
      	screen1_output_bits      = <0>;
      	screen1_output_eotf      = <4>;
      	screen1_output_cs        = <257>;
      	screen1_output_dvi_hdmi  = <2>;
      	screen1_output_range     = <2>;
      	screen1_output_scan      = <0>;
      	screen1_output_aspect_ratio = <8>;
      	dev0_output_type         = <1>;
      	dev0_output_mode         = <4>;
      	dev0_screen_id           = <0>;
      	dev0_do_hpd              = <0>;
      
      	dev1_output_type         = <4>;
      	dev1_output_mode         = <10>;
      	dev1_screen_id           = <1>;
      	dev1_do_hpd              = <1>;
      
      	def_output_dev           = <1>;
      	hdmi_mode_check          = <3>;
      	disp_rotation_used		 = <1>;
      	degree0					 = <0>;
      	fb0_format               = <10>;
      	fb0_buffer_num           = <1>;	
      	/*fb0_width                = <800>;*/
      	/*fb0_height               = <480>;*/  /*read from lcd*/
      	fb1_format               = <0>;
      	fb1_width                = <0>;
      	fb1_height               = <0>;
      	chn_cfg_mode             = <1>;
      
      	disp_para_zone           = <1>;
      	/*VCC-LCD*/
      /*	dc1sw-supply = <&reg_dc1sw>;*/
      	/*VCC-DSI*/
      /*	eldo3-supply = <&reg_eldo3>;*/
      	/*VCC-PD*/
      /*	dcdc1-supply = <&reg_dcdc1>;*/
      };
      

      lcd0

      &lcd0 {
      
      	/* part 1 */
      	lcd_used            = <1>;
      	lcd_driver_name     = "ili9488_cpu";
      
      	/* part 2 */
      	lcd_if              = <1>;
      	lcd_cpu_if	        = <8>;
      
      	/* part 3 */
      	lcd_x               = <480>;
      	lcd_y               = <320>;
      	lcd_width           = <72>;
      	lcd_height          = <48>;
      	lcd_dclk_freq       = <10>;
      	lcd_hbp             = <2>;
      	lcd_ht              = <486>;
      	lcd_hspw            = <2>;
      	lcd_vbp             = <20>;
      	lcd_vt              = <342>;
      	lcd_vspw            = <2>;
      
      	/* part 4 */
      	lcd_pwm_used        = <1>;
      	lcd_pwm_ch          = <8>;
      	lcd_pwm_freq        = <50000>;
      	lcd_pwm_pol         = <1>;
      	lcd_pwm_max_limit   = <255>;
      	lcd_bright_curve_en = <0>;
      
      	/* part 5 */
      	lcd_cpu_mode        = <1>;
      	lcd_cpu_te          = <1>;
      
      	/* part 6 */
      	lcd_frm             = <2>;
      	lcd_gamma_en        = <0>;
      	lcd_cmap_en         = <0>;
      	lcd_rb_swap			= <0>;
      
      	/* part 7 */
      	// reset pin
      	lcd_gpio_0 = <&pio PD 0 GPIO_ACTIVE_HIGH>;
      	// cs pin
      	lcd_gpio_1 = <&pio PD 9 GPIO_ACTIVE_HIGH>;
      	pinctrl-0 = <&rgb16_pins_a>;
      	pinctrl-1 = <&rgb16_pins_b>;
      };
      

      然后在pio中添加

      rgb16_pins_a: rgb16@0 {
      		pins = "PD1", "PD2","PD3","PD4","PD5","PD6", "PD7", "PD8", \
      				"PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", \
      				"PD18", "PD19", "PD20", "PD21";
      		function = "lcd0";
      		drive-strength = <30>;
      		bias-disable;
      	};
      
      	rgb16_pins_b: rgb16@1 {
      		pins = "PD1", "PD2","PD3","PD4","PD5","PD6", "PD7", "PD8", \
      				"PD10", "PD11", "PD12", "PD13", "PD14", "PD15", "PD16", "PD17", \
      				"PD18", "PD19", "PD20", "PD21";
      		function = "io_disabled";
      		bias-disable;
      	};
      

      测试 gpsp 显示

      ca5d44c6-e1ee-4864-94d7-e6c97e85998f-19DB19AA9558848CC4814892EA6EF828.png

      发布在 爱搞机专区
      hsinyuwang
      hsinyuwang
    • 1 / 1