The OP
Published on 2022-9-23 15:13
Only look at the author
This post is from GD32 MCU
Latest reply
static void tli_config(void)
{
tli_parameter_struct tli_init_struct;
tli_layer_parameter_struct tli_layer_init_struct;
rcu_periph_clock_enable(RCU_TLI);
tli_gpio_config();
rcu_pll_input_output_clock_range_config(IDX_PLL2, RCU_PLL2RNG_1M_2M, RCU_PLL2VCO_150M_420M);
/* configure the PLL2 clock: CK_PLL2P/CK_PLL2Q/CK_PLL2R = HXTAL_VALUE / 25 * 150 / 3 */
if(ERROR == rcu_pll2_config(25, 150, 3, 3, 3)) {
while(1) {
}
}
rcu_pll_clock_output_enable(RCU_PLL2R);
rcu_tli_clock_div_config(RCU_PLL2R_DIV8);
rcu_osci_on(RCU_PLL2_CK);
if(ERROR == rcu_osci_stab_wait(RCU_PLL2_CK)) {
while(1) {
}
}
/* configure TLI parameter struct */
tli_init_struct.signalpolarity_hs = TLI_HSYN_ACTLIVE_LOW; //水平同步极性
tli_init_struct.signalpolarity_vs = TLI_VSYN_ACTLIVE_LOW; //垂直同步极性
tli_init_struct.signalpolarity_de = TLI_DE_ACTLIVE_LOW; //数据使能极性
tli_init_struct.signalpolarity_pixelck = TLI_PIXEL_CLOCK_TLI; //像素时钟极性
/* LCD display timing configuration */
tli_init_struct.synpsz_hpsz = HORIZONTAL_SYNCHRONOUS_PULSE - 1; //水平同步
tli_init_struct.synpsz_vpsz = VERTICAL_SYNCHRONOUS_PULSE - 1; //垂直同步宽度
tli_init_struct.backpsz_hbpsz = HORIZONTAL_SYNCHRONOUS_PULSE + HORIZONTAL_BACK_PORCH - 1; //水平同步后沿宽度
tli_init_struct.backpsz_vbpsz = VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH - 1; //垂直同步后沿高度
tli_init_struct.activesz_hasz = HORIZONTAL_SYNCHRONOUS_PULSE + HORIZONTAL_BACK_PORCH + ACTIVE_WIDTH - 1; //有效宽度
tli_init_struct.activesz_vasz = VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH + ACTIVE_HEIGHT - 1; //有效高度
tli_init_struct.totalsz_htsz = HORIZONTAL_SYNCHRONOUS_PULSE + HORIZONTAL_BACK_PORCH + ACTIVE_WIDTH + //总宽度
HORIZONTAL_FRONT_PORCH - 1;
tli_init_struct.totalsz_vtsz = VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH + ACTIVE_HEIGHT + //总高度
VERTICAL_FRONT_PORCH - 1;
/* configure LCD background R,G,B values */
tli_init_struct.backcolor_red = 0xFF; //背景设为白色
tli_init_struct.backcolor_green = 0xFF;
tli_init_struct.backcolor_blue = 0xFF;
tli_init(&tli_init_struct);
/* TLI layer configuration 层初始化配置 */
tli_layer_init_struct.layer_window_leftpos = 80 + HORIZONTAL_SYNCHRONOUS_PULSE +
HORIZONTAL_BACK_PORCH + 2;
tli_layer_init_struct.layer_window_rightpos = (80 + 320 + HORIZONTAL_SYNCHRONOUS_PULSE +
HORIZONTAL_BACK_PORCH - 1);
tli_layer_init_struct.layer_window_toppos = 150 + VERTICAL_SYNCHRONOUS_PULSE + VERTICAL_BACK_PORCH;
tli_layer_init_struct.layer_window_bottompos = (150 + 100 + VERTICAL_SYNCHRONOUS_PULSE +
VERTICAL_BACK_PORCH - 1);
tli_layer_init_struct.layer_ppf = LAYER_PPF_RGB565;
tli_layer_init_struct.layer_sa = 0xFF; //层透明度 255 为完全不透明
tli_layer_init_struct.layer_default_blue = 0xFF;
tli_layer_init_struct.layer_default_green = 0xFF;
tli_layer_init_struct.layer_default_red = 0xFF;
tli_layer_init_struct.layer_default_alpha = 0x0; //该层显示范围外的颜色
tli_layer_init_struct.layer_acf1 = LAYER_ACF1_PASA; //层混模式 归一化的像素alpha 乘以归一化的恒定 alpha
tli_layer_init_struct.layer_acf2 = LAYER_ACF2_PASA; //归一化gImage_logo的像素alhpa,
tli_layer_init_struct.layer_frame_bufaddr = (uint32_t)&gImage_logo;; //缓存地址
tli_layer_init_struct.layer_frame_line_length = ((320 * 2) + 3); //行长度 这个值为一行的字节数+3
tli_layer_init_struct.layer_frame_buf_stride_offset = (320 * 2); //步幅偏移,定义了从某行起始处到下一行起始处之间的字节数
tli_layer_init_struct.layer_frame_total_line_number = 100; //总行数 定义了一帧行数
tli_layer_init(LAYER0, &tli_layer_init_struct);
}
I saw that the screen driver looks like this:
Details
Published on 2024-3-3 09:16
| ||
|
||
littleshrimp
Currently offline
|
2
Published on 2022-9-26 20:21
Only look at the author
This post is from GD32 MCU
Comments
I analyzed the Logo image data and tried to add a box around the image, which was initially successful. The following figure shows the addition of left and right vertical lines and some horizontal lines. Since the verification was successful, I did not continue to modify the data to close the box. [attachimg]644776[/attachimg] &
Details
Published on 2022-9-27 10:36
| |
Personal signature虾扯蛋,蛋扯虾,虾扯蛋扯虾
|
||
|
lugl4313820
Currently offline
|
3
Published on 2022-9-26 22:57
Only look at the author
This post is from GD32 MCU
| |
|
||
|
This post is from GD32 MCU
| ||
|
||
|
This post is from GD32 MCU
Comments
The MCU screen seems to be processed in terms of timing.
Details
Published on 2024-3-3 09:13
| ||
|
||
|
|
|
|
lugl4313820
Currently offline
|
7
Published on 2024-3-3 09:13
Only look at the author
This post is from GD32 MCU
| |
|
||
|
lugl4313820
Currently offline
|
8
Published on 2024-3-3 09:14
Only look at the author
This post is from GD32 MCU
| |
|
||
|
lugl4313820
Currently offline
|
9
Published on 2024-3-3 09:16
Only look at the author
This post is from GD32 MCU
| |
|
||
|
EEWorld Datasheet Technical Support
EEWorld
subscription
account
EEWorld
service
account
Automotive
development
circle
About Us Customer Service Contact Information Datasheet Sitemap LatestNews
Room 1530, Zhongguancun MOOC Times Building, Block B, 18 Zhongguancun Street, Haidian District, Beijing 100190, China Tel:(010)82350740 Postcode:100190