?? lcddim.c
字號:
#include"config.h"
//************LCD底層函數
void LCD_Cls(void) //清屏
{LCD_Busy();
RS=0;
RW=0;
DB=0x01;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Screen(void) //屏幕開禁止光標
{LCD_Busy();
RS=0;
RW=0;
DB=0x0c;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Busy(void) //檢測忙
{DB=0xff;
RS=0;
RW=1;
E=1;
while(BF==1);
E=0;
}
void LCD_Write_Code(unsigned char CODE) //寫字符
{LCD_Busy();
RS=1;
RW=0;
DB=CODE;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Addr(unsigned char ADDR) //顯示位置
{LCD_Busy();
RS=0;
RW=0;
DB=ADDR;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Comm_Basic(void) //8位基本指令
{LCD_Busy();
RS=0;
RW=0;
DB=0x30;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Comm_Add(void) //8位擴展指令
{LCD_Busy();
RS=0;
RW=0;
DB=0x34;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Input(void) //顯示光標
{LCD_Busy();
RS=0;
RW=0;
DB=0x0f;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Right_Mov(void) //光標右移
{LCD_Busy();
RS=0;
RW=0;
DB=0x14;
E=1;
_nop_();
_nop_();
E=0;
}
void LCD_Left_Mov(void) //光標左移
{LCD_Busy();
RS=0;
RW=0;
DB=0x10;
E=1;
_nop_();
_nop_();
E=0;
}
unsigned char LCD_Read_RAM(void) //讀RAM
{unsigned char DATA;
LCD_Busy();
RS=1;
RW=1;
E=1;
_nop_();
DATA=DB;
E=0;
LCD_Busy(); //第二次讀有效
RS=1;
RW=1;
E=1;
_nop_();
DATA=DB;
E=0;
return(DATA);
}
unsigned char LCD_Read_Addr(void) //讀位置參數
{unsigned char PLACE;
LCD_Busy();
RS=0;
RW=1;
E=1;
_nop_();
PLACE=DB;
E=0;
return(PLACE);
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -