当前位置:网站首页>LCD parameter interpretation and calculation
LCD parameter interpretation and calculation
2022-06-12 17:56:00 【_ kerneler】
https://blog.csdn.net/longxiaowu/article/details/24319933
Linux Kernel amba lcd Controller use clcd_panel The structure represents a LCD Hardware parameters of the screen :
/* include/linux/fb.h */
struct fb_videomode {
const char *name; /* optional */
u32 refresh; /* optional */
u32 xres;
u32 yres;
u32 pixclock;
u32 left_margin;
u32 right_margin;
u32 upper_margin;
u32 lower_margin;
u32 hsync_len;
u32 vsync_len;
u32 sync;
u32 vmode;
u32 flag;
};
/* include/linux/amba/clcd.h */
struct clcd_panel {
struct fb_videomode mode;
signed short width; /* width in mm */
signed short height; /* height in mm */
u32 tim2;
u32 tim3;
u32 cntl;
unsigned int bpp:8,
fixedtimings:1,
grayscale:1;
unsigned int connector;
};
Let's look at an example :http://lxr.linux.no/linux+v2.6.37.4/arch/arm/mach-lpc32xx/phy3250.c
fb_videomode The meaning of each parameter
Linux Yes LCD The abstract of is shown in the following figure :
Let's study fb_videomode The meaning of each member :
Linux Kernel amba lcd Controller use clcd_panel The structure represents a LCD Hardware parameters of the screen :
-
/* include/linux/fb.h */
-
struct fb_videomode {
-
const
char *name;
/* optional */
-
u32 refresh;
/* optional */
-
u32 xres;
-
u32 yres;
-
u32 pixclock;
-
u32 left_margin;
-
u32 right_margin;
-
u32 upper_margin;
-
u32 lower_margin;
-
u32 hsync_len;
-
u32 vsync_len;
-
u32 sync;
-
u32 vmode;
-
u32 flag;
-
};
-
/* include/linux/amba/clcd.h */
-
struct clcd_panel {
-
struct fb_videomode mode;
-
signed
short width;
/* width in mm */
-
signed
short height;
/* height in mm */
-
u32 tim2;
-
u32 tim3;
-
u32 cntl;
-
unsigned
int bpp:
8,
-
fixedtimings:
1,
-
grayscale:
1;
-
unsigned
int connector;
-
};


| name | Abbreviation in the data book | Chinese name | significance | remarks |
| name | No | name | LCD name ( Optional ) | No |
| refresh | No | refresh frequency | refresh frequency ( Many examples in the kernel are assigned to 60) | No |
| xres | No | Line width | Number of pixels per row | No |
| yres | No | Screen height | The number of lines on the screen | No |
| pixclock | No | Pixel clock | The length of each pixel clock cycle , The unit is picosecond (10 Negative 12 In the second place 1 second ) | No |
| left_margin | HBP (Horizontal Back Porch) | Horizontal trailing edge | An image to be inserted at the beginning of the output of pixel data in each row or column Prime clock cycles | No |
| right_margin | HFP (Horizontal Front Porch ) | Horizontal frontier | At the end of each row or column of pixels LCD Line clock output pulse The number of pixel clocks between | No |
| upper_margin | VBP (Vertical Back Porch) | Vertical trailing edge | The number of invalid lines at the beginning of the frame after the vertical synchronization period | No |
| lower_margin | VFP (Vertical Front Porch) | Vertical leading edge | From the end of data output of this frame to the beginning of vertical synchronization cycle of the next frame Number of invalid lines before | No |
| hsync_len | HPW (HSYNC plus width) | Row synchronization pulse width | Company : Pixel clock cycle | There are also manuals called HWH(HSYNC width) |
| vsync_len | VPW (VSYNC width) | Vertical synchronous pulse width | Company : Show the time of one line th | There are also manuals called VWH(VSYNC width) |
| sync | No | Synchronous polarity setting | It can be set as needed FB_SYNC_HOR_HIGH_ACT( Horizontal synchronization high level is active ) and FB_SYNC_VERT_HIGH_ACT( Vertical sync high active ) | No |
| vmode | No | No | Most of the examples in the kernel are set directly to FB_VMODE_NONINTERLACED.interlaced It means to interlace [ Interlace ] scanning , Used in TV 2:1 Interleaving rate of , That is, each frame is divided into two fields , Two vertical scans , Scan odd rows in one field , Another field scans even lines . Obviously LCD This is not the current model . | No |
| flag | No | No | We haven't seen the usage at present | No |
#define TIM2_IVS (1 << 11) Reverse vertical synchronization The polarity of the signal .0: High active , Low level invalid .1: contrary
#define TIM2_IHS (1 << 12) Reverse horizontal synchronization The polarity of the signal .0: High active , Low level invalid .1: contrary
#define TIM2_IPC (1 << 13) To select whether the pixel data is driven to... On the rising or falling edge of the display clock LCD cable .0: Rising edge .1: Falling edge .
#define TIM2_IOE (1 << 14) This bit selects the effective polarity of the output enable signal .0: High active , Low level invalid .1: contrary
#define TIM2_BCD (1 << 26) Set this bit to 1, Make PCD The frequency division of is invalid . It is mainly used for TFT display . This bit is usually not set , Use the default value 0.
#define CNTL_LCDBPP1 (0 << 1) bit[1-3] Define color depth .bpp:bits per pixel, Number of bits per pixel .000 = 1 bpp.
#define CNTL_LCDBPP4 (2 << 1) 010 = 4 bpp.
#define CNTL_LCDBPP8 (3 << 1) 011 = 8 bpp.
#define CNTL_LCDBPP16 (4 << 1) 100 = 16 bpp
#define CNTL_LCDBPP16_565 (6 << 1) 110 = 16 bpp, 5:6:5 mode
#define CNTL_LCDBPP24 (5 << 1) 101 = 24 bpp (TFT panel only).
#define CNTL_LCDBW (1 << 4) STN LCD monochrome / Color selection .1: colour ,0: monochrome
#define CNTL_LCDTFT (1 << 5) LCD display TFT Type selection .0: STN display , Use the grayscale .1: TFT display , Do not use a grayscale scaler
#define CNTL_LCDMONO8 (1 << 6) This bit determines monochrome STN LCD It's using 4 Bit parallel interface or 8 Bit parallel interface .0:4 Bit interface .
#define CNTL_LCDDUAL (1 << 7) STN single LCD Display or dual LCD Display selection .0= Single screen
#define CNTL_BGR (1 << 8) Color mode selection ,0=RGB: Normal output ,1=BGR: Red and blue swap positions
#define CNTL_BEBO (1 << 9) Control the storage order of bytes in memory : 0= Small endian byte order ,1= Big endian byte order
#define CNTL_BEPO (1 << 10) Set how pixels are sorted ,0= Small end pixel sorting ,1= Use large pixel sorting
#define CNTL_LCDPWR (1 << 11) LCD Power enable .1=LCD The display is powered on and LCDV[23:0] Signal enable
#define CNTL_LCDVCOMP(x) ((x) << 12) LCD Vertical comparison is interrupted .00= The vertical sync pulse is active ,01= Start at the vertical back edge ,10= Valid video image start ,11= The vertical leading edge begins
#define CNTL_LDMAFIFOTIME (1 << 15) DMA FIFO Request delay
#define CNTL_WATERMARK (1 << 16) LCD DMA FIFO Waterline .0: When DMA FIFO contain 4 Or 4 When there are more than units above, a LCD DMA request .1:8 individual .




