Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to implement a LCD interface in AWTK

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

In this issue, the editor will bring you about how to achieve a LCD interface in AWTK. The article is rich in content and analyzes and narrates it from a professional point of view. I hope you can get something after reading this article.

1. LCD based on register

On the low-end embedded platform, there is only a few dozen KB of memory, and there is not enough memory to use framebuffer, so coordinate and color data are usually written directly to the register. Lcd_reg.inc provides register-based LCD. When using it to implement LCD for different platforms, you only need to provide two macros:

Set_window_func sets the area in which color data is to be written, which can greatly improve work efficiency compared to setting coordinates each time.

Write_data_func writes color data.

Here is the implementation of LCD on STMF103ze. Here, set_window_func is defined as TFT_SetWindow and write_data_func is defined as TFT_WriteData:

# include "tftlcd.h" # include "tkc/mem.h" # include "lcd/lcd_reg.h" typedef uint16_t pixel_t # define LCD_FORMAT BITMAP_FMT_BGR565#define pixel_from_rgb (r, g) B)\ (r) > 3) > 2) > 3)) # define pixel_to_rgba (p)\ {(0xff & (p > 11) > 5) 3) > 2) > 3)) # define pixel_to_rgba (p) \ {(0xff & (p > > 11) > 5)

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report