Levetop / LT768x Coding - Libraries & Examples (1)

This paragraph is to explain how users can display a picture stored in an external SPI Flash.

Function:

LT768_DMA_24bit_Block( 

unsigned char SCS,                    //CS of the SPI Flash ->  SCS:0  or  SCS:1

unsigned char Clk,                      //SPI Clock = System Clock / {(Clk+1) * 2} -> usually set to 0

unsigned short X1,                      //Start location of the picture on the LCD, left-top X coordinate

unsigned short Y1,                      //Start location of the picture on the LCD, left-top Y coordinate 

unsigned short X_W,                   //Transfering Data Width

unsigned short Y_H,                    //Transfering Data height

unsigned short P_W,                   //Picture width

unsigned long Addr                     //Picture address in the SPI Flash

)

Example:  To display an 1024x600 picture of 16bit color depths onto the LCD.

#include LT768.h
#include LT768_Lib.h   

//Define Resolution
#define LCD_XSIZE_TFT	1024
#define LCD_YSIZE_TFT	600

//Define layers of the SDRAM in LT768x
#define layer1_start_addr 0
#define layer2_start_addr LCD_XSIZE_TFT*LCD_YSIZE_TFT*2
#define layer3_start_addr LCD_XSIZE_TFT*LCD_YSIZE_TFT*2*2
#define layer4_start_addr LCD_XSIZE_TFT*LCD_YSIZE_TFT*2*3
#define layer5_start_addr LCD_XSIZE_TFT*LCD_YSIZE_TFT*2*4
#define layer6_start_addr LCD_XSIZE_TFT*LCD_YSIZE_TFT*2*5
#define layer7_start_addr LCD_XSIZE_TFT*LCD_YSIZE_TFT*2*6

//Define picture address in the flash
#define Picture_1_Addr	0

int main(void) 
{
 
 LT768_Init();    //Initialize LT768x
 Display_ON();
 
 //Setting for the Display and the SRAM ///
 Select_Main_Window_16bpp();                     //Set the color depth

 Main_Image_Start_Address(layer1_start_addr);    //Set the start address of the 
                                                 //LT768x SRAM
 Main_Image_Width(LCD_XSIZE_TFT);                //Set the width of the main window
 Main_Image_Start_XY(0, 0);                      //Set the start coordinate of the
                                                 //main window
 
 //Set the start address of the SRAM for programming the data from flash 
 Canvas_Image_Start_address(layer1_start_addr);
 
 Canvas_Image_width(LCD_XSIZE_TFT);              //Set the designated width of the 
                                                 //SRAM                            

 Active_Window_XY(0,0);                          //Set the start coordinate of the 
                                                 //working area
 Active_Window_WH(LCD_XSIZE_TFT, LCD_YSIZE_TFT); //Set the width and height of the 
                                                 //working area
 //End of Setting for the Display and the SRAM 


 //Display a picture stored in the external flash
 LT768_DMA_24bit_Block(1, 0, 0, 0, LCD_XSIZE_TFT, LCD_YSIZE_TFT, LCD_XSIZE_TFT, Picture_1_Addr);
}

Running result: 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
LT7681/7683/7686(LT768x)是三款高效能 TFT-LCD 图形加速显示芯片。 其主要的功能就是协助 MCU 将所要显示到 TFT 屏的内容传递给 TFT 驱动 器(Driver),并且提供图形加速、PIP(Picture-in-Picture)、几何图形 绘图等功能,除了提升显示效率外,还大大的降低 MCU 处理图形显示所花 费的时间,而 LT768x 也支持非常宽广的显示分辨率,可以由 320*240 (QVGA)到 1280*1024(SXGA),显示屏则支持 16/18/24bits 的 RGB 接口。LT768x 支持各种 MCU 接口,包括 SPI、I2C 的串口,或者是 8 位、16 位并 行接口。为了达到多层次高分辨率的显示效果,LT768x 内建 128Mb 显示内 存,可以支持从每像素 1bit 的 2 灰阶到高达每像素 24bits 的 16M 颜色显示。同时要减少动画显示的 MCU 在 软件操作上的负担,LT768x 内建几何绘图引擎,支持画点、画线、画曲线、椭圆、三角形、矩形、圆角矩形等 功能,同时内嵌的硬件图形加速引擎(BTE)提供了命令类型的图形操作,如显示旋转、画面镜射、画中画(PIP/ 子母画面)及图形混合透明显示等功能,大大提升了产品的显示效能,因而能够极大程度地减轻 MCU 的软件运行 负担,如果使用高速的 SPI 接口更能减少 MCU I/O 口的需求,而不必为了 TFT 屏而去升级 MCU。LT768x 强大的 显示功能非常适合用在有 TFT-LCD 屏的电子产品上,如家电、多功能事务机、工业设备、工业控制、电子仪器、 医疗设备、人机接口、检测设备等产品。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值