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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lcd.c

?? 嵌入式系統
?? C
?? 第 1 頁 / 共 5 頁
字號:
/*-----------------------------------------------------------------------------
@@
@@ (Summary)    : Driver for LCD Controller
@@
@@ (Comment)    :
@@
@@ (Author)     :
@@
@@ (History)    : Date          Modifier    Comment
@@
@@ (RCS ID)     :
@@
-----------------------------------------------------------------------------*/
#include <stdlib.h>
#include <string.h>
#include "type_def.h"
#include "amba_io.h"
#include "dev_def.h"
#include "lcd_sys_def.h"
#include "lcd_mem.h"    /* LCDMemsetWord, LCDMemcpyWord */
#include "lcd_param.h"
#include "lcd_pattern.h"
#include "lcd_def.h"
#include "lcd.h"
#include "font.h"
#define CHARHEIGHT 8
#define CHARWIDTH  8

#ifdef WIN32
#include "lcdcemu.h"
#endif//WIN32
volatile unsigned int *video_ptr = VIDEO_RAM;
/*****************************************************************************
 * Definition value
 *****************************************************************************/
#define DEF_LINE_PAT    0xFF    /* Regular line pattern value */
#define LINEBYTE  160
/*****************************************************************************
 * static variable
 *****************************************************************************/
static  unsigned long   LCD_DRAW_UPBASE;    /* Base address of RAM area to draw LCD upper panel */

static  unsigned long   LCD_DRAW_LPBASE;    /* Base address of RAM area to draw LCD lower panel */

static APD_LCD_GC current_gc;   /* The current value of LCD graphic context */

static unsigned char current_line_pat = DEF_LINE_PAT;   /* Bit patter of the current line type */

volatile unsigned char  LineData[(APD_LCD_WIDTH * APD_LCD_BPP) / 8];    /* The buffer to read one horizontal data */

/*****************************************************************************
 * prototype declaration
 *****************************************************************************/
static void LCDDrawVline(APD_LCD_POINT *, unsigned short, unsigned char *);
#if (APD_LCD_BPP <= 8)
static void LCDDrawHline(unsigned long *, unsigned char, unsigned char, unsigned char,
                             short);
#endif
static void LCDFillHline(unsigned long *, unsigned char, unsigned char, unsigned char,
                             short);
static void LCDOverwriteHline(unsigned long *, unsigned char, unsigned char,
                                  unsigned char, short, unsigned long);

#include "lcd_palette.h"
#include "lcd_pixel.h"



/******************************************************************************
@@
@@ [Name]       : LCDInit
@@
@@ [Summary]    : Initialize LCD driver
@@
@@ [Argument]   : None
@@
@@ [Return]     : None
@@
@@ [Desc]       : Initialize LCD controller register according to LCD panel
@@                definition.
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
void LCDInit(void)
{
#ifndef WIN32
    unsigned long reg;

/* Set LCDTiming0 */

    reg = 0;
    reg |= APD_LCD_HBP << 24;	//apd_lcd_hbp 	0x14
    reg |= APD_LCD_HFP << 16;	//apd_lcd_hfp	0x14
    reg |= APD_LCD_HSW << 8;	//apd_lcd_hsw	0x28
    reg |= APD_LCD_PPL << 2;	//apd_lcd_ppl	((APD_LCD_WIDTH/16) - 1) = 0x
    apd_WriteReg(LCDC_Timing0, reg);

/* Set LCDTiming1 */
    reg = 0;
    reg |= APD_LCD_VBP << 24;	//apd_lcd_vbp 	0x04
    reg |= APD_LCD_VFP << 16;	//apd_lcd_vfp	0x0f
    reg |= APD_LCD_VSW << 10;	//apd_lcd_vsw	0x03
    reg |= APD_LCD_LPP;	//apd_lcd_lpp	(APD_LCD_HEIGHT - 1) = 239 = 0xef
    apd_WriteReg(LCDC_Timing1, reg);

