📄 main.c
字号:
void up_move()
{/*
unsigned char data i,j;
unsigned char idata ptemp[8];
if (temp_counter>=(((word_length-1)/32+1)*32))
temp_counter=0;
if (temp_counter==0)
for (i=0;i<8;i++) ptemp[i]=0x00;
temp_counter++;
if ((temp_counter%32)>16)
for (i=0;i<8;i++) ptemp[i]=0x00;
else {
for (i=0;i<8;i++) {
if ((i%2)==0)
ptemp[i]=*(temp_ram_addr+i*16+(temp_counter/32-1)*);
else
ptemp[i]=*(temp_ram_addr+i*16-15+);
}
}
for (j=0;j<15;j++)
for (i=0;i<8;i++)
*(disp_ram_addr+j*8+i)=*(disp_ram_addr+(j+1)*8+i);
for (i=0;i<8;i++)
*(disp_ram_addr+120+i)=temp[i];
/*
if ((i%2)==0)
*(disp_ram_addr+120+i)=*(temp_ram_addr+i*16);
else
*(disp_ram_addr+120+i)=*(temp_ram_addr+(i-1)*16+1);*/
}
void down_move()
{
}
void disp_static()
{
unsigned char data i,j;
for (j=0;j<16;j++)
for (i=0;i<8;i++)
if ((i%2)==0)
*(disp_ram_addr+j*8+i)=*(temp_ram_addr+i*16+j*2);
else
*(disp_ram_addr+j*8+i)=*(temp_ram_addr+(i-1)*16+j*2+1);
}
void disp_ram()
{
char data scan_counter=0,counter=0;
disp_counter=0x00;
for (scan_counter=0;scan_counter<16;scan_counter++) {
for (counter=0;counter<8;counter++) {
wait();
CPLD_SEL=LOW;
disp_word=*(disp_ram_addr+counter+scan_counter*8);
CPLD_SEL= HIGH;
SCL = LOW;
SCL = HIGH;
*write_addr=disp_word;
//*write_addr=disp_counter;
//disp_counter++;
}
XLAT=LOW;
BLANK=LOW;
XLAT=HIGH;
BLANK=HIGH;
}
//DATA_SEL=~DATA_SEL;
/*
if (speed_counter==0x40) disp_counter=0xff;
if (speed_counter==0x80) disp_counter=0x55;
if (speed_counter==0xc0) disp_counter=0xaa;
if (speed_counter==0x00) disp_counter=0x00;
if (speed_counter==0x00) disp_counter=disp_counter+1;
*/
}
/*
void example()
{
unsigned char counter;
counter=0x00;
*(temp_ram_addr+counter)=0xa2;
counter++;
*(temp_ram_addr+counter)=0x03;
counter++;
*(temp_ram_addr+counter)=0x63;
counter++;
*(temp_ram_addr+counter)=0x47;
counter++;
*(temp_ram_addr+counter)=0x22;
counter++;
*(temp_ram_addr+counter)=0x2e;
counter++;
*(temp_ram_addr+counter)=0xff;
counter++;
*(temp_ram_addr+counter)=0xc4;
counter++;
*(temp_ram_addr+counter)=0x2c;
counter++;
*(temp_ram_addr+counter)=0x28;
counter++;
*(temp_ram_addr+counter)=0x24;
counter++;
*(temp_ram_addr+counter)=0x56;
counter++;
*(temp_ram_addr+counter)=0x2a;
counter++;
*(temp_ram_addr+counter)=0xa0;
counter++;
*(temp_ram_addr+counter)=0x25;
counter++;
*(temp_ram_addr+counter)=0x50;
counter++;
*(temp_ram_addr+counter)=0xfe;
counter++;
*(temp_ram_addr+counter)=0x8c;
counter++;
*(temp_ram_addr+counter)=0x23;
counter++;
*(temp_ram_addr+counter)=0x46;
counter++;
*(temp_ram_addr+counter)=0x23;
counter++;
*(temp_ram_addr+counter)=0xa0;
counter++;
*(temp_ram_addr+counter)=0x3e;
counter++;
*(temp_ram_addr+counter)=0x10;
counter++;
*(temp_ram_addr+counter)=0x29;
counter++;
*(temp_ram_addr+counter)=0xcc;
counter++;
*(temp_ram_addr+counter)=0x10;
counter++;
*(temp_ram_addr+counter)=0x26;
counter++;
*(temp_ram_addr+counter)=0x20;
counter++;
*(temp_ram_addr+counter)=0xe2;
counter++;
*(temp_ram_addr+counter)=0x40;
counter++;
*(temp_ram_addr+counter)=0x01;
counter++;
*(temp_ram_addr+counter)=0x80;
counter++;
*(temp_ram_addr+counter)=0x10;
counter++;
*(temp_ram_addr+counter)=0xc1;
counter++;
*(temp_ram_addr+counter)=0x11;
counter++;
*(temp_ram_addr+counter)=0xa2;
counter++;
*(temp_ram_addr+counter)=0x2e;
counter++;
*(temp_ram_addr+counter)=0x9c;
counter++;
*(temp_ram_addr+counter)=0x24;
counter++;
*(temp_ram_addr+counter)=0xfb;
counter++;
*(temp_ram_addr+counter)=0x48;
counter++;
*(temp_ram_addr+counter)=0x94;
counter++;
*(temp_ram_addr+counter)=0x98;
counter++;
*(temp_ram_addr+counter)=0x93;
counter++;
*(temp_ram_addr+counter)=0x26;
counter++;
*(temp_ram_addr+counter)=0x9d;
counter++;
*(temp_ram_addr+counter)=0x40;
counter++;
*(temp_ram_addr+counter)=0x90;
counter++;
*(temp_ram_addr+counter)=0x80;
counter++;
*(temp_ram_addr+counter)=0x81;
counter++;
*(temp_ram_addr+counter)=0x48;
counter++;
*(temp_ram_addr+counter)=0x3f;
counter++;
*(temp_ram_addr+counter)=0x26;
counter++;
*(temp_ram_addr+counter)=0x04;
counter++;
*(temp_ram_addr+counter)=0x50;
counter++;
*(temp_ram_addr+counter)=0x08;
counter++;
*(temp_ram_addr+counter)=0x28;
counter++;
*(temp_ram_addr+counter)=0xff;
counter++;
*(temp_ram_addr+counter)=0xcc;
counter++;
*(temp_ram_addr+counter)=0x20;
counter++;
*(temp_ram_addr+counter)=0x06;
counter++;
*(temp_ram_addr+counter)=0x40;
counter++;
*(temp_ram_addr+counter)=0x01;
counter++;
*(temp_ram_addr+counter)=0xa8;
counter++;
*(temp_ram_addr+counter)=0x04;
counter++;
*(temp_ram_addr+counter)=0x64;
counter++;
*(temp_ram_addr+counter)=0x09;
counter++;
*(temp_ram_addr+counter)=0x22;
counter++;
*(temp_ram_addr+counter)=0x32;
counter++;
*(temp_ram_addr+counter)=0x31;
counter++;
*(temp_ram_addr+counter)=0xc6;
counter++;
*(temp_ram_addr+counter)=0x2e;
counter++;
*(temp_ram_addr+counter)=0xca;
counter++;
*(temp_ram_addr+counter)=0x3c;
counter++;
*(temp_ram_addr+counter)=0x34;
counter++;
*(temp_ram_addr+counter)=0x06;
counter++;
*(temp_ram_addr+counter)=0x24;
counter++;
*(temp_ram_addr+counter)=0x19;
counter++;
*(temp_ram_addr+counter)=0x48;
counter++;
*(temp_ram_addr+counter)=0xf0;
counter++;
*(temp_ram_addr+counter)=0xb0;
counter++;
*(temp_ram_addr+counter)=0x17;
counter++;
*(temp_ram_addr+counter)=0xc0;
counter++;
*(temp_ram_addr+counter)=0x12;
counter++;
*(temp_ram_addr+counter)=0x60;
counter++;
*(temp_ram_addr+counter)=0x14;
counter++;
*(temp_ram_addr+counter)=0x18;
counter++;
*(temp_ram_addr+counter)=0x1c;
counter++;
*(temp_ram_addr+counter)=0x0c;
counter++;
*(temp_ram_addr+counter)=0x18;
counter++;
*(temp_ram_addr+counter)=0x06;
counter++;
*(temp_ram_addr+counter)=0x30;
counter++;
*(temp_ram_addr+counter)=0x06;
counter++;
*(temp_ram_addr+counter)=0x40;
counter++;
*(temp_ram_addr+counter)=0x01;
counter++;
*(temp_ram_addr+counter)=0x82;
counter++;
*(temp_ram_addr+counter)=0x02;
counter++;
*(temp_ram_addr+counter)=0xc2;
counter++;
*(temp_ram_addr+counter)=0x05;
counter++;
*(temp_ram_addr+counter)=0x73;
counter++;
*(temp_ram_addr+counter)=0xfa;
counter++;
*(temp_ram_addr+counter)=0x30;
counter++;
*(temp_ram_addr+counter)=0x04;
counter++;
*(temp_ram_addr+counter)=0x08;
counter++;
*(temp_ram_addr+counter)=0x0a;
counter++;
*(temp_ram_addr+counter)=0x3f;
counter++;
*(temp_ram_addr+counter)=0xf2;
counter++;
*(temp_ram_addr+counter)=0x22;
counter++;
*(temp_ram_addr+counter)=0x62;
counter++;
*(temp_ram_addr+counter)=0x41;
counter++;
*(temp_ram_addr+counter)=0xc2;
counter++;
*(temp_ram_addr+counter)=0x40;
counter++;
*(temp_ram_addr+counter)=0x82;
counter++;
*(temp_ram_addr+counter)=0x3f;
counter++;
*(temp_ram_addr+counter)=0xfa;
counter++;
*(temp_ram_addr+counter)=0x22;
counter++;
*(temp_ram_addr+counter)=0x22;
counter++;
*(temp_ram_addr+counter)=0x24;
counter++;
*(temp_ram_addr+counter)=0x52;
counter++;
*(temp_ram_addr+counter)=0x28;
counter++;
*(temp_ram_addr+counter)=0x2a;
counter++;
*(temp_ram_addr+counter)=0x3f;
counter++;
*(temp_ram_addr+counter)=0xc6;
counter++;
*(temp_ram_addr+counter)=0x20;
counter++;
*(temp_ram_addr+counter)=0x02;
counter++;
*(temp_ram_addr+counter)=0x40;
counter++;
*(temp_ram_addr+counter)=0x01;
}*/
void wait()
{
unsigned char data i;
for (i=0;i<2;i++);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -