PaulStoffregen/Audio — pull request #4 by robsoles (2014-02-08 07:29:51+00:00)
Title: Some filter additions, some SGTL5000 additions

Although I haven't had time/opportunity to test all AudioControlSGTL5000:: additions I have reviewed and reviewed the ones I haven't tested in this form for this library and I think they are OK and worthwhile so I decided to make the pull request already. I tested all of the basic functionality of similies of the additions in another form using the TWR-AUDIO-SGTL and a Teensy++ 2.0, hence my confidence of them.
The only thing of which I am not as confident is my change from 0x0505 to 0x0D0D for CHIP_LINE_OUT_VOL in AudioControlSGTL5000:init() - fair degree of confidence but I think it should be checked and reviewed about twice as much as everything else should be vigorously checked anyway.

added AudioBiquadFilter::
public:
void updateCoefs(int *source, bool noReset);
void updateCoefs(int *source);

added AudioControlSGTL5000::
private:
unsigned int modify(unsigned int reg, unsigned int val, unsigned int
iMask);

public:
unsigned int micGain(unsigned int n) { return modify(0x002A, n&3, 3); }
unsigned short lo_lvl_right(uint8_t n);
unsigned short lo_lvl_left(uint8_t n);
unsigned short lo_lvl(uint8_t n);
unsigned short dac_vol_right(float n);
unsigned short dac_vol_left(float n);
unsigned short dac_vol(float n);
unsigned short dap_mix_enable(uint8_t n);
unsigned short dap_enable(uint8_t n);
unsigned short dap_peqs(uint8_t n);
unsigned short dap_audio_eq(uint8_t n);
unsigned short dap_audio_eq_band(uint8_t bandNum, float n);
void dap_audio_eq_geq(float bass, float mid_bass, float midrange, float
mid_treble, float treble);
void dap_audio_eq_tone(float bass, float treble);
void load_peq(uint8_t filterNum, int *filterParameters);
void route(uint8_t via_i2s, uint8_t via_dap);