mirror of
https://github.com/marqs85/ossc
synced 2026-10-30 19:57:20 +03:00
pcm1862: add pre-ADC gain setting
This commit is contained in:
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)
|
||||
|
||||
@@ -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();
|
||||
|
||||
|
||||
Reference in new issue
Block a user