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

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

?? lcd.c

?? 飛思卡爾HCS12的OS移植(ucosII),實現了三個任務,IDE:CODEWARRIOR
?? C
?? 第 1 頁 / 共 2 頁
字號:
/*
*********************************************************************************************************
*                                               uC/LCD
*                                         LCD Module Driver
*
*                              (c) Copyright 2005; Micrium; Weston, FL
*
*                   All rights reserved.  Protected by international copyright laws.
*                   Knowledge of the source code may not be used to write a similar
*                   product.  This file may only be used in accordance with a license
*                   and should not be redistributed in any way.
*********************************************************************************************************
*/


/*
*********************************************************************************************************
*                                        LCD MODULE SOURCE FILE
*
* Filename      : lcd.c
* Programmer(s) : JJL
* Version       : V3.00
*********************************************************************************************************
*                                              DESCRIPTION
*
*
* This module provides an interface to an alphanumeric display module.
*
* The current version of this driver supports any  alphanumeric LCD module based on the:
*     Hitachi HD44780 DOT MATRIX LCD controller.
*
* This driver supports LCD displays having the following configuration:
*
*     1 line  x 16 characters     2 lines x 16 characters     4 lines x 16 characters
*     1 line  x 20 characters     2 lines x 20 characters     4 lines x 20 characters
*     1 line  x 24 characters     2 lines x 24 characters
*     1 line  x 40 characters     2 lines x 40 characters
*********************************************************************************************************
*/

/*$PAGE*/
/*
*********************************************************************************************************
*                                              INCLUDE FILES
*********************************************************************************************************
*/

#include "includes.h"

/*
*********************************************************************************************************
*                                            LOCAL CONSTANTS
*********************************************************************************************************
*/

                                       /* ---------------------- HD44780 COMMANDS -------------------- */
#define  DISP_CMD_CLS            0x01  /* Clr display : clears display and returns cursor home         */

#if      DISP_BUS_WIDTH == 4
#define  DISP_CMD_FNCT           0x28  /* Function Set: Set 4 bit data length, 1/16 duty, 5x8 dots     */
#else
#define  DISP_CMD_FNCT           0x38  /* Function Set: Set 8 bit data length, 1/16 duty, 5x8 dots     */
#endif

#define  DISP_CMD_FNCT_INIT8     0x30  /* Function Set: 8 bit mode, no options                         */
#define  DISP_CMD_FNCT_INIT4     0x20  /* Function Set: 4 bit mode, no options                         */

#define  DISP_CMD_MODE           0x06  /* Entry mode  : Inc. display data address when writing         */
#define  DISP_CMD_ON_OFF         0x0C  /* Disp ON/OFF : Display ON, cursor OFF and no BLINK character  */

/*
*********************************************************************************************************
*                                            LOCAL VARIABLES
*********************************************************************************************************
*/

static  CPU_INT08U   DispMaxCols;      /* Maximum number of columns (i.e. characters per line)         */
static  CPU_INT08U   DispMaxRows;      /* Maximum number of rows for the display                       */


static  CPU_INT08U   DispHorBar1[]  = {0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10};
static  CPU_INT08U   DispHorBar2[]  = {0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18};
static  CPU_INT08U   DispHorBar3[]  = {0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C, 0x1C};
static  CPU_INT08U   DispHorBar4[]  = {0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E, 0x1E};
static  CPU_INT08U   DispHorBar5[]  = {0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};

static  CPU_INT08U   DispVertBar1[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F};
static  CPU_INT08U   DispVertBar2[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F};
static  CPU_INT08U   DispVertBar3[] = {0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F};
static  CPU_INT08U   DispVertBar4[] = {0x00, 0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F};
static  CPU_INT08U   DispVertBar5[] = {0x00, 0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
static  CPU_INT08U   DispVertBar6[] = {0x00, 0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
static  CPU_INT08U   DispVertBar7[] = {0x00, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};
static  CPU_INT08U   DispVertBar8[] = {0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F, 0x1F};

/*
*********************************************************************************************************
*                                        LOCAL FUNCTION PROTOTYPES
*********************************************************************************************************
*/

static  void         DispCursorSet(CPU_INT08U row, CPU_INT08U col);

/*$PAGE*/
/*
*********************************************************************************************************
*                                           DISPLAY A CHARACTER
*
* Description : This function is used to display a single character on the display device
* Arguments   : 'row'   is the row    position of the cursor in the LCD Display
*                       'row' can be a value from 0 to 'DispMaxRows - 1'
*               'col'   is the column position of the cursor in the LCD Display
*                       'col' can be a value from 0 to 'DispMaxCols - 1'
*               'c'     is the character to write to the display at the current ROW/COLUMN position.
* Returns     : none
*********************************************************************************************************
*/

void  DispChar (CPU_INT08U row, CPU_INT08U col, CPU_INT08U c)
{
    if (row < DispMaxRows && col < DispMaxCols) {
        DispLock();
        DispCursorSet(row, col);            /* Position cursor at ROW/COL                              */
        DispSel(DISP_SEL_DATA_REG);
        DispDataWr(c);                      /* Send character to display                               */
        DispUnlock();
    }
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                             CLEAR LINE
*
* Description : This function clears one line on the LCD display and positions the cursor at the
*               beginning of the line.
* Arguments   : 'line'  is the line number to clear and can take the value
*                       0 to 'DispMaxRows - 1'
* Returns     : none
*********************************************************************************************************
*/

void  DispClrLine (CPU_INT08U line)
{
    CPU_INT08U i;


    if (line < DispMaxRows) {
        DispLock();
        DispCursorSet(line, 0);                  /* Position cursor at begin of the line to clear      */
        DispSel(DISP_SEL_DATA_REG);              /* Select the LCD Display DATA register               */
        for (i = 0; i < DispMaxCols; i++) {      /* Write ' ' into all column positions of that line   */
            DispDataWr(' ');                     /* Write an ASCII space at current cursor position    */
        }
        DispCursorSet(line, 0);                  /* Position cursor at begin of the line to clear      */
        DispUnlock();
    }
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                            CLEAR THE SCREEN
*
* Description : This function clears the display
* Arguments   : none
* Returns     : none
*********************************************************************************************************
*/

void  DispClrScr (void)
{
    DispLock();
    DispSel(DISP_SEL_CMD_REG);         /* Select the LCD display command register                      */
    DispDataWr(DISP_CMD_CLS);          /* Send command to LCD display to clear the display             */
    DispDly_uS(2000);                  /* Delay at least  2 mS                                         */
    DispUnlock();
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                     POSITION THE CURSOR (Internal)
*
* Description : This function positions the cursor into the LCD buffer
* Arguments   : 'row'   is the row    position of the cursor in the LCD Display
*                       'row' can be a value from 0 to 'DispMaxRows - 1'
*               'col'   is the column position of the cursor in the LCD Display
*                       'col' can be a value from 0 to 'DispMaxCols - 1'
* Returns     : none
*********************************************************************************************************
*/

static  void  DispCursorSet (CPU_INT08U row, CPU_INT08U col)
{
    DispSel(DISP_SEL_CMD_REG);                             /* Select LCD display command register      */
    switch (row) {
        case 0:
             if (DispMaxRows == 1) {                       /* Handle special case when only one line   */
                 if (col < (DispMaxCols >> 1)) {
                     DispDataWr(0x80 + col);               /* First  half of the line starts at 0x80   */
                 } else {                                  /* Second half of the line starts at 0xC0   */
                     DispDataWr(0xC0 + col - (DispMaxCols >> 1));
                 }
             } else {
                 DispDataWr(0x80 + col);                   /* Select LCD's display line 1              */
             }
             break;

        case 1:
             DispDataWr(0xC0 + col);                       /* Select LCD's display line 2              */
             break;

        case 2:
             DispDataWr(0x80 + DispMaxCols + col);         /* Select LCD's display line 3              */
             break;

        case 3:
             DispDataWr(0xC0 + DispMaxCols + col);         /* Select LCD's display line 4              */
             break;
    }
}

/*$PAGE*/
/*
*********************************************************************************************************
*                                            DEFINE CHARACTER
*
* Description : This function defines the dot pattern for a character.
* Arguments   : 'id'    is the identifier for the desired dot pattern.
*               'pat'   is a pointer to an 8 BYTE array containing the dot pattern.
* Returns     : None.
*********************************************************************************************************
*/

void  DispDefChar (CPU_INT08U id, CPU_INT08U *pat)
{
    CPU_INT08U i;


    DispLock();
    DispSel(DISP_SEL_CMD_REG);              /* Select command register                                 */
    DispDataWr(0x40 + (id << 3));           /* Set address of CG RAM                                   */
    DispSel(DISP_SEL_DATA_REG);             /* Select the data register                                */
    for (i = 0; i < 8; i++) {
        DispDataWr(*pat++);                 /* Write pattern into CG RAM                               */
    }
    DispUnlock();

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品视频在线观看网站| 国产精品热久久久久夜色精品三区| 亚洲www啪成人一区二区麻豆 | 国产精品久久久久久久久免费相片 | 日韩精品一区第一页| 91精品国产综合久久精品图片| 日韩电影网1区2区| 26uuu精品一区二区| 国产成人一级电影| 一区二区三区四区在线免费观看| 69久久99精品久久久久婷婷| 国产精品一区二区果冻传媒| 亚洲女同女同女同女同女同69| 欧美丰满少妇xxxxx高潮对白| 美女高潮久久久| 中文字幕日韩av资源站| 69堂国产成人免费视频| 不卡一二三区首页| 极品美女销魂一区二区三区| 樱花影视一区二区| 久久久久久久久久看片| 欧美主播一区二区三区美女| 精彩视频一区二区| 亚洲精品老司机| 久久久久97国产精华液好用吗| 欧美亚洲精品一区| 91麻豆免费视频| 国产在线播精品第三| 欧美a级一区二区| 亚洲在线中文字幕| 久久久久久久精| 欧美一级夜夜爽| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 九九国产精品视频| 欧美bbbbb| 午夜不卡在线视频| 亚洲综合一区二区精品导航| 日韩一区有码在线| 中文字幕欧美激情一区| 国产欧美精品一区二区色综合 | 欧美精品亚洲二区| 色综合天天综合| 99re热视频精品| 成人免费看的视频| 成人av电影在线播放| 成人av电影免费在线播放| 成人蜜臀av电影| 日本韩国一区二区| 欧美三级乱人伦电影| 欧美一区二区三区视频免费播放 | 九色综合国产一区二区三区| 亚洲一区二区三区免费视频| 一区二区三区在线视频观看58| 自拍偷拍亚洲欧美日韩| 亚洲欧美怡红院| 亚洲一区二区三区不卡国产欧美| 亚洲一区在线观看免费| 亚洲超碰97人人做人人爱| 天天av天天翘天天综合网色鬼国产| 一区二区三区毛片| 亚洲国产sm捆绑调教视频 | 欧美成人欧美edvon| 亚洲精品一区二区三区四区高清| 日韩欧美国产系列| 久久久久国产一区二区三区四区| 久久久无码精品亚洲日韩按摩| 中文字幕成人网| 亚洲午夜国产一区99re久久| 久久99这里只有精品| 成人av在线资源| 7777精品伊人久久久大香线蕉的 | 免费人成网站在线观看欧美高清| 激情欧美日韩一区二区| 日本高清免费不卡视频| 日韩精品一区二区三区视频在线观看 | 日韩视频免费观看高清完整版| 国产无一区二区| 亚洲电影第三页| 成人黄色av网站在线| 日韩午夜av电影| 樱桃国产成人精品视频| 国产精品一区二区久激情瑜伽| 欧美嫩在线观看| 中文字幕第一区综合| 久久精品二区亚洲w码| 色8久久精品久久久久久蜜| 精品日韩一区二区三区| 亚洲图片自拍偷拍| 成人黄色在线看| 日韩欧美成人午夜| 图片区小说区国产精品视频| 国产成人综合在线观看| 日韩欧美国产高清| 性做久久久久久久久| 99re8在线精品视频免费播放| 久久综合九色综合欧美亚洲| 日韩精品乱码av一区二区| 91成人在线精品| 亚洲欧洲综合另类| yourporn久久国产精品| 久久精品视频网| 国产成人啪午夜精品网站男同| 精品日韩在线观看| 国产一区二区三区最好精华液| 日韩一区二区三| 麻豆精品久久精品色综合| 欧美一a一片一级一片| 亚洲高清免费视频| 欧美美女一区二区在线观看| 午夜精品免费在线| 欧美日韩国产三级| 蜜臀a∨国产成人精品| 日韩一区二区电影| 极品少妇一区二区| 中文字幕欧美国产| 91麻豆swag| 视频一区二区三区中文字幕| 欧美本精品男人aⅴ天堂| 韩国成人精品a∨在线观看| 欧美国产丝袜视频| 欧美性xxxxxxxx| 免费成人在线播放| 国产午夜亚洲精品羞羞网站| 成人爱爱电影网址| 伊人婷婷欧美激情| 欧美日韩一区二区欧美激情| 日本在线不卡视频| 中文字幕第一页久久| 在线观看视频欧美| 国产一区二区三区免费在线观看| 久久久久久久电影| 色哟哟一区二区三区| 老司机精品视频一区二区三区| 日本一区二区三区高清不卡| 久久久三级国产网站| 91在线精品一区二区| 丝袜亚洲另类丝袜在线| 国产亚洲美州欧州综合国| 91久久精品一区二区三| 麻豆国产欧美一区二区三区| 中文字幕一区二区三区不卡| 欧美一区二区三区公司| 99精品久久99久久久久| 久久99精品久久久久久久久久久久| 亚洲精品综合在线| 国产欧美精品区一区二区三区| 欧美日韩高清一区二区| 波多野结衣在线aⅴ中文字幕不卡| 丝袜亚洲另类欧美综合| 综合久久给合久久狠狠狠97色| 精品国产凹凸成av人网站| 欧美亚日韩国产aⅴ精品中极品| 福利一区在线观看| 国内精品免费在线观看| 亚洲福利一二三区| 亚洲一区在线视频观看| 亚洲欧美一区二区不卡| 成人欧美一区二区三区视频网页| 国产婷婷一区二区| 久久日韩粉嫩一区二区三区| 欧美大肚乱孕交hd孕妇| 在线成人av网站| 欧美伦理视频网站| 欧美疯狂做受xxxx富婆| 欧美一区二区三区男人的天堂| 欧美猛男男办公室激情| 欧美日韩aaa| 欧美日本精品一区二区三区| 91精品欧美久久久久久动漫 | 8x8x8国产精品| 日韩亚洲欧美高清| 精品sm捆绑视频| 久久久久久一二三区| 国产欧美视频一区二区三区| 国产欧美一区二区在线观看| 欧美高清在线视频| 亚洲欧美激情视频在线观看一区二区三区 | 久久精品一二三| 国产精品人成在线观看免费| 依依成人综合视频| 三级一区在线视频先锋| 美女任你摸久久| 国产+成+人+亚洲欧洲自线| 26uuu色噜噜精品一区二区| 日韩美一区二区三区| 国产精品网曝门| 亚洲一级不卡视频| 极品少妇xxxx精品少妇| 成人国产一区二区三区精品| 91在线一区二区三区| 欧美电影在线免费观看| 欧美电视剧在线看免费| 亚洲欧美激情插| 美女脱光内衣内裤视频久久网站| k8久久久一区二区三区| 7777精品伊人久久久大香线蕉经典版下载| 久久久精品国产免大香伊| 亚洲成av人片| 成人国产一区二区三区精品| 欧美剧情片在线观看|