|
本帖最后由 zhengoogle 于 2012-8-18 11:15 编辑
protues nokia1100仿真驱动程序
仿真源码下载:protues nokia1100仿真代码
http://yunfile.com/file/zhengoogle/e6c87878/
相关资料:推荐资料 PROTEUS——电子线路设计、制版与仿真
http://zhengoogle.qjwm.com/down_4406362.html
protues仿真模型库文件下载:http://yunfile.com/file/zhengoogle/21659dd0/
void Lcd1100_write_byte(uint8 cd , uint8 c)//write command or data;
{
char i;
CS = 0;
SCLK = 0;
SDA = cd;
SCLK = 1;
for(i=0;i<8;i++)
{
SCLK = 0;
if(c & 0x80)
SDA = 1;
else
SDA = 0;
SCLK = 1;
c <<= 1;
_delay_us(10);
}
CS = 1;
}
void Lcd1100_write_data(uint8 dat)//Only write data and LSB at first;
{
char i;
CS = 0;
SCLK = 0;
SDA = DATA;
SCLK = 1;
for(i=0;i<8;i++)
{
SCLK = 0;
if(dat & 0x01)
SDA = 1;
else
SDA = 0;
SCLK = 1;
dat >>= 1;
_delay_us(1); //_delay 10us;
}
CS = 1;
}
/*-----------------------------------------------------*/
/*-F--SET cursor position;
/*-M--Debug_x row,y col;
/*-----------------------------------------------------*/
void SET_XY(uint8 x,uint8 y)
{
Lcd1100_write_byte(CMD,0xB0 | (y & 0x0f)); //_Set y axis position
Lcd1100_write_byte(CMD,0x10 | ((x>>4)&0x7)); //_Set x axis position
Lcd1100_write_byte(CMD,x & 0x0f);
}
/*-----------------------------------------------------*/
/*-F--Clear screen;
/*-----------------------------------------------------*/
void Lcd1100_clear()
{
unsigned int i;
Lcd1100_write_byte(CMD,0x40); // Y = 0
Lcd1100_write_byte(CMD,0xB0);
Lcd1100_write_byte(CMD,0x10); // X = 0
Lcd1100_write_byte(CMD,0x00);
for(i=0;i<864;i++)
Lcd1100_write_byte(DATA,0x00);
}
/*-----------------------------------------------------*/
/*-F--NOKIA1100 display _char;
/*-M--Debug_char_sel display _char ascii _code;
/*-----------------------------------------------------*/
void Lcd1100_display_char(uint8 char_sel)
{
int i;
for ( i = 0; i < 5; i++ )
{
Lcd1100_write_data(ascii[char_sel-32] << 1);
}
Lcd1100_write_data(0x00);
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?注册
x
阿莫论坛20周年了!感谢大家的支持与爱护!!
曾经有一段真挚的爱情摆在我的面前,我没有珍惜,现在想起来,还好我没有珍惜……
|