extern static unsigned char volum,bass,tribl,ATT_LR,ATT_RR,ATT_LF,ATT_RF,mode; extern void SendData1(unsigned char); flash char Tabl_tembr[]={0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x0F,0x0E,0x0D,0x0C,0x0B,0x0A,0x09,0x08}; void Init_pt2313() { SendData1(volum); SendData1(ATT_LR|0xC0); SendData1(ATT_RR|0xE0); SendData1(ATT_LF|0x80); SendData1(ATT_RF|0xA0); SendData1(mode|0x44); SendData1(Tabl_tembr[bass]); SendData1(Tabl_tembr[tribl]); } void Mute() { SendData1(0x3F); } void Vol_down() { if(volum<0x3F)volum++; SendData1(volum); } void Vol_up() { if(volum>0)volum--; SendData1(volum); } void Bass_down() { if(bass>0)bass--; SendData1(Tabl_tembr[bass]|0x60); } void Bass_up() { if(bass<15)bass++; SendData1(Tabl_tembr[bass]|0x60); } void Tribl_down() { if(tribl>0)tribl--; SendData1(Tabl_tembr[tribl]|0x70); } void Tribl_up() { if(tribl<15)tribl++; SendData1(Tabl_tembr[tribl]|0x70); } void Ball_right() { if(ATT_LF==0) { if(ATT_RF>=0x1F) ATT_RF++; } else{ if(ATT_LF>0) ATT_LF--; } SendData1(ATT_LF|0x80); SendData1(ATT_RF|0xA0); } void Ball_left() { if(ATT_RF==0) { if(ATT_LF>=0x1F) ATT_LF++; } else{ if(ATT_RF>0) ATT_RF--; } SendData1(ATT_LF|0x80); SendData1(ATT_RF|0xA0); } void SW_up() { if(ATT_RR==0) { if(ATT_LR<0x1F) ATT_LR++; } else{ if(ATT_RR>0) ATT_RR--; } SendData1(ATT_LR|0xC0); SendData1(ATT_RR|0xE0); } void SW_down() { if(ATT_RR==0) { if(ATT_RR<0x1F) ATT_RR++; } else{ if(ATT_LR>0) ATT_LR--; } SendData1(ATT_LR|0xC0); SendData1(ATT_RR|0xE0); } void Void_mode() { if(++mode>3)mode=0; SendData1(mode|0x44); }