?? design.h
字號(hào):
#define MODLE P3_5
#define GB P0_4//高電平為橢圓
#define G P0_5//高電平為低通
#define RG1 P3_6
#define RG2 P3_7
#define START 0x50
#define RWR 0x90
#define WWR 0xa0
#define RDR0 0xb0
#define RDR1 0xb4
#define RDR2 0xb8
#define RDR3 0xbc
#define WDR0 0xc0
#define WDR1 0xc4
#define WDR2 0xc8
#define WDR3 0xcc
#define DTW0 0xd0
#define DTW1 0xd4
#define DTW2 0xd8
#define DTW3 0xdc
#define WTD0 0xe0
#define WTD1 0xe4
#define WTD2 0xe8
#define WTD3 0xec
#define GDTW0 0x10
#define GDTW1 0x14
#define GDTW2 0x18
#define GDTW3 0x1c
#define GWTD0 0x80
#define GWTD1 0x84
#define GWTD2 0x88
#define GWTD3 0x8c
#define EWR 0x40
float code rfl1[20]={340,169,113,84.5,68.1,56.2,48.7,42.2,37.4,34,30.9,28,26.1,24.3,22.6,21,20,18.7,17.8,16.9};
float code rfl2[20]={165,82.5,54.9,41.2,33.2,27.4,23.7,20.5,18.2,16.5,4.75,4.32,4.02,3.74,3.48,3.24,3.09,2.87,2.74,2.61};
float code rql1=28;
float code rql2=3.92;
float code rfh1[20]={75,37.4,24.9,18.7,4.75,3.92,3.4,2.94,2.61,2.37,2.15,1.96,1.82,1.69,1.58,1.47,1.4,1.3,1.24,1.18};
float code rfh2[20]={154,76.8,51.1,38.3,30.9,25.5,22.1,19.1,16.9,4.87,4.42,4.02,3.74,3.48,3.24,3.01,2.87,2.67,2.55,2.43};
float code rqh1_4=28;
float code rqh1_5=19.6;
float code rqh2_7=3.92;
float code rqh2_9=4.12;
float code rqh2_12=3.01;
float code rqh2_13=3.16;
float code rqh2_20=2.24;
//--------------------------------------
void goble_change0(float x)
{
float y,z;
unsigned char q,i;
for(i=0;i<4;i++)
{
if(x>=100) {x=x-100;z=100;}
else {z=x;x=0;}
y=z/0.392157;
q=(unsigned char)y;
Start();
Write_c(START);
ACK_chack();
Write_c(WDR0+i);
ACK_chack();
Write_c(q);
ACK_chack();
Stop();
}
Start();
Write_c(START);
ACK_chack();
Write_c(GDTW0);
ACK_chack();
Stop();
}
void goble_change1(float x)
{
float y,z;
unsigned char q,i;
for(i=0;i<4;i++)
{
if(x>=100) {x=x-100;z=100;}
else {z=x;x=0;}
y=z/0.392157;
q=(unsigned char)y;
Start();
Write_c(START+1);
ACK_chack();
Write_c(WDR0+i);
ACK_chack();
Write_c(q);
ACK_chack();
Stop();
}
Start();
Write_c(START+1);
ACK_chack();
Write_c(GDTW0);
ACK_chack();
Stop();
}
void g_h(float x1,float x2)
{
float y;
unsigned char q;
y=x1/0.392157;
q=(unsigned char)y;
Start();
Write_c(START+3);
ACK_chack();
Write_c(WDR0);
ACK_chack();
Write_c(q);
ACK_chack();
Stop();
//---------------------------------
y=x2/0.392157;
q=(unsigned char)y;
Start();
Write_c(START+3);
ACK_chack();
Write_c(WDR0+3);
ACK_chack();
Write_c(q);
ACK_chack();
Stop();
//---------------------------------
Start();
Write_c(START+3);
ACK_chack();
Write_c(GDTW0);
ACK_chack();
Stop();
}
//;-----------------------------------------------------
void lp_set(unsigned char x)//x<=20khz
{
MODLE=0;
GB=0;
G=1;
RG1=0;
if(x>=11) RG2=1;
else RG2=0;
goble_change0(rfl1[x-1]);
goble_change1(rfl2[x-1]);
g_h(rql1,rql2);
}
//----------------------------------------------------
unsigned char hp_set(unsigned char x)//x<=20khz
{
MODLE=1;
GB=0;
G=0;
if(x<=4) RG1=0;
else RG1=1;
if(x<=9) RG2=0;
else RG2=1;
goble_change0(rfh1[x-1]);
goble_change1(rfh2[x-1]);
if(x<=4) {g_h(rqh1_4,rqh2_7);return 1;}
if(x<=7) {g_h(rqh1_5,rqh2_7);return 1;}
if(x<=9) {g_h(rqh1_5,rqh2_9);return 1;}
if(x<=12) {g_h(rqh1_5,rqh2_12);return 1;}
if(x<=13) {g_h(rqh1_5,rqh2_13);return 1;}
if(x<=20) {g_h(rqh1_5,rqh2_20);return 1;}
return 0;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -