|
作者:chenzhufly QQ:36886052 ( 转载请注明出处)
1. 概述
这篇文档是关于EE_BeagleBone_Cape LCD,内容不是很多,图形界面的编程不再这里加以讨论和学习,主要说说硬件的配置和测试。
2. LCD硬件设计点滴
我使用的是群创的7寸屏,这里主要注意一下AM3359的LCD控制器数据线和群创RGB的连接关系就可以了。如下所示lcd_data0 B1 lcd_data1 B2 lcd_data2 B3 lcd_data3 B4 lcd_data4 B5 lcd_data5 G0 lcd_data6 G1 lcd_data7 G2 lcd_data8 G3 lcd_data9 G4 lcd_data10 G5 lcd_data11 R1 lcd_data12 R2 lcd_data13 R3 lcd_data14 R4 lcd_data15 R5
复制代码 以下两篇文章还是比较有用的:
1) am335x接入LVDS显示器总结
https://bbs.eeworld.com.cn/viewthread.php?tid=329624
2) 给BeagleBone加装1280*800的LCD模块
https://bbs.eeworld.com.cn/thread-332175-1-1.html###zoom
3. LCD相关驱动
3.1 初始化
不管加什么模块,第一件事情都是初始化,需要在beaglebone_dev_cfg中增加初始化函数。/* Beaglebone Rev A3 and after */ static struct evm_dev_cfg beaglebone_dev_cfg[] = { {mii1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {usb1_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {mmc0_init, DEV_ON_BASEBOARD, PROFILE_NONE}, {lcdc_init, DEV_ON_BASEBOARD,, PROFILE_NONE}, {NULL, 0, 0}, };
复制代码 接个我们看看lcdc_init都干了些什么事情,
1. 管脚分配
2. 配置时钟
3. 注册设备static void lcdc_init(int evm_id, int profile) {
setup_pin_mux(lcdc_pin_mux);
if (conf_disp_pll(300000000)) { pr_info("Failed configure display PLL, not attempting to" "register LCDC\n"); return; }
if (am33xx_register_lcdc(&TFC_S9700RTWV35TR_01B_pdata)) pr_info("Failed to register LCDC device\n"); return; }
复制代码 3.2 Pin_mux
看看和LCD相关的管脚分配吧,也就如下的一些信号了。/* Module pin mux for LCDC */ static struct pinmux_config lcdc_pin_mux[] = { {"lcd_data0.lcd_data0", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data1.lcd_data1", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data2.lcd_data2", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data3.lcd_data3", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data4.lcd_data4", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data5.lcd_data5", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data6.lcd_data6", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data7.lcd_data7", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data8.lcd_data8", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data9.lcd_data9", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data10.lcd_data10", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data11.lcd_data11", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data12.lcd_data12", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data13.lcd_data13", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data14.lcd_data14", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"lcd_data15.lcd_data15", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT | AM33XX_PULL_DISA}, {"gpmc_ad8.lcd_data16", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad9.lcd_data17", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad10.lcd_data18", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad11.lcd_data19", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad12.lcd_data20", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad13.lcd_data21", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad14.lcd_data22", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"gpmc_ad15.lcd_data23", OMAP_MUX_MODE1 | AM33XX_PIN_OUTPUT}, {"lcd_vsync.lcd_vsync", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"lcd_hsync.lcd_hsync", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"lcd_pclk.lcd_pclk", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {"lcd_ac_bias_en.lcd_ac_bias_en", OMAP_MUX_MODE0 | AM33XX_PIN_OUTPUT}, {NULL, 0}, };
复制代码 这是关于LCD的一些配置信息static struct lcd_ctrl_config lcd_cfg = { &disp_panel, .ac_bias = 255, .ac_bias_intrpt = 0, .dma_burst_sz = 16, .bpp = 32, .fdd = 0x80, .tft_alt_mode = 0, .stn_565_mode = 0, .mono_8bit_mode = 0, .invert_line_clock = 1, .invert_frm_clock = 1, .sync_edge = 0, .sync_ctrl = 1, .raster_order = 0, };
复制代码struct da8xx_lcdc_platform_data TFC_S9700RTWV35TR_01B_pdata = { .manu_name = "ThreeFive", .controller_data = &lcd_cfg, .type = "TFC_S9700RTWV35TR_01B", };
复制代码 我们还是需要深入的了解一下TFC_S9700RTWV35TR_01B在什么地方定义的,以后我们改其他的屏就在这个地方了drivers/video/Da8xx-fb.c ,正好的我的7寸屏和这个配置比较匹配,就不需要修改了,省事!static struct da8xx_panel known_lcd_panels[] = { /* Sharp LCD035Q3DG01 */ [0] = { .name = "Sharp_LCD035Q3DG01", .width = 320, .height = 240, .hfp = 8, .hbp = 6, .hsw = 0, .vfp = 2, .vbp = 2, .vsw = 0, .pxl_clk = 4608000, .invert_pxl_clk = 1, }, /* Sharp LK043T1DG01 */ [1] = { .name = "Sharp_LK043T1DG01", .width = 480, .height = 272, .hfp = 2, .hbp = 2, .hsw = 41, .vfp = 3, .vbp = 3, .vsw = 10, .pxl_clk = 7833600, .invert_pxl_clk = 0, }, /* ThreeFive S9700RTWV35TR */ [2] = { .name = "TFC_S9700RTWV35TR_01B", .width = 800, .height = 480, .hfp = 39, .hbp = 39, .hsw = 47, .vfp = 13, .vbp = 29, .vsw = 2, .pxl_clk = 30000000, .invert_pxl_clk = 0, }, };
复制代码struct da8xx_panel { const char name[25]; /* Full name _ */ unsigned short width; unsigned short height; int hfp; /* Horizontal front porch */ int hbp; /* Horizontal back porch */ int hsw; /* Horizontal Sync Pulse Width */ int vfp; /* Vertical front porch */ int vbp; /* Vertical back porch */ int vsw; /* Vertical Sync Pulse Width */ unsigned int pxl_clk; /* Pixel clock */ unsigned char invert_pxl_clk; /* Invert Pixel clock */ };
复制代码 4. 相关测试结果
5. PDF下载
EE_BeagleBone_Cape之LCD.pdf
(671.19 KB, 下载次数: 295)
|
|