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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? lcd.c

?? 2500-SPI通用程序
?? C
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
/*******************************************************************************************************
 *                                                                                                     *
 *        **********                                                                                   *
 *       ************                                                                                  *
 *      ***        ***                                                                                 *
 *      ***   +++   ***                                                                                *
 *      ***   + +   ***     This file implements LCD display initialization                            *
 *      ***   +             and functions for updating the LCD display                                 *
 *      ***   + +   ***                                                                                *
 *      ***   +++   ***     Lcd.c                                                                      *
 *      ***        ***                                                                                 *
 *       ************                                                                                  *
 *        **********                                                                                   *
 *                                                                                                     *
 *******************************************************************************************************
 * Compiler:                Keil C51 V7.50                                                             *
 * Target platform:         Chipcon, CCxx00                                                            *
 * Author:                  SNA                                                                        *
 *******************************************************************************************************
 * Revision history:        See end of file                                                            *
 ******************************************************************************************************/
#include <Chipcon\srf04\halsrf04.h>
#include <Chipcon\srf04\ebsrf04.h>
#include <intrins.h>




//-------------------------------------------------------------------------------------------------------
//  This file contains all necessary defines, macroes and function for writing to the LCD display.
//  The i2c communication is done using SMBus interrupt and timer 0 is used to generate SCL.
//  Below is an example on how to write a text to the display. As, showed below, only two of the 
//  functions in this file, (ebLcdInit and ebLcdUpdate) is needed to be called from the user application.
//  The other functions are only used internally in this file.
//
//      void ebLcdInit(void)
//      BYTE ebLcdUpdate(UINT8 *pLine1, UINT8 *pLine2)
//      void SMBusIsr(void) interrupt INUM_SMB0
//      BYTE ebLcdConvertChar(BYTE c)
//      void ebI2CHandler(void)
//
//  ebLcdInit();
//  ebLcdUpdate("Connecting", "      Smarter");
//
//  |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
//  | C | o | n | n | e | c | t | i | n | g |   |   |   |   |   |   |
//  |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| 
//  |   |   |   |   |   |   | S | m | a | r | t | e | r |   |   |   |
//  |---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
//-------------------------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------------------------
// Status vector (SMBus) - top 4 bits only
#define SMB_MTSTA   0xE0    // (MT) start transmitted
#define SMB_MTDB    0xC0    // (MT) data byte transmitted, ACK received
#define SMB_MRDB    0x80    // (MR) data byte received

// Defines used by the ebLcdInit and ebLcdUpdate functions 
#define LINE_SIZE  16
#define LINE1      0x80
#define LINE2      0xC0
//-------------------------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------------------------
// LCD slave address
#define LCD_ADDR        0x76

// Defines for Register Select (RS). RS selects the register to be accessed for read and write
#define RS_0            0x00        // RS = 0 => selects instruction register for write and busy flag
                                    // and address counter for read
#define RS_1            0x40        // RS = 1 => selects the data register for both read and write

// Reset pin
#define RESET_N         P2_3

#define SPACE           0x9B
//-------------------------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------------------------
// Struct used by the ebLcdUpdate
typedef struct {
    BOOL doTransfer;
    BOOL transferInProgress;
    UINT8 bytesLeft;
    UINT8 position;
} I2C_DATA;
//-------------------------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------------------------
// Variables used by ebLcdInit, ebLcdUpdate, and the SMBus ISR 
BYTE i2cBuffer[47];       // It takes 47 bytes to update the entire LCD display
I2C_DATA i2cData;
//-------------------------------------------------------------------------------------------------------




//-------------------------------------------------------------------------------------------------------
//  DESCRIPTION:
//      Converts ASCII characters to the character set the LCD display uses 
//-------------------------------------------------------------------------------------------------------
BYTE ebLcdConvertChar(BYTE c);




//-------------------------------------------------------------------------------------------------------
//  DESCRIPTION: 
//      This function is responsible for all traffic on the I2C interface.
//-------------------------------------------------------------------------------------------------------
void ebI2CHandler(void);




//-------------------------------------------------------------------------------------------------------
//  void ebLcdInit(void)
//
//  DESCRIPTION:
//      Function used to initialize the LCD display. The SMBus uses timer 0 to generate SCL
//      This function also writes 32 SPACE characters to the display to clear it.
//-------------------------------------------------------------------------------------------------------
void ebLcdInit(void) {

    UINT8 i;

    // Setup SCL High and Low times using timer 0 (THighMin = TLowMin = 1 / fClockSourceOverflow)
    TH0 = 150;  // SCL low time = (256 - 150) * (1 / 24000000) = 4,42 us 
    TL0 = TH0;
  
    // Set mode
    TMOD &= 0xFC;
    TMOD |= MODE_2;     // 8-bit counter/timer with auto-reload
   
    CKCON |= BM_T0M;    // Counter/Timer 0 uses the system clock
    
    TIMER0_RUN(TRUE);   // Start timer 0    

    // Initialize SMBus 
    SMB0CF |= BM_ENSMB;

     // Enable SMBus interrupt
    INT_ENABLE(INUM_SMB0, INT_ON);
    ENABLE_GLOBAL_INT(TRUE);

    // Initializes the I2C handler's data structure
    i2cData.doTransfer = FALSE;
    i2cData.transferInProgress = FALSE;
    i2cData.position = 0;

    // Reset the display
    RESET_N = 0;
    _nop_();
    _nop_();
    _nop_();
    _nop_();
    _nop_();
    _nop_();
    _nop_();
    _nop_();
    _nop_();
    RESET_N = 1;
 
    i2cBuffer[0] = 7;
    i2cBuffer[1] = LCD_ADDR;
    i2cBuffer[2] = RS_0;            // Instruction Register
    i2cBuffer[3] = 0x0C;            // Display control          D = 1:      Display On
                                    //                          C = 0:      Cursor Off
                                    //                          B = 0:      Cursor character blink off
    i2cBuffer[4] = 0x21;            // Function set             H = 1:      Use extended instruction set
    i2cBuffer[5] = 0xA0;            // Set DDRAM address        ADD = 0x20
    i2cBuffer[6] = 0x07;            // Display configuration    P = 1:      Column data right to left
                                    //                          Q = 1:      Row data, bottom to top
    i2cBuffer[7] = 0x24;            // Function set             DL = 0:     4 bits
                                    //                          M = 1:      2-line by 16 display
                                    //                          SL = 0:     MUX1:18
                                    //                          H = 0:      Use basic instruction set
    i2cBuffer[8] = 0;
    i2cData.doTransfer = TRUE;
    ebI2CHandler();
    while (i2cData.doTransfer == TRUE);     // Wait for tranfer to finish
    
    // Clear display by writing SPACE
    i2cBuffer[0] = 3;
    i2cBuffer[1] = LCD_ADDR;
    i2cBuffer[2] = RS_0;
    i2cBuffer[3] = LINE1;

    i2cBuffer[4] = 18;
    i2cBuffer[5] = LCD_ADDR;
    i2cBuffer[6] = RS_1;

    for (i = 0; i < (LINE_SIZE); i++)
        i2cBuffer[i + 7] = SPACE;

    i2cBuffer[23] = 3;
    i2cBuffer[24] = LCD_ADDR;
    i2cBuffer[25] = RS_0;
    i2cBuffer[26] = LINE2;

    i2cBuffer[27] = 18;
    i2cBuffer[28] = LCD_ADDR;
    i2cBuffer[29] = RS_1;

    for (i = 0; i < (LINE_SIZE); i++)
        i2cBuffer[i + 30] = SPACE;

    i2cBuffer[46] = 0;

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品五月天| 亚洲成人7777| 欧美一级夜夜爽| 国产乱码精品一区二区三区忘忧草| 亚洲欧洲一区二区在线播放| 欧美电视剧在线看免费| 一本一道综合狠狠老| 国产自产v一区二区三区c| 亚洲一二三四区| 国产精品高潮久久久久无| 精品国精品自拍自在线| 欧美三级韩国三级日本三斤| 波多野结衣在线aⅴ中文字幕不卡| 蜜臀av亚洲一区中文字幕| 亚洲国产视频一区二区| 中文字幕av一区二区三区免费看| 欧美一级黄色片| 在线观看视频一区二区| av激情亚洲男人天堂| 国产一区二区三区四区在线观看| 首页亚洲欧美制服丝腿| 亚洲一级不卡视频| 亚洲啪啪综合av一区二区三区| 久久久精品tv| 精品1区2区在线观看| 日韩一区二区在线观看视频播放| 欧美天堂亚洲电影院在线播放| 成人免费视频一区| 国产麻豆精品久久一二三| 精品亚洲国产成人av制服丝袜| 日韩电影在线观看网站| 性欧美大战久久久久久久久| 亚洲午夜精品网| 亚洲国产成人av| 亚洲第一搞黄网站| 天涯成人国产亚洲精品一区av| 亚洲一区免费视频| 亚洲国产日韩一级| 亚洲1区2区3区视频| 亚洲成在人线在线播放| 午夜私人影院久久久久| 天天综合天天做天天综合| 偷拍与自拍一区| 美日韩一级片在线观看| 国产在线精品视频| 成人性色生活片| 91女人视频在线观看| 色噜噜久久综合| 欧美丰满一区二区免费视频| 91精品国产美女浴室洗澡无遮挡| 7777精品伊人久久久大香线蕉经典版下载| 欧美精品1区2区3区| 日韩欧美亚洲国产精品字幕久久久| 日韩免费在线观看| 国产日韩精品一区| 亚洲欧美日韩一区| 日日摸夜夜添夜夜添亚洲女人| 久久精品国产一区二区| 国产精品影音先锋| 91视频在线观看| 欧美视频一二三区| 日韩天堂在线观看| 欧美激情中文字幕一区二区| 亚洲欧美另类在线| 秋霞午夜av一区二区三区| 国产精品自产自拍| 日本大香伊一区二区三区| 正在播放一区二区| 中文字幕的久久| 亚洲国产sm捆绑调教视频| 捆绑调教一区二区三区| www.亚洲色图.com| 91精品在线麻豆| 日本一二三四高清不卡| 亚洲成av人在线观看| 国产福利一区二区三区视频| 91美女在线视频| 欧美电视剧在线观看完整版| 中文字幕在线观看一区| 美女视频免费一区| 99re热这里只有精品免费视频| 欧美欧美午夜aⅴ在线观看| 久久久99精品免费观看| 性做久久久久久免费观看 | 日韩国产精品久久| 国产宾馆实践打屁股91| 欧美日韩亚洲综合在线| 国产欧美一区二区精品性色超碰 | 99久久精品国产网站| 日韩欧美久久一区| 亚洲激情图片小说视频| 国产精品综合视频| 欧美狂野另类xxxxoooo| 国产精品国模大尺度视频| 奇米精品一区二区三区在线观看一| eeuss鲁片一区二区三区| 欧美一区二区三区的| 一区二区三区中文字幕精品精品| 韩国欧美国产1区| 欧美喷水一区二区| 亚洲乱码国产乱码精品精98午夜 | 欧美美女黄视频| 国产精品乱码人人做人人爱| 男男gaygay亚洲| 欧洲精品视频在线观看| 中文字幕欧美激情一区| 九九九精品视频| 91精品久久久久久久91蜜桃| 亚洲黄网站在线观看| av成人免费在线观看| 国产亚洲欧美在线| 麻豆视频观看网址久久| 在线中文字幕一区| 中文字幕人成不卡一区| 成人一区二区视频| 久久精品视频网| 捆绑调教美女网站视频一区| 欧美高清一级片在线| 亚洲第一电影网| 欧美性xxxxxxxx| 亚洲一区二区高清| 欧美中文字幕一区二区三区亚洲 | 中文字幕在线观看一区| 国产成人av电影在线观看| www国产亚洲精品久久麻豆| 蜜臀va亚洲va欧美va天堂| 欧美日韩国产一区二区三区地区| 亚洲精品免费在线播放| 97精品久久久久中文字幕 | xfplay精品久久| 九九精品一区二区| 久久综合九色综合欧美亚洲| 麻豆国产欧美日韩综合精品二区| 日韩一区二区麻豆国产| 理论电影国产精品| 精品国产一区二区亚洲人成毛片| 久久精品国产精品亚洲精品| 91精品国产高清一区二区三区蜜臀| 亚洲成人激情综合网| 7777精品伊人久久久大香线蕉| 日韩精品一级二级 | 日韩精品电影在线观看| 在线播放欧美女士性生活| 无码av中文一区二区三区桃花岛| 欧美精品久久一区二区三区| 免费一区二区视频| 国产婷婷色一区二区三区四区| 成人午夜在线播放| 亚洲免费观看高清完整版在线观看熊| 91麻豆.com| 亚洲一区二区不卡免费| 91精品国产乱| 国产精品99久久久久久似苏梦涵 | 精品国产亚洲一区二区三区在线观看| 激情文学综合插| 国产精品久久久久久久裸模| 一本到不卡免费一区二区| 亚洲成av人片一区二区三区| 日韩一本二本av| 成人小视频在线观看| 亚洲一区在线观看网站| 日韩精品一区二区三区蜜臀 | 亚洲亚洲精品在线观看| 日韩美女一区二区三区四区| 国产91丝袜在线18| 亚洲精品国产第一综合99久久 | 成人免费小视频| 欧美群妇大交群中文字幕| 国产一区二区91| 亚洲精品你懂的| 精品国精品自拍自在线| 99riav久久精品riav| 免费人成黄页网站在线一区二区| 欧美极品美女视频| 欧美猛男gaygay网站| 国产精品主播直播| 亚洲成人动漫精品| 国产亚洲精品免费| 欧美日精品一区视频| 国产成人精品影院| 亚洲成人资源在线| 日本一区二区不卡视频| 91精品国产品国语在线不卡| 成人午夜电影小说| 日韩成人免费看| 日韩理论片在线| 26uuu国产电影一区二区| 欧美视频在线一区| 国产a精品视频| 免费成人美女在线观看| 一区二区三区丝袜| 欧美极品aⅴ影院| 欧美大片在线观看一区| 91福利国产成人精品照片| 国产大陆a不卡| 裸体一区二区三区| 亚洲电影一区二区三区| 亚洲欧洲av在线| 国产午夜精品福利| 日韩精品资源二区在线|