-
static
struct clcd_panel conn_lcd_panel = {
-
.mode = {
-
.name =
"QVGA TM035KDH03",
-
.refresh =
60,
-
.xres =
240,
-
.yres =
320,
-
.pixclock =
35714,
-
.left_margin =
69,
-
.right_margin =
18,
-
.upper_margin =
12,
-
.lower_margin =
10,
-
.hsync_len =
1,
-
.vsync_len =
1,
-
.sync = FB_SYNC_HOR_HIGH_ACT|FB_SYNC_VERT_HIGH_ACT,
-
.vmode = FB_VMODE_NONINTERLACED,
-
},
-
.width =
-1,
-
.height =
-1,
-
.tim2 =
0,
-
.cntl = ( CNTL_LCDTFT | CNTL_LCDVCOMP(
1) | CNTL_LCDBPP16_565),
-
.bpp =
16,
-
};
边栏推荐
- MySQL学习笔记
- AlibabaProtect.exe如何删除、卸载
- Arm64栈回溯
- Tensorflow prompts typeerror: unsupported operand type (s) for *: 'float' and 'nonetype‘
- Lightweight and convenient small program to app technology solution to realize interconnection with wechat / traffic app
- vant3 +ts 封装简易step进步器组件
- USB转串口那些事儿—最大峰值串口波特率VS连续通信最高波特率
- bug记录:更新数据库时报错:Data truncation: Incorrect datetime value:
- Extreme Programming -- Practice of root cause analysis
- SQL游标(cursor)详细说明及内部循环使用示例
猜你喜欢

迄今微软不同时期发布的SQL Server各版本之间的大致区别,供参考查阅

Arm64 stack backtracking

全局锁、表锁、行锁

赛程更新| 2022微软与英特尔黑客松大赛火热报名中

Vant3+ts dropdownmenu drop-down menu, multi data can be scrolled

1.5 什么是架构师(连载)

SSM集成FreeMarker以及常用语法

WinForm, crystal report making

续2 asp.net core 路由程序基础使用演示0.2 默认控制器数据的获取到

Unprecedented analysis of Milvus source code architecture
随机推荐
An easy-to-use IDE for small programs
Schedule update | 2022 Microsoft and Intel hacker song competition is in hot registration
PHP implementation of infinite classification tree (recursion and Optimization)
Click the list page of vant3+ts+pinia tab to enter the details. The tab on the details page is highlighted in the original position, and the refresh highlight is in the first item by default
Project training of Software College of Shandong University - Innovation Training - network attack and defense shooting range experimental platform of Software College of Shandong University (XXV) - p
es7不使用父子和嵌套关系来实现一对多功能
The server time zone value ‘�й���ʱ��‘ is unrecognized or represents more than one time zone. ......
118. 杨辉三角(动态规划)
Stream流注意点
[CSP]202012-2期末预测之最佳阈值
Is Huishang futures company reliable in opening accounts and safe in trading?
低代码平台调研结果
C#操作数据库增查业务数据值内容案例学校表
Make good use of IDE, speed up R & D efficiency by 100%
Cesium抛物线方程
Vulnhub[DC3]
全局锁、表锁、行锁
Use applet to quickly generate app in seven steps
Original error interface
Guitar Pro tutorial how to set up a MIDI keyboard