?? x9241.h
字號(hào):
#include "excalibur.h"
#define ADDRTC 0x50
typedef unsigned char uchar;
np_pio *x9241_scl=na_x9241_scl;
np_pio *x9241_sda=na_x9241_sda;
void delayx9241()
{
unsigned int i;
for(i=0;i<1;i++);
}
void initialx9241()
{
x9241_sda->np_piodirection=1;
}
void start()
{
//x9241_scl->np_piodata=0;
//delayx9241();
x9241_sda->np_piodata=1;
x9241_scl->np_piodata=1;
//delayx9241();
x9241_sda->np_piodata=0;
//delayx9241();
//x9241_scl->np_piodata=0;
}
void stop()
{
//x9241_scl->np_piodata=0;
//delayx9241();
x9241_sda->np_piodata=0;
x9241_scl->np_piodata=1;
//delayx9241();
x9241_sda->np_piodata=1;
}
void send(unsigned char dat)
{
unsigned int i;
for(i=0;i<8;i++)
{
delayx9241();
x9241_scl->np_piodata=0;
x9241_sda->np_piodata=(dat&0x80)>>7;
dat=dat<<1;
delayx9241();
x9241_scl->np_piodata=1;
}
ack();
}
void ack()
{
x9241_scl->np_piodata=0;
//delayx9241();
x9241_sda->np_piodata=0;
x9241_scl->np_piodata=1;
delayx9241();
x9241_scl->np_piodata=0;
}
void wrWCR(unsigned char Rx,unsigned char Vw)//Rx為0,1,2,3,Vw最大為0x3f
{
start();
send(0x50);
send(0xa0|((Rx*4)&0x0c));
send(0x3f&Vw);//Vw<=00111111
stop();
}
void wrDR(unsigned char Rx,unsigned char Vw)
{
start();
send(0x50);
send(0xc0|((Rx*4)&0x0c));
send(0x3f&Vw);
stop();
nr_delay(3);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -