音量控制M62446的驱动C程序

合集下载

音量控制M62446

音量控制M62446

idata WORD shadow_word00=0; idata WORD shadow_word01=0; idata WORD shadow_word10=0; idata WORD shadow_word11=0; // for storing the control word status // BOOL bM62446Muted; // Set when 62446 is muted
无标题 音量控制M62446 //------------------------------------------------------------------------// M62446 drving routines, VER 1.0 // // COPYRIGHT (C) 2000, Enbia Technology Inc. // Target: 8031 // AUTHOR: STEVEN LUO // // Revision History: // 2001/1/5 - Original Version // //------------------------------------------------------------------------#include <reg51.h> #include <types.h> #include <intrins.h> #include <bin.h> extern BOOL extern BOOL extern BOOL static static static static static PIN_M62446_LATCH; PIN_M62446_DATA; PIN_M62446_CLK;
无标题 shadow_word10|=temp; // DE=1;DF=0; shadow_word10&=0xfffc; shadow_word10|=0x02; if (bM62446Muted) return; Write_M62446_Word(shadow_word10); } //------------------------------------------------------------------------// Name: Write_M62446_SurLeft // Description: This function Write 2 bytes to M62446 // Arguments: // Return value: none //------------------------------------------------------------------------void Write_M62446_SurLeft(char vol){ WORD temp; temp=Volume_Validate(vol); temp<<=9; shadow_word11&=0x01ff; shadow_word11|=temp; // DE=1;DF=1; shadow_word11&=0xfffc; shadow_word11|=0x03; if (bM62446Muted) return; Write_M62446_Word(shadow_word11); } //------------------------------------------------------------------------// Name: Write_M62446_SurRight // Description: This function Write 2 bytes to M62446 // Arguments: // Return value: none //------------------------------------------------------------------------void Write_M62446_SurRight(char vol){ WORD temp; temp=Volume_Validate(vol); temp<<=2; shadow_word11&=0xfe03; shadow_word11|=temp; // DE=1;DF=1; shadow_word11&=0xfffc; shadow_word11|=0x03; if (bM62446Muted) return; Write_M62446_Word(shadow_word11); } static BYTE code Treble_Bass_TAB[11]={ 0x0e, // 0, -10db 0x0c, // 1, -8db 0x0b, // 2, -6db 0x0a, // 3, -4db 0x09, // 4, -2db 0x00, // 5, 0db 0x01, // 6, +2db 0x02, // 7, +4db 0x03, // 8, +6db 0x04, // 9, +8db 0x06 // 10, +10db பைடு நூலகம்; //------------------------------------------------------------------------// Name: Write_M62446_Treble // Description: This function Write 2 bytes to M62446 // Arguments: 0-20, // 0: -10db // 10: 0db // 20 +10db // Return value: none //------------------------------------------------------------------------void Write_M62446_Treble(BYTE Treble){ 第 3 页

19264显示驱动程序

19264显示驱动程序

19264控制器KS0108#include <at89x52.h>#include <intrins.h>#include "zimo.h"#define RS P2_6 /*"H" is send or read the data;"L" is the instruction*/ #define RW P3_6#define E P2_5 /*Operation enable*/#define CS1 P2_4#define CS2 P2_3#define CS3 P2_2#define DATA P0#define uchar unsigned char#define uint unsigned int/* -------------------------------------------------Delay some time----------- */void delay10ms(unsigned char x){unsigned char i,j,k;for(i=0;i<x;i++)for(j=0;j<10;j++)for(k=0;k<120;k++);}/* -------------------------------------------------Send the instruction to the First KS0108 window--*/void OutFI(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS1=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS1=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=0;CS1=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS1=1;E=1;}/* ------------------------------------------------- Send the instruction to the Second KS0108 window.--*/void OutSI(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS2=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS2=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=0;CS2=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS2=1;E=1;}/* ------------------------------------------------- Send the instruction to the Third KS0108 window--*/void OutTI(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS3=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS3=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=0;CS3=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS3=1;E=1;}/* -------------------------------------------------Send the data to the First ks0108 Window--*/void OutFD(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS1=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS1=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=1;CS1=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS1=1;E=1;}/* ------------------------------------------------- Send the data to the Second ks0108 Window--*/void OutSD(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS2=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS2=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=1;CS2=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS2=1;E=1;}/* ------------------------------------------------- Send the data to the Third ks0108 Window--*/void OutTD(uchar i){unsigned char data_sta;do{E=0;RW=1;RS=0;CS3=0;_nop_();data_sta=DATA;E=0;RW=0;CS3=1;E=1;}while(data_sta&0x80);E=0;RW=0;RS=1;CS3=0;_nop_();E=1;_nop_();DATA=i;_nop_();E=0;RW=1;CS3=1;E=1;}/* ------------------------------------------------- Read the data to the First ks0108 Window--*//*unsigned char RD_data_F(){unsigned char data_sta;do{E=0;RW=1;RS=0;CS1=0;_nop_();E=1;_nop_();data_sta=DATA;E=0;RW=0;CS1=1;E=1;}while(data_sta&0x80);E=0;RW=1;RS=1;CS1=0;_nop_();E=1;_nop_();_nop_();_nop_();data_sta=DATA;_nop_();E=0;RW=0;CS1=1;E=1;return (data_sta);}/* ------------------------------------------------- Read the data to the Second ks0108 Window--*//*unsigned char RD_data_S(){unsigned char data_sta;do{E=0;RW=1;RS=0;CS2=0;_nop_();E=1;_nop_();_nop_();_nop_();data_sta=DATA;E=0;RW=0;CS2=1;E=1;}while(data_sta&0x80);E=0;RW=1;RS=1;CS2=0;_nop_();data_sta=DATA;_nop_();E=0;CS2=1;E=1;return (data_sta);}/* ------------------------------------------------- Read the data to the Third ks0108 Window--*//*unsigned char RD_data_T(){unsigned char data_sta;do{E=0;RW=1;RS=0;CS3=0;_nop_();E=1;_nop_();_nop_();_nop_();data_sta=DATA;E=0;RW=0;CS3=1;E=1;}while(data_sta&0x80);E=0;RW=1;RS=1;CS3=0;_nop_();E=1;_nop_();data_sta=DATA;_nop_();E=0;CS3=1;E=1;return(data_sta);}/* ------------------------------------------------- Initialize the LCD,The system reset,invoke First time-*/void InitLCD(){OutFI(0x40); /*Set the Y address 0 */OutSI(0x40);OutTI(0x40);OutFI(0xb8); /*Set the Page 0 */OutSI(0xb8);OutTI(0xb8);OutFI(0xc0); /*Set the display start line 0 */OutSI(0xc0);OutTI(0xc0);OutFI(0x3f); /*Display ON */OutSI(0x3f);OutTI(0x3f);}/* -------------------------------------------------Clear the three ks0108's display ram.Clrscr screen-*/void Clrscreen(){unsigned char i,j;for(i=0;i<8;i++){OutFI(0xb8|i);for(j=0;j<64;j++){OutFI(j|0x40);OutFD(0);}}for(i=0;i<8;i++)(OutSI(0xb8|i);for(j=0;j<64;j++)(OutSI(j|0x40);OutSD(0);}}for(i=0;i<8;i++)(OutTI(0xb8|i);for(j=0;j<64;j++)(OutTI(j|0x40);OutTD(0);}}}/* -------------------------------------------------Display Chinese ideograph;x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width;bmp is the table's name-*/void DrawBmp(uchar x_add,uchar layer,uchar width,uchar *bmp)(unsigned char x;unsigned int i=0;for(x=x_add;x<x_add+width;x++)(if (x>127) /*The Third KS0108*/(OutTI((x-128)|0x40); /*Set the x address*/OutTI(layer|0xb8); /*Set the y address*/OutTD(bmp[i]); /*Send thd data to LCD ram*/OutTI((x-128)|0x40); /*Display the down screen*/ OutTI((layer|0xb8)+1); i++; /*Display zimo table address add 1*/ OutTD(bmp[i]);}else if (x>63) /*The Second ks0108*/{OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(bmp[i]);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);i++;OutSD(bmp[i]);}else /*The First ks0108*/{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(bmp[i]);OutFI(x|0x40);OutFI((layer|0xb8)+1);i++;OutFD(bmp[i]);}i++;}}/* -------------------------------------------------Display Chinese ideograph;x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width;bmp is the table's name.-*/void DrawBmp_f(uchar x_add,uchar layer,uchar width,uchar *bmp) {unsigned char x;unsigned int i=0;for(x=x_add;x<x_add+width;x++) (if (x>127)(OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(~bmp[i]);OutTI((x-128)|0x40);OutTI((layer|0xb8)+1);i++;OutTD(~bmp[i]);}else if (x>63)(OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(~bmp[i]);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);i++;OutSD(~bmp[i]);}else(OutFI(x|0x40);OutFI(layer|0xb8);OutFD(~bmp[i]);OutFI(x|0x40);OutFI((layer|0xb8)+1);i++;OutFD(~bmp[i]);}i++;}}/*Display indention; x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width-*/void _DrawBmp_(uchar x_add,uchar layer,uchar width){unsigned char x;for(x=x_add;x<x_add+width;x++){if (x>127){OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(0);OutTI((x-128)|0x40);OutTI((layer|0xb8)+1);OutTD(0);}else if (x>63){OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(0);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);OutSD(0);}else{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(0);OutFI(x|0x40);OutFI((layer|0xb8)+1);OutFD(0);/* --------------------------------------------------Display indention; x_add is the x address;It has 4 layers,0,1,2,3; Width is the Chinese ideograph width-*/void _DrawBmp_black(uchar x_add,uchar layer,uchar width){unsigned char x;for(x=x_add;x<x_add+width;x++){if (x>127){OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(0xff);OutTI((x-128)|0x40);OutTI((layer|0xb8)+1);OutTD(0xff);}else if (x>63){OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(0xff);OutSI((x-64)|0x40);OutSI((layer|0xb8)+1);OutSD(0xff);}else{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(0xff);}}OutFI(x|0x40);OutFI((layer|0xb8)+1);OutFD(0xff);}}}/* --------------------------------------------------Display the line display_data_graph is the display graph data-*/void _DrawBmp_line(uchar x_add,uchar layer,uchar width,uchar display_data_graph) {unsigned char x;unsigned int i=0;for(x=x_add;x<x_add+width;x++){if (x>127){OutTI((x-128)|0x40);OutTI(layer|0xb8);OutTD(display_data_graph);}else if (x>63){OutSI((x-64)|0x40);OutSI(layer|0xb8);OutSD(display_data_graph);}else{OutFI(x|0x40);OutFI(layer|0xb8);OutFD(display_data_graph);}i++;/*Display the column display_data_graph is the display graph data-*/void _DrawBmp_column(uchar x,uchar width) {unsigned int i=0;if (x>127){for(i=0;i<width;i++){OutTI((x-128)|0x40);OutTI(i|0xb8);OutTD(0xff);}}else if (x>63){for(i=0;i<width;i++){OutSI((x-64)|0x40);OutSI(i|0xb8);OutSD(0xff);}}else{for(i=0;i<width;i++){OutFI(x|0x40);OutFI(i|0xb8);OutFD(0xff);}}}}}。

阿杜步步高维修总结

阿杜步步高维修总结
AV213 开机自动保护(永久缺料)维修一例 经检测是 STK402 厚膜内引脚脱焊(此 IC 又是永久缺料,按规定代替机工厂成本大,麻烦且用 户不满意).可把 STK402 厚膜内引脚全部拿掉.用导线把 STK402 厚膜内引脚点一一连上(有点 麻烦,但能解决问题).焊好后确定无连焊虚焊可打点白胶在内(不要太多,以不过 IC 的槽为准. 要不 IC 不好固定).此机开机自动保护多为这两 IC 内引脚脱焊.焊接好后即可正常使用 .成本 低又能实质性解决问题.
DV965 自动关机和自动开机 本人这里有一台 DV965 播放几分钟会无规率的自动关机和自动开机,电源不加负载是好 的,一加负载就出现 :我以经修好了,把解压板上的ASTB那条线路剪了,功能都正常,试机一天都好的 。 请检查电源管理 IC:U505(12C508A)及外围元件,注意此 IC 标贴数字,烧有程序不能随 便代换,否则不能管理直流开关机。
这台机器是天津送修北京的一台坏机 ,其故障是播放任何碟片其声音像牛在嚎 (用牛嚎来形 容真的不夸张),且图像与声音还不同步.交给我之前 PCB 板上该换和不该换的 IC 都换了.当然 我也就不用考虑什么 IC 了,最开始我还没有注意到图像和声音不同步 ,也走了不少弯路,总是 围绕在音频输出部分查 ,直到发现不同步后 ,我就联想到声图处理公共部分的问题 ,大家都知 道这款机器采用的是 MT1389FE-C 版,大部分电路在 IC 内部完成,外围也只有时钟和 SDRAM 与 MT1389FE-C 之间数据时钟可以查,我也一一查了(方法:对比其它机器借助示波器查),没有 发现任何异常 .哎!说到这里,这台机器我已修了一天多了 ,我本想放弃 ,最后售后有位同仁说 : 你查过电源没 ?我当时还反驳了他 (因为这是修机起码步骤 ,肯定查过),此时我在看图册时发

虚仪科技 VIRTINS Multi-Instrument (万用仪) 3.2 说明书

虚仪科技 VIRTINS Multi-Instrument (万用仪) 3.2 说明书
3.2 使用说明书
虚仪科技
Virtins Technology
VIRTINS Multi-Instrument (万用仪) 3.2 使用说明书
本说明书适用于 VIRTINS Multi-Instrument(万用仪)。它包括: VIRTINS 示波器 VIRTINS 频谱分析仪 VIRTINS 信号发生器 VIRTINS 万用表 VIRTINS 数据记录仪 VIRTINS 频谱 3D 图 VIRTINS 设备检测计划 VIRTINS LCR 表 VIRTINS DDP 查看器 的使用说明。如果您仅购买了其中的某些仪器,则仅相应章节适用。
注意: 虚仪科技保留在任何时候无需预先通知而对本使用说明书进行修改的权利。 本使用说明书 可能包含有文字错误。

1
版权所有 © 2009 虚仪科技
VIRTINS Multi-Instrument(万用仪)3.2 使用说明书
虚仪科技
Virtins Technology
目录
1 引言 ....................................................................................................................................................12 1.1 概述 ............................................................................................................................................12 1.2 系统要求 .............................

ht1621c程序

ht1621c程序
}
//--------------------------------------------------------------------------
// Name: TurnOn_1621
//--------------------------------------------------------------------------
static idata WORD shadow_word00=0;
static idata WORD shadow_word01=0;
static idata WORD shadow_word10=0;
static idata WORD shadow_word11=0; // for storing the control word status //
void Write_M62446_Left(char vol){
WORD temp;
temp=Volume_Validate(vol);
temp<<=9;
shadow_word01&=0x01ff;
shadow_word01|=temp;
// DE=0;DF=1;
shadow_word01&=0xfffc; shadow_word01|=0x01;
BYTE i;
BYTE cmd;
PIN_1621_CS = 1; // clear CS
CLK_DELAY();
PIN_1621_CS = 0; // clear CS
cmd = B0000_0100;
// CMD - 110
for (i=3; i>0; --i){

航盛维修手册统一版

航盛维修手册统一版

www. hangsheng- sh. com
3.3.2.3 车内部半球摄像头................................................................28 3.3.2.3.1 车内部半球摄像头参数.....................................................28 3.3.2.3.2 车内部半球摄像头尺寸图.................................................28 3.3.2.3.3 车内部半球摄像头接口定义.............................................29 3.3.3 连接线参数 .............................................................................. 29 3.3.4 控制盒尺寸 .............................................................................. 29 3.3.5 系统连接总成图....................................................................... 29 3.4 故障排除指导 ..................................................................................... 30 3.5 注意事项 ............................................................................................ 30 影音类 ............................................................................................................... 31 4 高清播放器(固态存储).......................................................................... 31 4.1 功能描述 ............................................................................................. 31 4.2 系统组成 ............................................................................................. 31 4.2.1 产品图示 .................................................................................. 31 4.2.2 系统组成图 .............................................................................. 32 4.2.3 整机接线图 .............................................................................. 32 4.3 技术参数 ............................................................................................. 33 4.3.1 性能及技术参数....................................................................... 33 4.3.2 面板及定义 .............................................................................. 33 4.4 故障排除及维护指导.......................................................................... 34 4.4.1 故障排除 ................................................................................. 34 4.4.2 日常维护保养.......................................................................... 34 5 液晶显示器 ................................................................................................. 35 5.1 功能描述 ............................................................................................. 35 5.1.1 功能介绍:.............................................................................. 35 5.2 系统组成 ............................................................................................. 35

主流功放芯片介绍

主流功放芯片介绍

低档运放JRC4558。

这种运放是低档机器使用得最多的。

现在被认为超级烂,因为它的声音过于明亮,毛刺感强,所以比起其他的音响用运放来说是最差劲的一种。

不过它在我国暂时应用得还是比较多的,很多的四、五百元的功放还是选择使用它,因为考虑到成本问题和实际能出的效果,没必要选择质量超过5532以上的运放。

对于一些电脑有源音箱来说,它的应付能力还是绰绰有余的。

运放之皇5532。

如果有谁还没有听说过它名字的话,那就还未称得上是音响爱好者。

这个当年有运放皇之称的NE5532,与LM833、LF353、CA3240一起是老牌四大名运放,不过现在只有5532应用得最多。

5532现在主要分开台湾、美国和PHILIPS生产的,日本也有。

5532原来是美国SIGNE公司的产品,所以质量最好的是带大S标志的美国产品,市面上要正宗的要卖8元以上,自从SIGNE被PHILIPS 收购后,生产的5532商标使用的都是PHILIPS商标,质量和原品相当,只须4-5元。

而台湾生产的质量就稍微差一些,价格也最便,两三块便可以买到了。

NE5532的封装和4558一样,都是DIP8脚双运放(功能引脚见图),声音特点总体来说属于温暖细腻型,驱动力强,但高音略显毛糙,低音偏肥。

以前不少人认为它有少许的“胆味”,不过现在比它更有胆味的已有不少,相对来说就显得不是那么突出了。

5532的电压适应范围非常宽,从正负3V至正负20V都能正常工作。

它虽然是一个比较旧的运放型号,但现在仍被认为是性价比最高的音响用运放。

是属于平民化的一种运放,被许多中底档的功放采用。

不过现在有太多的假冒NE5532,或非音频用的工业用品,由于5532的引脚功能和4558的相同,所以有些不良商家还把4558擦掉字母后印上5532字样充当5532,一般外观粗糙,印字易擦掉,有少许经验的人也可以辨别。

据说有8mA的电流温热才是正宗的音频用5532。

NE5532还有两位兄弟NE5534和NE5535。

FM24C16驱动程序

FM24C16驱动程序
比较简洁的程序:
#define uchar unsigned char
#define uint unsigned int
#define IIC_READ 0XA1 //定义读指令
#define IIC_WRITE 0XA0 //定义写指令
#define NOP _nop_()
//===============================
SDA=a2;SCL=1;SCL=0;
SDA=a1;SCL=1;SCL=0;
SDA=a0;SCL=1;SCL=0;
}
//======================================================
//FUNCTION:BYTE WRITE. 'add' THE WRITE ADDRESS, 'wbyte' THE DATA WANT TO WRITE
//type=1等待应答信号
//type=0 产生无应答信号
void nack(uchar type)
{
SCL=0;SDA=1;SCL=1;IFACK=SDA; SCL=0;
if(type)
{
if(IFACK)//如果无应答信号,则置标志位NO_ACK,程序中止
{ NO_ACK=1;//用户可以加入自己的异常处理程序//
SCL=1;a1=SDA;SCL=0;
SCL=1;a0=SDA;SCL=0;
return(bbyte);
}
//=======================================================
  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

音量控制M62446的驱动C程序音量控制M62446 m62446 pdf//-------------------------------------------------------------------------// M62446 drving routines, VER 1.0//// COPYRIGHT (C) 2000, Enbia Technology Inc.// Target: 8031// AUTHOR: STEVEN LUO//// Revision History:// 2001/1/5 - Original Version////-------------------------------------------------------------------------#include <reg51.h>#include <types.h>#include <intrins.h>#include <bin.h>extern BOOL PIN_M62446_LATCH;extern BOOL PIN_M62446_DATA;extern BOOL PIN_M62446_CLK;static idata WORD shadow_word00=0;static idata WORD shadow_word01=0;static idata WORD shadow_word10=0;static idata WORD shadow_word11=0; // for storing the control word status // static BOOL bM62446Muted; // Set when 62446 is mutedstatic void Write_M62446_Word(WORD myword);//-------------------------------------------------------------------------// Name: Volume_Validate// Description:// Arguments:// Return value: none//-------------------------------------------------------------------------static BYTE Volume_Validate(char vol){if(vol<0)vol=0; // negative, should be 0else if(vol >80) vol=80; // >80, set to 80return 80 - vol; // Down to Up}//-------------------------------------------------------------------------// Name: Mute_M62446// Description:// Arguments:// Return value: none//-------------------------------------------------------------------------void Mute_M62446(void){Write_M62446_Word(0xa141); // B1010000 1010000 01, B10100001_01000001Write_M62446_Word(0xa142);Write_M62446_Word(0xa143);bM62446Muted = 1;}//-------------------------------------------------------------------------// Name: UnMute_M62446// Description:// Arguments:// Return value: none//-------------------------------------------------------------------------void UnMute_M62446(void){shadow_word01&=0xfffc; shadow_word01|=0x01; Write_M62446_Word(shadow_word01); shadow_word10&=0xfffc; shadow_word10|=0x02; Write_M62446_Word(shadow_word10); shadow_word11&=0xfffc; shadow_word11|=0x03; Write_M62446_Word(shadow_word11);bM62446Muted = 0;}//-------------------------------------------------------------------------// Name: Write_M62446_Left// Description: This function Write 2 bytes to M62446// Arguments:// Return value: none//-------------------------------------------------------------------------void Write_M62446_Left(char vol){WORD temp;temp=Volume_Validate(vol);temp<<=9;shadow_word01&=0x01ff;shadow_word01|=temp;// DE=0;DF=1;shadow_word01&=0xfffc; shadow_word01|=0x01;if (bM62446Muted) return;Write_M62446_Word(shadow_word01);}//-------------------------------------------------------------------------// Name: Write_M62446_Right// Description: This function Write 2 bytes to M62446// Arguments:// Return value: none//-------------------------------------------------------------------------void Write_M62446_Right(char vol){WORD temp;temp=Volume_Validate(vol);temp<<=2;shadow_word01&=0xfe03;shadow_word01|=temp;// DE=0;DF=1;shadow_word01&=0xfffc; shadow_word01|=0x01;if (bM62446Muted) return;Write_M62446_Word(shadow_word01);}//-------------------------------------------------------------------------// Name: Write_M62446_Center// Description: This function Write 2 bytes to M62446// Arguments:// Return value: none//------------------------------------------------------------------------- void Write_M62446_Center(char vol){WORD temp;temp=Volume_Validate(vol);temp<<=9;shadow_word10&=0x01ff;shadow_word10|=temp;// DE=1;DF=0;shadow_word10&=0xfffc; shadow_word10|=0x02;if (bM62446Muted) return;Write_M62446_Word(shadow_word10);}//------------------------------------------------------------------------- // Name: Write_M62446_SubWoofer// Description: This function Write 2 bytes to M62446// Arguments:// Return value: none//------------------------------------------------------------------------- void Write_M62446_SubWoofer(char vol){WORD temp;temp=Volume_Validate(vol);temp<<=2;shadow_word10&=0xfe03;shadow_word10|=temp;// DE=1;DF=0;shadow_word10&=0xfffc; shadow_word10|=0x02;if (bM62446Muted) return;Write_M62446_Word(shadow_word10);}//------------------------------------------------------------------------- // Name: Write_M62446_SurLeft// Description: This function Write 2 bytes to M62446// Arguments:// Return value: none//------------------------------------------------------------------------- void Write_M62446_SurLeft(char vol){WORD temp;temp=Volume_Validate(vol);temp<<=9;shadow_word11&=0x01ff;shadow_word11|=temp;// DE=1;DF=1;shadow_word11&=0xfffc; shadow_word11|=0x03;if (bM62446Muted) return;Write_M62446_Word(shadow_word11);}//------------------------------------------------------------------------- // Name: Write_M62446_SurRight// Description: This function Write 2 bytes to M62446// Arguments:// Return value: none//------------------------------------------------------------------------- void Write_M62446_SurRight(char vol){WORD temp;temp=Volume_Validate(vol);temp<<=2;shadow_word11&=0xfe03;shadow_word11|=temp;// DE=1;DF=1;shadow_word11&=0xfffc; shadow_word11|=0x03;if (bM62446Muted) return;Write_M62446_Word(shadow_word11);}static BYTE code Treble_Bass_TAB[11]={0x0e, // 0, -10db0x0c, // 1, -8db0x0b, // 2, -6db0x0a, // 3, -4db0x09, // 4, -2db0x00, // 5, 0db0x01, // 6, +2db0x02, // 7, +4db0x03, // 8, +6db0x04, // 9, +8db0x06 // 10, +10db};//-------------------------------------------------------------------------// Name: Write_M62446_Treble// Description: This function Write 2 bytes to M62446// Arguments: 0-20,// 0: -10db// 10: 0db// 20 +10db// Return value: none//------------------------------------------------------------------------- void Write_M62446_Treble(BYTE Treble){WORD temp;Treble=Treble_Bass_TAB[Treble];temp=Treble;temp<<=12;shadow_word00&=0x0fff;shadow_word00|=temp;// DE=0;DF=0;shadow_word00&=0xfffc;Write_M62446_Word(shadow_word00);}//-------------------------------------------------------------------------// Name: Write_M62446_Bass// Description: This function Write 2 bytes to M62446// Arguments: 0-20,// 0: -10db// 10: 0db// 20 +10db// Return value: none//------------------------------------------------------------------------- void Write_M62446_Bass(BYTE Bass){WORD temp;Bass=Treble_Bass_TAB[Bass];temp=Bass;temp<<=4;shadow_word00&=0xff0f;shadow_word00|=temp;// DE=0;DF=0;shadow_word00&=0xfffc;Write_M62446_Word(shadow_word00);}//-------------------------------------------------------------------------// Name: Write_M62446_Bypass// Description: This function Write 2 bytes to M62446// Arguments: 1, bypass on, 0: off// Return value: none//-------------------------------------------------------------------------void Write_M62446_Bypass(BOOL bOnOff){if (bOnOff) shadow_word00 |= 0x0004; // Onelse shadow_word00 &= 0xfffb; // off// DE=0;DF=0;shadow_word00 &= 0xfffc;Write_M62446_Word(shadow_word00);}//-------------------------------------------------------------------------// Name: Write_M62446_Output// Description: This function Write 2 bytes to M62446// Arguments: port=1-4, BYTE=1 or 0// Return value: none//-------------------------------------------------------------------------void Write_M62446_Output(BYTE port, BOOL bOnoff){WORD temp, mask=1;temp=bOnoff;temp <<= (12-port);mask <<= (12-port);shadow_word00&=~mask;shadow_word00|=temp;// DE=0;DF=0;shadow_word00&=0xfffc;Write_M62446_Word(shadow_word00);}#define DELAY() {_nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_(); _nop_();_nop_(); _nop_();_nop_(); _nop_();}//-------------------------------------------------------------------------// Name: Write_M62446_Word// Description: This function Write 2 bytes to M62446// Arguments:// Return value: none//-------------------------------------------------------------------------static void Write_M62446_Word(WORD myword){register BYTE i;PIN_M62446_LATCH=0;for (i=16;i>0;--i){if(myword & 0x8000) PIN_M62446_DATA=1; // MSB firstelse PIN_M62446_DATA=0;myword<<=1; // Rotate RightDELAY();PIN_M62446_CLK=1;DELAY();PIN_M62446_CLK=0;}DELAY();PIN_M62446_LATCH=1;}。

相关文档
最新文档