/* Set LCDTiming2 */
    reg = 0;
    reg |= APD_LCD_BCD << 26;	//apd_lcd_bcd   0x00
    reg |= APD_LCD_CPL << 16;	//APD_LCD_CPL=(APD_LCD_WIDTH * 3 / 8 - 1)=119
    reg |= APD_LCD_IOE << 14;   //APD_LCD_IOE   0x00
    reg |= APD_LCD_IPC << 13;	//APD_LCD_IPC	0x01
    reg |= APD_LCD_IHS << 12;	//APD_LCD_IHS	0x01
    reg |= APD_LCD_IVS << 11;	//APD_LCD_IVS	0x01
    reg |= APD_LCD_ACB << 6;	//APD_LCD_ACB	0x00
    reg |= APD_LCD_CLKSEL << 5;	//APD_LCD_CLKSEL	0x00
    reg |= APD_LCD_PCD;
    apd_WriteReg(LCDC_Timing2, reg);

/* Set LCDTiming3 */
    reg = 0;
    reg |= APD_LCD_LEE << 16;	//APD_LCD_LEE	0x00
    reg |= APD_LCD_LED;		//APD_LCD_LED	0x00
    apd_WriteReg(LCDC_Timing3, reg);

/* Set LCDIntrEnable */
    reg = 0;
    apd_WriteReg(LCDC_IntrEnable, reg);

/* Set LCDControl */
    reg = 0;
    reg |= APD_LCD_WML << 16;	//APD_LCD_WML	0x01
    reg |= APD_LCD_FIFOTEST << 15;	//APD_LCD_FIFOTEST	0x00
    
//	reg |= APD_LCD_VCI << 12;	//start of active video
	    
#ifdef APD_LCD_BEPO	//not define
    reg |= 1 << 10;
#endif
#ifdef APD_LCD_BEBO	//not define
    reg |= 1 << 9;
#endif
#ifdef APD_LCD_BGR	//not define
    reg |= 1 << 8;
#endif
    reg |= APD_LCD_DUAL << 7;	//APD_LCD_DUAL	0x00
    reg |= APD_LCD_STNIF << 6;	//APD_LCD_STNIF	0x00
    reg |= APD_LCD_STN << 5;	//APD_LCD_STN	0x01
    reg |= APD_LCD_BW << 4;	//APD_LCD_BW	0x00
    reg |= LCD_SETBPP;		//LCD_SETBPP	0x08
    apd_WriteReg(LCDC_Control, reg);

/* Set LCDStatus. Clear all interrupt factor */
    
    reg = 0x1E;
    apd_WriteReg(LCDC_Status, reg);
    
    
    
#else//WIN32
    LCD_DRAW_UPBASE = (unsigned short*)lcdemu_GetVideoRam();
    LCD_DRAW_LPBASE = (unsigned short*)lcdemu_GetVideoRamLow();
#endif//WIN32
    return;
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDDrawPixel
@@
@@ [Summary]    : Draw a pixel
@@
@@ [Argument]   : point : Coordinate data
@@
@@ [Return]     : None
@@
@@ [Desc]       : Draw the corresponding pixel of specific coordinate
@@                according to the current attribute
@@                Valid attribute : Color, Raster operation
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
void apd_LCDDrawPixel(APD_LCD_POINT *point)
{
    //unsigned long *adrs;               /* The address to write pixel data */
    //unsigned char hword, byte, bit;     /* Half word, byte and bit offset */

/* Check the area to draw */
   // if (point->x < 0 || point->x >= APD_LCD_WIDTH ||
     //   point->y < 0 || point->y >= APD_LCD_HEIGHT)
       // return;

//    LCDGetPixelAdrs(point, &adrs, &hword, &byte, &bit);
 //   LCDWritePixel(adrs, hword, byte, bit, current_gc.c);
  //  return;
    
    
    
    unsigned long *adrs;
	unsigned char hword, byte, bit;
	APD_LCD_COLOR tmp_color;
	tmp_color=current_gc.c;
    	if (point->x < 0 || point->x >= APD_LCD_WIDTH ||
        point->y < 0 || point->y >= APD_LCD_HEIGHT)
        return;
        
	LCDGetPixelAdrs(point, &adrs, &hword, &byte, &bit);
	tmp_color=current_gc.c;
	if(hword)
		{
			tmp_color = 0;
			//adrs--;
			tmp_color = (APD_LCD_COLOR)*adrs;
			tmp_color=((current_gc.c<<16)|tmp_color);
		}
		apd_LCDSetColor(tmp_color);
    	LCDSetPixelByWord(adrs,tmp_color);
    	return;
    
    
    
}

/******************************************************************************
@@
@@ [Name]       : LCDDrawVline
@@
@@ [Summary]    : Draw vertical line
@@
@@ [Argument]   : sp       : Coordinate data of the start point
@@                ep       : Y coordinate data of the end point
@@                bit_mask : The initialize value of line type bit mask
@@
@@ [Return]     : None
@@
@@ [Desc]       : Draw the specific vertical data according to the current
@@                attribute.
@@                Valid atteribute : Color, Raster operation, Line width,
@@                                   Line type
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
static void LCDDrawVline
(
APD_LCD_POINT *sp,
unsigned short yp,
unsigned char *bit_mask
)
{
    unsigned short y;
    unsigned long *adrs;               /* The address to write pixel data */
    unsigned char hword, byte, bit;     /* Half word, byte, bit offset */

/* Case of less than 1 line width */
        if (current_gc.lw <= 1) {
/* Get the address to write pixel data */
            LCDGetPixelAdrs(sp, &adrs, &hword, &byte, &bit);

/* Write the address pixel data */
            for ( y = sp->y; y <= yp; y++) {
                if (current_line_pat & *bit_mask)
                	//LCDSetPixelByShort(adrs, current_gc.c);
                    LCDWritePixel(adrs, hword, byte, bit, current_gc.c);
                adrs += LCD_OFSTPL/2;
#if ((APD_LCD_WIDTH*APD_LCD_BPP % 32) != 0)
                hword = (0 == hword) ? 1 : 0;
#endif/*(((APD_LCD_WIDTH*LCDRAM_PIXEL_BYTES) % 4) == 2)*/
                *bit_mask >>= 1;
                if(*bit_mask == 0) *bit_mask = LCD_PAT_MASK;
            }
        }
        else {
            APD_LCD_POINT p1, p2;
            APD_LCD_LINE_TYPE lt_bak;
            unsigned char lp_bak;
            APD_LCD_LINE_WIDTH lw_bak;

/* Set horizontal line for line width */
            if (sp->x < (current_gc.lw >> 1))
                p1.x = 0;
            else
                p1.x = sp->x - (current_gc.lw >> 1);
            p2.x = sp->x + (current_gc.lw & 0x01);

/* Save line type and width */
            lt_bak = current_gc.lt;
            lp_bak = current_line_pat;
            lw_bak = current_gc.lw;
#if (APD_LCD_BPP == 16)
            current_line_pat = LCD_LINE_PAT[APD_LCD_LINE_SOLID];
#else
            current_gc.lt = APD_LCD_LINE_SOLID;
#endif
            current_gc.lw = APD_LCD_LINE_THIN;

/* Draw horizontal line for line width */
            for ( y = sp->y; y <= yp; y++) {
                p1.y = p2.y = y;
                if (lp_bak & *bit_mask)
                    apd_LCDDrawHline(&p1, &p2);
                *bit_mask >>= 1;
                if (*bit_mask == 0)
                    *bit_mask = LCD_PAT_MASK;
            }

/* Return line type and width */
            current_gc.lt = lt_bak;
            current_line_pat = lp_bak;
            current_gc.lw = lw_bak;
        }
    return;
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDDrawVline
@@
@@ [Summary]    : Draw Vertical line segment
@@
@@ [Argument]   : sp : Coordinate data of the start point
@@                ep : Coordinate data of the end point
@@
@@ [Return]     : None
@@
@@ [Desc]       : Draw the specific vertical segment data according to
@@                the current attribute.
@@                Include the start point in line segment, but not
@@                the end point
@@                Valid attribute : Color, Raster operation, Line width,
@@                                  Line type
@@
@@ [History]    : Date      Modifier    Comment
@@
@@ [END]
******************************************************************************/
void apd_LCDDrawVline(APD_LCD_POINT *sp,APD_LCD_POINT *ep)
{
    APD_LCD_POINT p1, p2;
    unsigned char bit_mask;

/* Exchange the start point for the end point */
    if(sp->y > ep->y) {
        p1.x = ep->x;
        p1.y = ep->y;
        p2.x = sp->x;
        p2.y = sp->y;
    }
    else {
        p1.x = sp->x;
        p1.y = sp->y;
        p2.x = ep->x;
        p2.y = ep->y;
    }

/* Check the area to draw */
    /* Include the start point */
    if (p1.x < 0 || p1.y >= APD_LCD_HEIGHT || p1.x >= APD_LCD_WIDTH ||
        p2.y < 0)
        return;
    if (p1.y < 0)
        p1.y = 0;
    /* Not include the end point */
    if (p2.y >= APD_LCD_HEIGHT)
        p2.y = APD_LCD_HEIGHT - 1;

/* Draw vartical line for DPSTN */

#ifdef APD_LCD_DPSTN
    if (p1.y < APD_LCD_LPP && p2.y >= APD_LCD_LPP) {
        APD_LCD_POINT mp;
/* Set line type pattern */
        bit_mask = LCD_PAT_MASK;

/* Draw part of vertical line */
        LCDDrawVline(&p1, APD_LCD_LPP, &bit_mask);
/* Set the boundary coordinate between upper panel and lower panel */
        mp.x = p1.x;
        mp.y = APD_LCD_LPP;
/* Draw part of vertical line */
        LCDDrawVline(&mp, p2.y, &bit_mask);
    }
    else {
/* Set line type pattern */
        bit_mask = LCD_PAT_MASK;
/* Draw part of vertical line */
        LCDDrawVline(&p1, p2.y, &bit_mask);
    }
/* Draw vertical line for single panel */
#else
/* Set line type pattern */
    bit_mask = LCD_PAT_MASK;

/* Draw part of vertical line */
    LCDDrawVline(&p1, p2.y, &bit_mask);
#endif /* APD_LCD_DPSTN */
  return;
}

/******************************************************************************
@@
@@ [Name]       : apd_LCDDrawHline
@@
@@ [Summary]    : Draw horizontal line segment
@@
@@ [Argument]   : sp : Coordinate data of the start point
@@                ep : Coordinate data of the end point
@@ [Return]     : None
@@
@@ [Desc]       : Draw the specific horizontal line data according to
@@                the current attribute.
@@                Include the start point in line segment,
@@                but not the end point.
@@                Valid attribute : Color, Raster operation, Line width,
@@                                    Line type

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一卡二卡三卡| 高清不卡一区二区| 欧美乱熟臀69xxxxxx| 亚洲mv在线观看| 91精品国产综合久久福利软件 | 乱一区二区av| 欧美电影免费观看完整版| 国产一区二区三区精品视频| 国产亚洲精久久久久久| 99re这里只有精品6| 亚洲欧美成人一区二区三区| 欧美日韩中文精品| 国产一区中文字幕| 亚洲欧美一区二区在线观看| 欧美日韩不卡视频| 国精产品一区一区三区mba桃花 | 日韩电影在线免费看| 精品久久人人做人人爰| 成人性视频免费网站| 亚洲毛片av在线| 日韩欧美一区二区视频| 粉嫩嫩av羞羞动漫久久久| 一区二区三区丝袜| 久久综合九色综合97婷婷女人| 91在线播放网址| 理论电影国产精品| 亚洲日本中文字幕区| 制服.丝袜.亚洲.中文.综合| 国产成人精品一区二区三区四区 | 国产成人av电影在线播放| 一区二区激情小说| 国产亚洲综合性久久久影院| 在线视频观看一区| 国产精品91一区二区| 午夜久久久久久久久| 亚洲国产经典视频| 日韩欧美国产三级| 在线观看亚洲a| 风间由美性色一区二区三区| 青青草97国产精品免费观看| 国产精品灌醉下药二区| 欧美第一区第二区| 欧美日韩在线观看一区二区 | 亚洲欧洲另类国产综合| 日韩一级高清毛片| 91亚洲精品久久久蜜桃| 国产精品综合网| 蜜桃视频在线观看一区| 亚洲小说春色综合另类电影| 国产精品伦理一区二区| 日韩女优毛片在线| 欧美高清hd18日本| 色综合亚洲欧洲| 国产99精品视频| 狠狠狠色丁香婷婷综合激情 | 中文字幕亚洲成人| 国产日韩欧美亚洲| 欧美tk丨vk视频| 欧美一区二区三区四区高清| 在线观看日韩国产| 91片黄在线观看| 91在线视频网址| 成人性视频免费网站| 国产激情视频一区二区在线观看| 久久国产精品色婷婷| 男女男精品视频网| 免费一区二区视频| 天天色综合天天| 天天影视涩香欲综合网| 亚洲aaa精品| 视频在线观看一区| 丝袜诱惑制服诱惑色一区在线观看 | 2欧美一区二区三区在线观看视频| 欧美日韩一区二区三区视频| 91丨九色porny丨蝌蚪| 成人深夜福利app| 成人永久免费视频| 成人性生交大片免费看在线播放| 国产成人午夜精品5599 | 日韩国产欧美视频| 日本网站在线观看一区二区三区| 亚洲国产你懂的| 亚洲国产aⅴ天堂久久| 亚洲线精品一区二区三区| 亚洲精品日产精品乱码不卡| 亚洲一区二区三区中文字幕| 亚洲一区精品在线| 天堂成人免费av电影一区| 奇米精品一区二区三区在线观看| 男女男精品网站| 国产福利一区在线观看| av影院午夜一区| 欧美性猛交xxxx黑人交| 宅男在线国产精品| 精品国产一区二区三区久久影院| 精品国产一区二区亚洲人成毛片 | 亚洲午夜激情av| 午夜精品久久久久久久99水蜜桃 | 日本在线不卡视频一二三区| 日本亚洲天堂网| 国产乱码精品一区二区三区五月婷| 精彩视频一区二区| 国产91丝袜在线播放0| 99久久久久久| 欧美一级淫片007| 日本一二三四高清不卡| 亚洲精品中文字幕在线观看| 午夜一区二区三区视频| 另类人妖一区二区av| 高清成人免费视频| 欧美日本韩国一区| 久久综合九色欧美综合狠狠| 亚洲情趣在线观看| 三级成人在线视频| 成人av先锋影音| 51午夜精品国产| 国产精品久久久久久久久果冻传媒| 一区二区免费视频| 国产呦萝稀缺另类资源| 91国偷自产一区二区使用方法| 欧美刺激脚交jootjob| 国产精品国产三级国产有无不卡 | 日韩在线播放一区二区| 国产成人综合网| 欧美日韩黄视频| 国产精品欧美综合在线| 亚洲第一av色| 不卡欧美aaaaa| 欧美精品一区二区不卡| 亚洲国产日韩精品| 国产精品996| 日韩欧美专区在线| 亚洲综合激情小说| 国产成人免费视频一区| 日韩欧美视频一区| 亚洲成人tv网| gogo大胆日本视频一区| 精品精品欲导航| 婷婷综合另类小说色区| 99久久婷婷国产综合精品| 久久久亚洲国产美女国产盗摄| 亚洲制服丝袜在线| 成人av网在线| 久久久青草青青国产亚洲免观| 天堂一区二区在线| 欧美在线一二三| 最好看的中文字幕久久| 国产精品一区二区无线| 日韩欧美的一区| 日韩精品一级二级| 欧美日韩免费视频| 亚洲精品乱码久久久久| av色综合久久天堂av综合| 久久精品网站免费观看| 久久精品国产久精国产| 6080亚洲精品一区二区| 亚洲图片欧美视频| 91官网在线免费观看| 中文字幕在线观看不卡| 国产成人av电影在线| 久久精品夜夜夜夜久久| 国模套图日韩精品一区二区| 欧美mv日韩mv国产网站app| 日韩高清一级片| 欧美三级日本三级少妇99| 一区二区免费在线| 欧美性一区二区| 亚洲国产精品久久久久婷婷884 | 亚洲美女区一区| 色综合久久综合网97色综合 | 精品在线免费观看| 欧美刺激午夜性久久久久久久| 免费成人在线网站| 日韩精品一区二区三区swag | 亚洲精品一二三四区| 99re热这里只有精品免费视频| 国产精品久久久久久久第一福利| gogogo免费视频观看亚洲一| 亚洲日本成人在线观看| 欧美性猛交xxxx乱大交退制版| 亚洲国产综合在线| 欧美一区二区三区小说| 黄色资源网久久资源365| 国产欧美日产一区| 99精品久久99久久久久| 一级精品视频在线观看宜春院 | 337p粉嫩大胆色噜噜噜噜亚洲| 国产大片一区二区| 亚洲欧美偷拍另类a∨色屁股| 欧美影院一区二区三区| 秋霞午夜av一区二区三区| 久久亚洲精华国产精华液| av一二三不卡影片| 亚洲成人自拍网| 欧美精品一区二区三区一线天视频 | 91精品国产欧美日韩| 激情综合色丁香一区二区| 亚洲国产成人午夜在线一区| 欧美亚洲动漫精品| 久久99国内精品|