标题: 七星虫MINI12864的显示程序 [打印本页]

作者: 菜记    时间: 2018-12-19 22:40
标题: 七星虫MINI12864的显示程序
此程序是在网上购买单片机开发板赠送的,传上来备用。部分程序如下:
/********************
********************/
void SendByte(uchar Dbyte)
{
         uchar i,TEMP;
   TEMP=Dbyte;
         for(i=0;i<8;i++)
         {
                 SCK = 0;
      _nop_(); _nop_();
     TEMP=TEMP<<1;
     SID = CY;
     SCK = 1;
      _nop_(); _nop_();
         }
}
/****************
**************/
void write_cmd( uchar Cbyte )
{
         CS = 0;  
      A0 = 0;  
         SendByte(Cbyte);
}
/***************
******************/
void write_data( uchar Dbyte )
{
         CS = 0;  
      A0=1;   
         SendByte(Dbyte);
}
/*************************
**********************/
void  PUTchar8x8(uchar row,uchar col,uchar count,uchar code *put)
{  uint X=0;
  write_cmd(0xb0+row);
    write_cmd(0x10+(8*col/16));  
  write_cmd(0x00+(8*col%16));
  for(j=0;j<count;j++)
     for(i=0;i<8;i++) write_data(put[X++]);  

}
/*****************
**********************/
void  PUTchar8x16(uchar row,uchar col,uchar count,uchar code *put)
{  uint X=0;
  write_cmd(0xb0+row);
    write_cmd(0x10+(8*col/16));  
  write_cmd(0x00+(8*col%16));
  for(j=0;j<count;j++)
  { for(i=0;i<8;i++) write_data(put[X++]);
      write_cmd(0xb1+row);
    write_cmd(0x10+(8*col/16));  
    write_cmd(0x00+(8*col%16));
    for(i=0;i<8;i++) write_data(put[X++]);
       write_cmd(0xb0+row);
    col=col+1; }
}
mini12864字库c程序汉字、字符显示.zip (33.09 KB, 下载次数: 11)







欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1