PRELIMINARY
VS1063a Prog. Guide
5
WRITING PLUGINS
case APPL_W0:
// *** SCI_AICTRL0 has been written to
multL = DbToLin(n);
//
Convert decibel scale to linear, left
break;
case APPL_W1:
// *** SCI_AICTRL1 has been written to
multR = DbToLin(n);
//
Convert decibel scale to linear, right
break;
} /* switch(mode) */
return n;
// Default message answer is n
} /* MyPlugin() */
const u_int16 dBTab[6] = {
32768, 29193, 26008, 23170, 20643, 18390
};
auto u_int16 DbToLin(register u_int16 dB) {
if (dB >= 90)
return 0;
return dBTab[dB % 6] >> (dB/6);
}
5.2.4
Disabling the Audio Path Plugin
The plugin can be disabled by writing 0 to SCI_AIADDR through SCI.
The plugin can also turn itself off. However, in this case writing to SCI_AIADDR is not succi-
fient. The application needs to write NULL to the pointer variable applAddr (ASM convention:
_applAddr). The type for applAddr is shown below:
extern s_int16 (*applAddr)(s_int16 register __i0 **d, s_int16 register __a1 mode,
s_int16 register __a0 n);
5.2.5
VSIDE and Audio Path Plugins
VSIDE will get a VS1063a audio path plugin example in Q3/2011.
Version: 0.40, 2011-09-02
14