📄 sta308a.c.bak
字号:
/************************************************************
Control sta308
************************************************************/
#define Sta308a_c
#include "Sta308a.h"
#include "Sta304aIIC.h"
#include "I2c_user.h"
/********************************************************/
#pragma INTO_ROM
const char Sta308a_InitDat[]={
Sta308a_ConfA_Init,
Sta308a_ConfB_Init,
Sta308a_ConfC_Init,
Sta308a_ConfD_Init,
Sta308a_ConfE_Init,
Sta308a_ConfF_Init,
Sta308a_ConfG_Init,
Sta308a_ConfH_Init,
Sta308a_ConfI_Init,
Sta308a_Mmute_Init,
Sta308a_Mvol_Init,
Sta308a_C1Vol_Init,
Sta308a_C2Vol_Init,
Sta308a_C3Vol_Init,
Sta308a_C4Vol_Init,
Sta308a_C5Vol_Init,
Sta308a_C6Vol_Init,
Sta308a_C7Vol_Init,
Sta308a_C8Vol_Init,
Sta308a_C1VTNB_Init,
Sta308a_C2VTNB_Init,
Sta308a_C3VTNB_Init,
Sta308a_C4VTNB_Init,
Sta308a_C5VTNB_Init,
Sta308a_C6VTNB_Init,
Sta308a_C7VTNB_Init,
Sta308a_C8VTNB_Init,
Sta308a_C12im_Init,
Sta308a_C34im_Init,
Sta308a_C56im_Init,
Sta308a_C78im_Init,
Sta308a_Auto1_Init,
Sta308a_Auto2_Init,
Sta308a_Auto3_Init,
Sta308a_PreEQ_Init,
Sta308a_Ageq_Init,
Sta308a_Bgeq_Init,
Sta308a_Cgeq_Init,
Sta308a_Dgeq_Init,
Sta308a_Fgeq_Init,
Sta308a_BQlp_Init,
Sta308a_MXlp_Init,
Sta308a_EQbp_Init,
Sta308a_ToneBP_Init,
Sta308a_Tone_Init,
Sta308a_C1234ls_Init,
Sta308a_C5678ls_Init,
Sta308a_L1ar_Init,
Sta308a_L1atrt_Init,
Sta308a_L2ar_Init,
Sta308a_L2atrt_Init,
Sta308a_C12ot_Init,
Sta308a_C34ot_Init,
Sta308a_C56ot_Init,
Sta308a_C78ot_Init,
Sta308a_C12om_Init,
Sta308a_C34om_Init,
Sta308a_C56om_Init,
Sta308a_C78om_Init,
Sta308a_Cfaddr1_Init,
Sta308a_Cfaddr2_Init,
Sta308a_B1cf1_Init,
Sta308a_B1cf2_Init,
Sta308a_B1cf3_Init,
Sta308a_B2cf1_Init,
Sta308a_B2cf2_Init,
Sta308a_B2cf3_Init,
Sta308a_A1cf1_Init,
Sta308a_A1cf2_Init,
Sta308a_A1cf3_Init,
Sta308a_A2cf1_Init,
Sta308a_A2cf2_Init,
Sta308a_A2cf3_Init,
Sta308a_B0cf1_Init,
Sta308a_B0cf2_Init,
Sta308a_B0cf3_Init,
Sta308a_Cfud_Init,
Sta308a_MPCC1_Init,
Sta308a_MPCC2_Init,
Sta308a_RES0_Init,
Sta308a_RES1_Init,
Sta308a_PSC1_Init,
Sta308a_PSC2_Init,
Sta308a_PSC3_Init
};
/**********************************************************
EQ Coefficient Array
ArrayFormat:
Arr[][]={{EQCofficientAddress0,PointVal},
{EQCofficientAddress1,PointVal},
{EQCofficientAddress2,PointVal},
}
**********************************************************/
const char Sta308aEQArray[EQNum][EQVal]={
// TopAdr BotAdr (0x3d) (0x3e) (0x3f) (0x40) (0x41) (0x42) (0x43) (0x44) (0x45) (0x46) (0x47) (0x48) (0x49) (0x4a) (0x4b)
//{ , , , , , , , , , , , , , , , , },
{ 0 , 5 , 0x80 , 0x71 , 0x8f , 0x7f, 0x8e , 0x71 , 0x7f , 0x8e , 0x3e , 0x80 , 0xe2 , 0xb9 , 0x3f , 0xc7 , 0x38 },
{ 0 , 10 , 0x93 , 0x29 , 0xe4 , 0x58 , 0xde , 0xb2 , 0x6c , 0xd6 , 0x1c , 0x9a , 0x20 , 0xc4 , 0x46 , 0x80 , 0x44 },
{ 0 , 55 , 0x80 , 0x71 , 0x8f , 0x7f , 0x8e , 0x71 , 0x7f , 0x8e , 0x3e , 0x80 , 0xe2 , 0xb9 , 0x3f , 0xc7 , 0x38 },
{ 0 , 60 , 0x93 , 0x29 , 0xe4 , 0x58 , 0xde , 0xb2 , 0x6c , 0xd6 , 0x1c , 0x9a , 0x20 , 0xc4 , 0x46 , 0x80 , 0x44 },
{ 0 , 105 , 0x00 , 0x00 , 0x32 , 0x00 , 0x00 , 0x32 , 0x7f , 0x8e , 0x3e , 0x80 , 0xe2 , 0xb9 , 0x00 , 0x00 , 0x19 },
{ 0 , 110 , 0x80 , 0x25 , 0xab , 0x7f , 0x33 , 0x03 , 0x7f , 0xda , 0x55 , 0x80 , 0x4a , 0xff , 0x40 , 0x40 , 0xff },
{ 0 , 115 , 0x80 , 0x56 , 0x00 , 0x7f , 0x5e , 0xb0 , 0x7f , 0xaa , 0x00 , 0x80 , 0xaa , 0x96 , 0x3f , 0xfb , 0x5c },
{ 0 , 120 , 0x80 , 0x18 , 0xa7 , 0x7f , 0xd7 , 0xd8 , 0x7f , 0xe7 , 0x59 , 0x80 , 0x31 , 0x3e , 0x3f , 0xfb , 0x74 }
//{ , , , , , , , , , , , , , , , , },
//{ , , , , , , , , , , , , , , , , },
//{ , , , , , , , , , , , , , , , , },
//{ , , , , , , , , , , , , , , , , },
};
const char Sta308aEQSingleArray[EQSingleNum][EQSingleVal]={
{400/256,400%256, 0x40 , 0x26 , 0xe6 },
{401/256,401%256, 0x40 , 0x26 , 0xe6 },
{402/256,402%256, 0x22 , 0x78 , 0x1a }
};
/************************************************************
Volume Array
************************************************************/
const char Sta308aVolArray[51]={
VOL00,VOL01,VOL02,VOL03,VOL04,VOL05,VOL06,VOL07,VOL08,VOL09,
VOL10,VOL11,VOL12,VOL13,VOL14,VOL15,VOL16,VOL17,VOL18,VOL19,
VOL20,VOL21,VOL22,VOL23,VOL24,VOL25,VOL26,VOL27,VOL28,VOL29,
VOL30,VOL31,VOL32,VOL33,VOL34,VOL35,VOL36,VOL37,VOL38,VOL39,
VOL40,VOL41,VOL42,VOL43,VOL44,VOL45,VOL46,VOL47,VOL48,VOL49,VOL50
};
/*******************************************
initial sta308a
*******************************************/
void InitSta308a(void)
{
unsigned char Count;
for(Count=0; Count<0x54; Count++)
{
SendByteData(0x40,Count,Sta308a_InitDat[Count]);
}
Aud_Treble308=0x77;
ProcessEQ();
}
/*********************************************
POwer on St500
*********************************************/
void PowerSt500(void)
{
SendByteData(0x40,0x08,0x80);
}
/*********************************************
Power off St500
*********************************************/
void PowerOffSt500(void)
{
SendByteData(0x40,0x08,0x00);
}
/*********************************************
send Value to Sta308a
*********************************************/
void SendSta308aVol(unsigned char Dat)
{
SendByteData(0x40,Sta308a_Mvol,Sta308aVolArray[Dat]);
}
/*********************************************
Bass manager
*********************************************/
void SendSta308aBass(unsigned char Dat)
{
SendByteData(0x40,Sta308a_Tone,Dat);
}
/***********************************************
Mute sta308a
***********************************************/
void SendSta308aMuteOn(void)
{
SendByteData(0x40,Sta308a_Mmute,0x01);
}
/*********************************************
Mute off
*********************************************/
void SendSta308aMuteOff(void)
{
SendByteData(0x40,Sta308a_Mmute,0x00);
}
/**********************************************
Adjust EQ
**********************************************/
void Sta308aEQ(void)
{
//static unsigned char EQValue=0;
}
/***************************************
Select308AM(0);
***************************************/
void Select308AM(unsigned char i)
{
if(i==1)
{
SendByteData(0x40,Sta308a_Auto3,Sta308a_Auto3_Init+0x10);
}
else
{
SendByteData(0x40,Sta308a_Auto3,Sta308a_Auto3_Init);
}
}
/*******************************************
select am B
*******************************************/
void Slect308AMFreq(unsigned char i)
{
SendByteData(0x40,Sta308a_Auto3,Sta308a_Auto3_Init+0x10+i);
}
/********************************************
process EQ
********************************************/
static void ProcessEQ(void)
{
unsigned char EqCont0;
unsigned char EqCont1;
for(EqCont0=0; EqCont0<EQNum; EqCont0++)
{
for(EqCont1=0; EqCont1<EQVal; EqCont1++)
{
SendByteData(0x40,0x3b+EqCont1,Sta308aEQArray[EqCont0][EqCont1]);
}
SendByteData(0x40,0x4c,0x02);
}
for(EqCont0=0; EqCont0<EQSingleNum; EqCont0++)
{
for(EqCont1=0; EqCont1<EQSingleVal; EqCont1++)
{
SendByteData(0x40,0x3b+EqCont1,Sta308aEQSingleArray[EqCont0][EqCont1]);
}
SendByteData(0x40,0x4c,0x01);
}
}
/**************** end ***************************/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -