ZLG7290.C
资源名称:USB_2.0.rar [点击查看]
上传用户:ids068
上传日期:2013-04-04
资源大小:639k
文件大小:1k
源码类别:
USB编程
开发平台:
C/C++
- #include "reg51.h"
- #include "viic_c51.h"
- #define zlg7290 0x70
- #define SubKey 0x01
- #define SubCmdBuf 0x07
- #define SubDpRam 0x10
- void delayMS(unsigned char i)
- {
- unsigned char j,k;
- for(k=0;k<i;k++)
- for(j=0;j<60;j++);
- }
- unsigned char ZLG7290_SendData(unsigned char SubAdd,unsigned char Data)
- {
- if(SubAdd>0x17)
- return 0;
- ISendStr(zlg7290,SubAdd,&Data,1);
- delayMS(10);
- return 1;
- }
- unsigned char ZLG7290_SendCmd(unsigned char Data1,unsigned char Data2)
- {
- unsigned char Data[2];
- Data[0]=Data1;
- Data[1]=Data2;
- ISendStr(zlg7290,0x07,Data,2);
- delayMS(10);
- return 1;
- }
- void ZLG7290_SendBuf(unsigned char * disp_buf,unsigned char num)
- {
- unsigned char i;
- for(i=0;i<num;i++)
- {
- ZLG7290_SendCmd(0x60+i,*disp_buf);
- disp_buf++;
- }
- }
- unsigned char ZLG7290_GetKey()
- {
- unsigned char rece;
- rece=0;
- IRcvStr(zlg7290,1,&rece,1);
- delayMS(10);
- return rece;
- }