Keyboard
Keyboard
#include <1pc214x.h>
voidserini (void);
int main()
inti.k:
tr(0x0d);
tr(0x0A);
for(i=0;a[i]=0;i++)
tr(a[i]);
tr (0x0d);
tr(0x0A);
tr(key_wa());
for(k=0;k<150000;k++);
voidserini (void)
{
PINSEL0=0x00000005;
UOLCR=0x83;
UODLL= 0x5a;
U0DLM=0x00;
U0FDR=0xc1;
U0LCR=0x03;
}
voidtr (unsigned char a)
UOTHR=a;
IO0DIR|= 0x0F00<<8;
IO0PIN= (IO0PIN&0xFFFOFFFF) |0x0E00<<8;
if ((100PIN & 0xF-000<<8)!= 0xF000<<8)
{
case 0x0007000<<8; delay();return 19:
IO0PIN=(IO0PIN&0xFFTOFFTF) | (0x0B00<<8;
{
switch (IO0PIN & 0xF000<<8)
IO0PIN=(IO0PIN&0xFFF0FFFF) | 0x0700<<8;
if ((IO0PIN & 0xF000<<8)!=0xF000<<8)
return 0xFF;
return Read;
void delay()
unsignedinti,j;
for(i=0;i<0xff;i++)
for(j=0;j<0xfff;j++);