亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? tft_s1033.c

?? ARMSTM32 lcd驅(qū)動程序集錦
?? C
?? 第 1 頁 / 共 2 頁
字號:
/******************************************************************************
 ** File Name:     cstn_pcf8833.c                                             *
 ** Description:															  *
 **    This file contains driver for color LCD.(CSTN)						  *
 ** Author:         Jim zhang                                                 *
 ** DATE:           03/01/2004                                                *
 ** Copyright:      2004 Spreatrum, Incoporated. All Rights Reserved.         *
 ** Description:                                                              *
 ******************************************************************************

 ******************************************************************************
 **                        Edit History                                       *
 ** ------------------------------------------------------------------------- *
 ** DATE           NAME             DESCRIPTION                               *
 ** 02/04/2004     louis.wei	    Create.
 ** 11/15/2005     David.Jia        Modify for GG3728 (S1033/HYDIS).         *
 ** 11/22/2005     David.Jia        Modify ADC value in Probe; Entersleep code*
 ** 12/09/2005     David.Jia        Implemetation SetDisplayWindow function.  *
 ** 12/26/2005	   David.Jia		Deal can't DC preview on S1033 LCD.	  *
 ** 03/03/2006     David.Jia        cr42033, LCD ADC range changed: HX8309,   *
 **     200-230; S1033, 231-249; S1D19105, 250-280.                          *
 ******************************************************************************/

