VS1053b PCM Mixer
=================

The PCM mixer allows a mono 8kHz linear PCM stream be played back during
any audio format playback. This 8kHz audio signal is then upsampled to
24kHz and played through the SDM side channel of vs1053.

The 8kHz PCM data is sent through the SCI_AICTRL1 register, SCI_AICTRL0
tells how much space is in the PCM FIFO (you can send upto this many words).
Note that SCI multiple write (see vs1053 datasheet) can be used to
write multiple words with minimal overhead.

SCI_AICTRL2 controls volume independently of the normal playback volume.
SCI_AICTRL2 value from 0 to 182 controls PCM volume in 0.5dB steps.

Note: to prevent sigma-delta modulator overflow, SCI_VOL should be
at least 2dB (0x0404), and the sum of SCI_VOL and SCI_AICTRL2 attenuations
at least 6dB (12). If you have not set large enough attenuations,
the PCM Mixer adjusts the registers automatically to have at least these
values. To have absolutely safe scaling, have 6dB (0x0c0c) or more in
both SCI_VOL and SCI_AICTRL2.

The PCM mixer takes about 4MHz of processing power when in use.
Processing will be automatically disabled after a 0.125-second timeout
when samples are not being written to SCI_AICTRL1. The processing
is resumed when there are at least 64 samples in the PCM FIFO (1/4 full).

The PCM mixer works with VS1053b Patches Package. If you use the
VS1053b Patches package, load it first, then the VS1053 PCM Mixer
(PCM Mixer uses the application hook).

Perform the the normal system startup (including loading of the vs1053
patches package if you are using it), then load vs1053pcm.plg and write
0x0d00 to AIADDR to start the PCM Mixer.
- read AICTRL0: tells how many samples can be sent
- write AICTRL1 to send the samples
- write AICTRL2 to set volume attenuation for the PCM stream

The PCM Mixer will deactivate in a software reset, so load it again
and write 0x0d00 to AIADDR to restart.

Pseudo-code:
    s_int16 samples[32];

	s_int16 availSpace = Mp3ReadReg(SCI_AICTRL0);
	if (availSpace > 32) {
	   ReadSamples(samples, 32);
	   Mp3WriteRegMultiple(SCI_AICTRL1, samples, 32);
	}
