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

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

?? lcd.c

?? 嵌入式系統(tǒng)
?? C
?? 第 1 頁 / 共 5 頁
字號(hào):
/*-----------------------------------------------------------------------------
@@
@@ (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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线免费观看日韩欧美| 亚洲一区二区三区国产| 国产不卡视频在线观看| 91精品国产色综合久久ai换脸| 亚洲视频一区二区在线观看| 成人在线综合网站| 国产欧美日韩综合| av在线不卡网| 亚洲在线观看免费视频| 欧美视频中文字幕| 爽爽淫人综合网网站| 91精品国产色综合久久不卡蜜臀 | 99免费精品在线| 亚洲欧洲日韩女同| 一本色道久久综合亚洲精品按摩| 亚洲免费电影在线| 欧美精品vⅰdeose4hd| 韩国v欧美v亚洲v日本v| 国产精品嫩草99a| 欧美日韩在线三区| 国产在线精品免费av| 亚洲欧美综合在线精品| 欧美日韩久久久| 久久99精品国产91久久来源| 日本一区二区三区在线不卡| 欧美性三三影院| 激情六月婷婷综合| 亚洲精品中文在线影院| 日韩一区二区在线播放| 9i在线看片成人免费| 免费成人性网站| 亚洲男人都懂的| 久久亚洲春色中文字幕久久久| 91麻豆免费观看| 国产乱人伦偷精品视频免下载| 亚洲大片一区二区三区| 久久久无码精品亚洲日韩按摩| 欧美日韩精品综合在线| 不卡大黄网站免费看| 韩国女主播成人在线观看| 五月婷婷久久丁香| 亚洲视频在线一区| 亚洲欧洲另类国产综合| 欧美国产日韩精品免费观看| 欧美mv和日韩mv国产网站| 欧美日本一区二区在线观看| 色综合天天综合网天天狠天天 | 天天操天天色综合| 亚洲另类在线视频| 一区二区三区蜜桃| 亚洲激情男女视频| 亚洲精品午夜久久久| 亚洲黄色免费网站| 午夜久久久影院| 日韩电影在线一区| 另类人妖一区二区av| 久久精品国产精品亚洲红杏| 久久精品国产一区二区三 | 欧美变态口味重另类| 日韩一级片在线播放| 日韩女优制服丝袜电影| 精品对白一区国产伦| 欧美激情一区二区三区全黄| 亚洲欧洲精品天堂一级| 亚洲精品免费电影| 美日韩一区二区三区| 国产成人在线网站| 99国产精品一区| 欧美日韩三级视频| 久久久久88色偷偷免费| 亚洲视频一区二区在线观看| 日韩中文字幕91| 国产成人免费xxxxxxxx| 欧美日韩在线一区二区| 久久久久成人黄色影片| 亚洲成人综合在线| 成人午夜在线播放| 日韩免费观看高清完整版在线观看| 久久这里都是精品| 午夜在线成人av| 色悠久久久久综合欧美99| 欧美tickle裸体挠脚心vk| 亚洲精品写真福利| 成人激情开心网| 久久久久久毛片| 日韩福利视频网| 欧美日韩中文一区| 亚洲日韩欧美一区二区在线| 韩国三级中文字幕hd久久精品| 欧美午夜精品久久久久久孕妇| 国产色产综合产在线视频| 免费成人小视频| 7777精品伊人久久久大香线蕉经典版下载| 久久久久久久久一| 国产一区二区三区观看| 日韩精品在线看片z| 免费在线成人网| 日韩欧美综合一区| 美女视频网站黄色亚洲| 3d成人h动漫网站入口| 午夜私人影院久久久久| 色综合久久综合| 亚洲国产视频a| 欧美亚一区二区| 亚洲成av人片在线| 日韩一区二区麻豆国产| 久久国产成人午夜av影院| 久久老女人爱爱| 99精品视频在线免费观看| 亚洲丝袜制服诱惑| 日本韩国欧美国产| 五月综合激情网| 久久久99精品久久| 91在线视频在线| 首页国产欧美久久| 国产午夜亚洲精品不卡| 色999日韩国产欧美一区二区| 亚欧色一区w666天堂| 精品国产一区a| 99精品视频免费在线观看| 亚洲图片欧美色图| 日本一区二区三区在线观看| 91蜜桃网址入口| 国产在线精品免费| 亚洲精品一二三四区| 26uuu成人网一区二区三区| 99综合影院在线| 麻豆免费看一区二区三区| 中文字幕一区在线| 欧美电影免费观看高清完整版 | 欧美日韩在线播放一区| 国产成人av网站| 久久er精品视频| 亚洲尤物视频在线| 亚洲欧洲另类国产综合| 日韩精品专区在线影院观看| 欧美婷婷六月丁香综合色| 福利一区福利二区| 国产精品一区一区三区| 三级久久三级久久| 亚洲午夜精品一区二区三区他趣| 久久久久久久网| 久久一区二区三区国产精品| 91麻豆精品91久久久久同性| 色综合视频在线观看| 高清不卡在线观看| 秋霞成人午夜伦在线观看| 国产精品视频一区二区三区不卡| 色中色一区二区| 成人免费毛片aaaaa**| 精品99一区二区三区| 日韩一区二区三区高清免费看看| 欧美日韩午夜精品| 91美女片黄在线观看| 九九精品一区二区| 免费观看在线综合| 蜜桃一区二区三区四区| 亚洲曰韩产成在线| 日韩在线观看一区二区| 一区二区三区毛片| 日日摸夜夜添夜夜添国产精品| 亚洲国产日日夜夜| 激情六月婷婷综合| 97久久超碰国产精品| 欧亚洲嫩模精品一区三区| 欧美优质美女网站| 欧美成人a在线| 国产精品免费网站在线观看| 亚洲精品欧美激情| 男人的天堂亚洲一区| 国产精品综合一区二区| 欧美在线小视频| 日韩精品影音先锋| 怡红院av一区二区三区| 麻豆国产精品一区二区三区 | 成人app网站| 一本色道**综合亚洲精品蜜桃冫| 欧美在线啊v一区| 久久久一区二区三区捆绑**| 国产精品久久久久久福利一牛影视| 亚洲一区二区三区中文字幕在线| 狠狠v欧美v日韩v亚洲ⅴ| 色呦呦国产精品| 国产欧美一区二区精品性色超碰 | 欧美色图在线观看| 日本一区二区三区在线观看| 首页综合国产亚洲丝袜| 91在线观看免费视频| 精品粉嫩超白一线天av| 亚洲在线视频一区| 91免费观看视频在线| 88在线观看91蜜桃国自产| 国产精品私房写真福利视频| 蜜臀av一区二区在线观看| 欧美精品在欧美一区二区少妇| 一区二区三区电影在线播| 高清在线不卡av| 欧美国产综合一区二区| 东方欧美亚洲色图在线| 国产拍揄自揄精品视频麻豆|