#include "os_api.h"
#include "sci_types.h"
//#include "lcd_api.h"
#include "gpio_api.h"
#include "lcd.h"
// #include "mv3lib.h"

 #ifdef   __cplusplus
    extern   "C" 
    {
#endif

/**---------------------------------------------------------------------------*
 **                            Macro Define
 **---------------------------------------------------------------------------*/

#define	S1033_WIDTH	128//176
#define	S1033_HEIGHT	160//220
#define MP4_MAX_WIDTH	176
#define MP4_MAX_HEIGHT	144

#define OFFSET_X	0

//@David.Jia 2005.11.22
#define ADC_S1033_LOW    231
#define ADC_S1033_HIGH   249           //@David.Jia 2006.3.3 cr42033

#define LCD_USE_DMA
extern void dma_init(void);

extern void *LCD_GetLCDBuffer(void);

  /******************************************************************************/
//  Description:   Clear color LCD with one color
//	Global resource dependence: 
//  Author:         louis.wei
//	Note:
/******************************************************************************/
LOCAL void S1033_Clear(
						uint32 color	//color to fill the whole lcd.
						);
  /******************************************************************************/
//  Description:   Close the lcd.(include sub lcd.)
//	Global resource dependence: 
//  Author:         Jim.zhang
//	Note:
/******************************************************************************/
LOCAL void S1033_Close(void);

  /******************************************************************************/
//  Description:   Enter/Exit sleep mode .
//	Global resource dependence: 
//  Author:         Jim.zhang
//	Note:
/******************************************************************************/
LOCAL ERR_LCD_E  S1033_EnterSleep(
	BOOLEAN is_sleep 	//SCI_TRUE: exter sleep mode;SCI_FALSE:exit sleep mode.
	);

/*****************************************************************************/
//  Description:    Get the lcd base information..
//	Global resource dependence: 
//  Author:         louis.wei
//	Note:
/*****************************************************************************/
LOCAL  ERR_LCD_E   S1033_GetInfo(
								   LCD_INFO_T *lcd_info_ptr	//lcd information struct pointer
								   );

/******************************************************************************/
//  Description:    get the important parameter for digital camera
//	Global resource dependence: 
//  Author:         Zhemin.lin
//	Note:           
/******************************************************************************/
LOCAL ERR_LCD_E  S1033_GetMainLcdSpec(
	LCD_SPEC_T *spec_ptr 	//spec struct pointer
	);

/*********************************************************************/
//  Description:   Initialize color LCD : S1033
//  Input:
//      None.
//  Return:
//      None.
//	Note:           
/*********************************************************************/
LOCAL ERR_LCD_E S1033_Init(void);

/******************************************************************************/
//  Description:   invalidate a rectang of in LCD
//	Global resource dependence: 
//  Author:         Jim.zhang
//	Note:
/******************************************************************************/
LOCAL ERR_LCD_E S1033_Invalidate(void);

/******************************************************************************/
//  Description:   Copy a retangle data from clcd_buffer to display RAM.
//                     then the rectangle display is to be refreshed
//	Global resource dependence: 
//  Author:         Jim.zhang
//	Note:       
//     To improve speed, lcd is operate in HIGH SPEED RAM WRITE MODE(4
//     uint16 are write continuously always.) So, some dummy uint16 
//     should be inserted to satisfy this mode.   Please refer to spec.
/******************************************************************************/
LOCAL ERR_LCD_E S1033_InvalidateRect(
	uint16 left, 	//the left value of the rectangel
	uint16 top, 	//top of the rectangle
	uint16 right, 	//right of the rectangle
	uint16 bottom	//bottom of the rectangle
	);
	
/******************************************************************************/
//  Description:  for mp4 display
//	Global resource dependence: 
//  Author:  juan.zhang

/******************************************************************************/
LOCAL ERR_LCD_E S1033_InvalidateRectImage(
	uint16 left, 	//the left value of the rectangel
	uint16 top, 	//top of the rectangle
	uint16 right, 	//right of the rectangle
	uint16 bottom,	//bottom of the rectangle
	uint16 *buf_ptr,
	uint8  is_invert//ignore
	);
/******************************************************************************/
//  Description:   LCD go to sleep mode
//  Author:         Yingchun.li
//	Note: 
/******************************************************************************/
LOCAL S1033_GoSleep(void);
/******************************************************************************/
//  Description:   LCD exit sleep mode
//  Author:         Yingchun.li
//	Note: 
/******************************************************************************/
LOCAL S1033_ExitSleep(void);

LOCAL void main_lcd_fill_rect(uint16 left, uint16 top,uint16 right,  uint16 bottom,uint16 color);
/**---------------------------------------------------------------------------*
 **                      Function  Definitions
 **---------------------------------------------------------------------------*/
extern uint32 dma_request(uint32 chid, uint32 saddr, uint32 daddr, uint32 size, uint32 transfer_mode, uint32 size_mode);

#define S1033_SEND_COMMAND( c)   		{*(volatile uint16 *)0x58000000 = c;}
	
#define  S1033_SEND_DATA(d) 	{*(volatile uint16 *)0x58020000 = d;}
 
#define S1033_sendcommand1(command, data) {*(volatile uint16 *)0x58000000 = command;*(volatile uint16 *)0x58020000 = data;}


//LOCAL void S1033_HW_reset(void)
//{
//	GPIO_SetLcdReset(0);
//	Delayms(10);
//	GPIO_SetLcdReset(1);
//	Delayms(10);
//}

LOCAL void S1033_reset(void)
{
	SCI_TRACE_LOW("S1033_reset: 7370 GG3728 S1033/HYDIS.");
	S1033_sendcommand1(0x0000, 0x0001);
	Delayms(20);

	S1033_sendcommand1(0x0007, 0x0027); //added
	Delayms(30);
	S1033_sendcommand1(0x0010, 0x0000); 
	Delayms(30);

	S1033_sendcommand1(0x0011, 0x0210); 

	S1033_sendcommand1(0x0012, 0x0000); 
	Delayms(30);

	S1033_sendcommand1(0x0013, 0x080e); 
	Delayms(30);  //0x08,0x0c

	S1033_sendcommand1(0x0014, 0x2517); 
	Delayms(30);  //0x09,0x19  //06 16

	S1033_sendcommand1(0x0010, 0x1910); 
	Delayms(30);//

	S1033_sendcommand1(0x0013, 0x081e); 
	Delayms(100);

	S1033_sendcommand1(0x0001, 0x090C); 

	S1033_sendcommand1(0x0002, 0x0200); 

	S1033_sendcommand1(0x0003, 0x1030); 

	S1033_sendcommand1(0x0008, 0x0503); 

	S1033_sendcommand1(0x000B, 0x0000); 

	S1033_sendcommand1(0x000C, 0x0000); 

	S1033_sendcommand1(0x0030, 0x0300); 

	S1033_sendcommand1(0x0031, 0x0003); 

	S1033_sendcommand1(0x0032, 0x0000); 

	S1033_sendcommand1(0x0033, 0x0200); 

	S1033_sendcommand1(0x0034, 0x0300); 

	S1033_sendcommand1(0x0035, 0x0003); 

	S1033_sendcommand1(0x0036, 0x0000); 

	S1033_sendcommand1(0x0037, 0x0002); 

	S1033_sendcommand1(0x0038, 0x0a00); 

	S1033_sendcommand1(0x0040, 0x0000); 

	S1033_sendcommand1(0x0042, 0x9F00); 

	S1033_sendcommand1(0x0043, 0x0000); 

	S1033_sendcommand1(0x0044, 0x7F00); 

	S1033_sendcommand1(0x0045, 0x9F00); 
	Delayms(30);

	S1033_sendcommand1(0x0007, 0x0001); 
	Delayms(30);

	S1033_sendcommand1(0x0007, 0x0021); 

	S1033_sendcommand1(0x0007, 0x0023); 
	Delayms(30);

	S1033_sendcommand1(0x0007, 0x1037); 

	S1033_sendcommand1(0x0021, 0x0000); 

	S1033_SEND_COMMAND(0x0022); 
	Delayms(30);
}

  /******************************************************************************/
//  Description:   Clear color LCD with one color
//	Global resource dependence: 
//  Author:         louis.wei
//	Note:
 //  modify:  jim.cui	2005.0728  use dma to transport data  
/******************************************************************************/
LOCAL void S1033_Clear(
						uint32 color	//color to fill the whole lcd.
						)
{
	uint32 i;
	uint16 *buf_ptr = (uint16 *)LCD_GetLCDBuffer();

	uint16  fill_color = color;
	
	for(i=0; i<(S1033_HEIGHT ); i++)
	{

            dma_request(0, (uint32)&fill_color, (uint32)(buf_ptr + i * S1033_WIDTH), S1033_WIDTH, 
                                     1, 1);
		
	}

	S1033_Invalidate();
}

/******************************************************************************/
//  Description:   invalidate a rectang of in LCD
//	Global resource dependence: 
//  Author:         Jim.zhang
//	Note:
//  modify:  jim.cui  2005.0728  use  dma to transport data  
/******************************************************************************/
LOCAL ERR_LCD_E S1033_Invalidate(void)
{
	uint16 i,j;
	uint16 address = 0;
	uint16 *buf_ptr = (uint16 *)LCD_GetLCDBuffer();
	
#ifdef LCD_USE_DMA	
	uint32  dummy_before,dummy_after;

	
	address = (uint16) ( (((S1033_WIDTH - 1 + OFFSET_X) & 0xFF ) << 8 ) | (OFFSET_X));
	S1033_sendcommand1(0x44, address);		// set horizon address
	address = (uint16) ( ((S1033_HEIGHT-1) & 0xFF) << 8 );

	S1033_sendcommand1(0x45, address);	// set vertical address
	S1033_sendcommand1(0x0021, OFFSET_X);	
	S1033_SEND_COMMAND(0x0022); 			// send data.

	dummy_before =  1 % 4;		// Inserted numbers befor every arrow.
	dummy_after =  3 - (S1033_WIDTH % 4);	// Inserted numbers after every arrow.
        
	for(j=0; j<(S1033_HEIGHT ); j++)
	{

            dma_request(0, (uint32)(buf_ptr + j * S1033_WIDTH), 0x58020000, S1033_WIDTH, 
                                     1, 0);
		
	}

#else
	SCI_TRACE_LOW("tft_S1033.c S1033_Invalidate line%d", __LINE__);
	
	address = (uint16) ( (((S1033_WIDTH - 1 + OFFSET_X) & 0xFF ) << 8 ) | (OFFSET_X));	
	S1033_sendcommand1(0x44, address);		// set horizon address


	address = (uint16) ( ((S1033_HEIGHT-1) & 0xFF) << 8 );
	S1033_sendcommand1(0x45, address);	// set vertical address

	// Set start RAM address (AC register)	
	S1033_sendcommand1(0x21, OFFSET_X);	
	S1033_SEND_COMMAND(0x0022); 			// send data.
	
	for(i=0; i<(S1033_WIDTH * S1033_HEIGHT); i++)
		S1033_SEND_DATA( *buf_ptr++ );
		
#endif
		
	return ERR_LCD_NONE;
}

/*****************************************************************************/
//  Description:    Get the lcd base information..
//	Global resource dependence: 
//  Author:         louis.wei
//	Note:
/*****************************************************************************/
LOCAL  ERR_LCD_E   S1033_GetInfo(
								   LCD_INFO_T *lcd_info_ptr	//lcd information struct pointer
								   )
{
	if ( PNULL == lcd_info_ptr )
	{
		return ERR_LCD_POINTER_NULL;	
	}
	
	lcd_info_ptr->r_bitmask			= 0xf800;
	lcd_info_ptr->g_bitmask			= 0x07e0;
	lcd_info_ptr->b_bitmask			= 0x001f;
	lcd_info_ptr->bits_per_pixel	= 16;
	lcd_info_ptr->contrast_min		= 0x00;
	lcd_info_ptr->contrast_max   	= 63;
	lcd_info_ptr->contrast_defaut	= 0x0A;
	
	lcd_info_ptr->lcd_width		= S1033_WIDTH;
	lcd_info_ptr->lcd_height	= S1033_HEIGHT;
	lcd_info_ptr->lcdbuff_ptr	= (void *)LCD_GetLCDBuffer();
		
	return ERR_LCD_NONE;
}

/******************************************************************************/
//  Description:   Set the windows address to display, in this windows
//                 color is  refreshed.
//	Global resource dependence: 
//  Author:         Jim.zhang
//	Note:
/******************************************************************************/
__inline void S1033_set_display_window(
	uint8 left, 	// start Horizon address
	uint8 top, 		// start Vertical address
	uint8 right, 	// end Horizon address
	uint8 bottom	// end Vertical address
	)
{
	uint16 address = 0;

	address = (uint16) ((((right & 0xFF) + OFFSET_X)<<8) | ((left & 0xFF) + OFFSET_X));
	S1033_sendcommand1(0x44, address);		// set horizon address
	address = (uint16) (((bottom & 0xFF)<<8) | (top & 0xFF));
	S1033_sendcommand1(0x45, address);	// set vertical address
}


/******************************************************************************/
//  Description:  Set start RAM address which is write to AC(Address
//                Counter) register.
//  Input:
//      left: start Horizon address of AC
//      top: start Vertical address of AC.
//  Return:
//      None.
//	Note:           
/******************************************************************************/
__inline void S1033_set_start_address(
	uint8 left, 
	uint8 top
	)
{
	uint16 address = 0;
		
	address = (uint16) (((top & 0xFF)<<8) | ((left & 0xFF) + OFFSET_X));
	S1033_sendcommand1(0x21, address);	// Set start RAM address (AC register)
}

/******************************************************************************/
//  Description:   Copy a retangle data from clcd_buffer to display RAM.
//                     then the rectangle display is to be refreshed
//	Global resource dependence: 
//  Author:         Jim.zhang
//	Note:       
//     To improve speed, lcd is operate in HIGH SPEED RAM WRITE MODE(4
//     uint16 are write continuously always.) So, some dummy uint16 
//     should be inserted to satisfy this mode.   Please refer to spec.
//  modify:  jim.cui  2005.0728  use  dma to transport data  
/******************************************************************************/

LOCAL ERR_LCD_E S1033_InvalidateRect(
	uint16 left, 	//the left value of the rectangel
	uint16 top, 	//top of the rectangle
	uint16 right, 	//right of the rectangle
	uint16 bottom	//bottom of the rectangle
	)
{
	uint32 i, j;
	uint32 dummy_before, dummy_after;
	uint32 row, column,rect_width;
	uint16 *buf_ptr = (uint16 *)LCD_GetLCDBuffer();
	
    //SCI_TRACE_LOW("tft_S1033.c S1033_InvalidateRect line%d: left = %d, top = %d, right = %d, bottom = %d", __LINE__, left, top, right,bottom);
  	left 	= (left >= S1033_WIDTH)    ? S1033_WIDTH-1 : left;
	right 	= (right >= S1033_WIDTH)   ? S1033_WIDTH-1 : right;
	top 	= (top >= S1033_HEIGHT)    ? S1033_HEIGHT-1 : top;
	bottom 	= (bottom >= S1033_HEIGHT) ? S1033_HEIGHT-1 : bottom;

	if ( ( right < left ) || ( bottom < top ) )
	{
		return ERR_LCD_PARAMETER_WRONG;
	}
 
 	 	
	S1033_set_display_window(left, top, right, bottom);
	
	// In High Speed RAM Write Mode. Maybe some dummy data are insterted.
	dummy_before =  (left) % 4;		// Inserted numbers befor every arrow.

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www.在线成人| 国产精品色呦呦| 欧美丰满少妇xxxbbb| 91麻豆免费视频| eeuss鲁片一区二区三区在线观看| 狠狠色丁香婷综合久久| 免费高清成人在线| 日韩电影一区二区三区| 日韩精品电影在线观看| 日韩电影在线一区二区| 蜜桃视频一区二区三区| 秋霞成人午夜伦在线观看| 日韩中文字幕亚洲一区二区va在线| 亚洲激情图片qvod| 亚洲高清在线精品| 日韩av一区二| 韩国午夜理伦三级不卡影院| 韩国精品免费视频| 成人一区二区三区| 波多野结衣的一区二区三区| 色婷婷亚洲婷婷| 欧美欧美午夜aⅴ在线观看| 欧美一卡2卡三卡4卡5免费| 欧美成人激情免费网| 久久综合国产精品| 国产精品国产三级国产aⅴ入口| 日韩美女视频一区二区 | 日韩网站在线看片你懂的| 91精品国产综合久久香蕉的特点| 欧美一区二区视频网站| 2020国产精品自拍| 1024成人网| 亚洲成av人片在线| 国产一区欧美日韩| 99精品久久只有精品| 欧美日韩aaaaaa| 久久综合资源网| 亚洲天堂精品视频| 日本vs亚洲vs韩国一区三区二区 | 中文文精品字幕一区二区| 最新热久久免费视频| 亚洲国产精品久久人人爱蜜臀| 青青国产91久久久久久| 粉嫩一区二区三区性色av| 色老头久久综合| 欧美不卡一区二区| 亚洲女同一区二区| 日本欧美一区二区| 成人av资源下载| 欧美一区二区三区精品| 国产农村妇女精品| 亚洲国产成人av| 国产 欧美在线| 7777精品伊人久久久大香线蕉| 久久亚洲综合色| 亚洲精品乱码久久久久久黑人 | 高清在线观看日韩| 欧美视频一区在线| 国产欧美一区二区精品忘忧草| 亚洲一区影音先锋| 国v精品久久久网| 日韩一区二区三区免费观看| 国产精品久久久久影视| 九九精品视频在线看| 欧美偷拍一区二区| 国产精品视频yy9299一区| 日本美女视频一区二区| 一本一道波多野结衣一区二区| 久久久久久久精| 日韩精品免费专区| 色视频欧美一区二区三区| 欧美xxxxx裸体时装秀| 亚洲高清免费在线| aaa欧美色吧激情视频| 久久午夜老司机| 日本美女视频一区二区| 91久久人澡人人添人人爽欧美| 久久久久久久精| 久久国产精品99精品国产| 欧美视频日韩视频在线观看| 国产精品欧美久久久久无广告| 精久久久久久久久久久| 欧美高清视频不卡网| 亚洲激情av在线| 不卡一区中文字幕| 国产清纯在线一区二区www| 免费成人性网站| 欧美精品久久久久久久多人混战| 亚洲欧美另类小说| 99国内精品久久| 国产精品国产三级国产专播品爱网| 国产综合色产在线精品| 精品乱人伦小说| 日韩精品视频网站| 制服丝袜亚洲精品中文字幕| 亚洲线精品一区二区三区八戒| 91一区二区三区在线观看| 国产精品乱子久久久久| 丰满岳乱妇一区二区三区| 久久精品一区八戒影视| 国产精品一区二区不卡| 久久久久成人黄色影片| 国产一区二区在线看| 精品国产免费久久| 精品一区二区在线视频| 精品久久久久久久久久久院品网 | 一本久久综合亚洲鲁鲁五月天| 国产欧美视频在线观看| 丰满少妇久久久久久久| 日本一区二区三区dvd视频在线| 狠狠色伊人亚洲综合成人| 久久久亚洲午夜电影| 国产精品白丝jk黑袜喷水| 国产午夜精品一区二区三区四区| 国产精品一区二区在线播放| 国产欧美视频一区二区三区| 成人激情动漫在线观看| 日韩美女啊v在线免费观看| 91污片在线观看| 亚洲与欧洲av电影| 欧美精品18+| 老司机精品视频导航| 久久精品视频在线看| 成人精品一区二区三区中文字幕 | k8久久久一区二区三区 | 婷婷国产v国产偷v亚洲高清| 91精品在线免费| 久久99国产精品免费网站| 欧美精品一区二| www.亚洲色图.com| 性感美女极品91精品| 日韩一级欧美一级| 国产成人亚洲综合a∨婷婷| 国产精品毛片久久久久久久| 色婷婷综合久色| 蜜桃视频第一区免费观看| 久久久久国产精品麻豆ai换脸 | 色妹子一区二区| 天天色综合天天| 久久久久国产精品麻豆| 91丝袜国产在线播放| 偷拍与自拍一区| 国产亚洲婷婷免费| 色哟哟日韩精品| 精品在线一区二区| 亚洲三级视频在线观看| 欧美一区二区三区在线看| 国产999精品久久| 亚洲丰满少妇videoshd| 精品国产91九色蝌蚪| 91美女在线观看| 九九精品一区二区| 亚洲男人电影天堂| 26uuu成人网一区二区三区| 色综合色狠狠综合色| 美女mm1313爽爽久久久蜜臀| 国产精品乱人伦中文| 日韩亚洲欧美中文三级| 99re这里只有精品首页| 毛片av一区二区| 亚洲婷婷综合久久一本伊一区| 欧美一区二视频| 94-欧美-setu| 激情成人综合网| 亚洲国产精品久久久男人的天堂| 337p粉嫩大胆噜噜噜噜噜91av| 色94色欧美sute亚洲线路一ni | 91小视频免费观看| 精品一区二区综合| 午夜视频在线观看一区| 国产精品日韩成人| 精品久久久久久久久久久久久久久| 色狠狠色狠狠综合| 成人做爰69片免费看网站| 理论片日本一区| 亚洲mv在线观看| 亚洲欧洲国产专区| 久久久久久久免费视频了| 欧美一区二区视频在线观看| 在线中文字幕不卡| 成人爱爱电影网址| 国内精品伊人久久久久av一坑| 亚洲福利电影网| 亚洲免费三区一区二区| 国产三级欧美三级日产三级99| 91精品国产手机| 欧美日韩高清不卡| 在线观看成人小视频| av福利精品导航| 国产一区二区精品在线观看| 美女网站在线免费欧美精品| 午夜精彩视频在线观看不卡| 一区二区视频在线| 国产精品视频一二| 国产片一区二区三区| 久久综合国产精品| 亚洲精品在线观看网站| 日韩精品中文字幕一区二区三区 | 色综合久久九月婷婷色综合| av综合在线播放|