pcm1862: add pre-ADC gain setting

This commit is contained in:
marqs committed 2018-03-02 23:11:52 +02:00
1 parent 1cc42b808d
commit bc1b7419f2
10 files changed
+1038 -1017

No files matched your search

@@ -48,6 +48,13 @@ void pcm_source_sel(pcm_input_t input) {
pcm1862_writereg(PCM1862_ADC1R, adc_ch);
}
void pcm_set_gain(alt_8 db_gain) {
alt_8 gain_val = 2*db_gain;
pcm1862_writereg(PCM1862_PGA1L, gain_val);
pcm1862_writereg(PCM1862_PGA1R, gain_val);
}
int pcm1862_init()
{
if (pcm1862_readreg(0x05) != 0x86)
+3 -1
View File
@@ -30,7 +30,9 @@ typedef enum {
PCM_INPUT4 = 3
} pcm_input_t;
void pcm_source_sel(pcm_input_t input) ;
void pcm_source_sel(pcm_input_t input);
void pcm_set_gain(alt_8 db_gain);
int pcm1862_init();